/**
 * Header San Francisco.
 * Origen legacy (orden de cascada original): estilos/generales/estructura.css,
 * theme/estilos/generales/template_estructura.css, estilos/especificos/bootstrapmin_edit.css
 * y theme/estilos/especificos/template_portada.css (.tana-float-mobile).
 * Valores rem/px copiados sin reescalar (html 62.5%).
 * Contexto: header.sanfrancisco-header. El prefijo "html body.template-sanfrancisco" sube la
 * especificidad para ganar a los selectores "header ..." de /templates/_base (menu.css y header.css),
 * que se cargan siempre antes y de otro modo pisan tamaños, paddings y colores de este template.
 */

html body.template-sanfrancisco header.sanfrancisco-header {
    display: block;
    width: 100%;
    z-index: 1000;
}

@media (min-width: 992px) {
    html body.template-sanfrancisco header.sanfrancisco-header {
        position: sticky;
        top: 0;
    }
}

html body.template-sanfrancisco header.sanfrancisco-header .header-1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-1 {
    justify-content: right;
    padding: 1.2rem 0rem;
    background: var(--azul-oscuro);
}

html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-1 .header-1 {
    justify-content: right;
    gap: normal;
}

html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-2 {
    background: var(--primario);
    padding: 0rem;
}

html body.template-sanfrancisco header.sanfrancisco-header .redes {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
}

html body.template-sanfrancisco header.sanfrancisco-header .icono-red {
    width: 20px;
    height: 20px;
    stroke: white;
    fill: none;
    margin: 0 4px;
}

html body.template-sanfrancisco header.sanfrancisco-header .logo {
    height: 11rem;
    transition: height 0.5s ease-in-out;
}

html body.template-sanfrancisco header.sanfrancisco-header .header_modulo {
    margin-left: auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

html body.template-sanfrancisco header.sanfrancisco-header .header_buttons {
    display: flex;
    gap: 1rem;
}

/* Menú */
html body.template-sanfrancisco header.sanfrancisco-header .navbar {
    transition: padding 0.5s ease-in-out;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler {
    border: none;
    padding: 0;
    outline: none;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler:focus {
    box-shadow: none;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler .hamburger-toggle {
    position: relative;
    display: inline-block;
    width: 5rem;
    height: 5rem;
    z-index: 11;
    float: right;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler .hamburger-toggle .hamburger {
    position: absolute;
    transform: translate(-50%, -50%) rotate(0deg);
    left: 50%;
    top: 50%;
    width: 50%;
    height: 50%;
    pointer-events: none;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler .hamburger-toggle .hamburger span {
    width: 100%;
    height: 0.4rem;
    position: absolute;
    background: var(--blanco);
    border-radius: 0.2rem;
    z-index: 1;
    transition: transform 0.2s cubic-bezier(0.77, 0.2, 0.05, 1),
        background 0.2s cubic-bezier(0.77, 0.2, 0.05, 1), all 0.2s ease-in-out;
    left: 0rem;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler .hamburger-toggle .hamburger span:first-child {
    top: 10%;
    transform-origin: 50% 50%;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler .hamburger-toggle .hamburger span:nth-child(2) {
    top: 50%;
    transform: translate(0, -50%);
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler .hamburger-toggle .hamburger span:last-child {
    left: 0rem;
    top: auto;
    bottom: 10%;
    transform-origin: 50% 50%;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler:not(.collapsed) .hamburger-toggle .hamburger span:first-child {
    top: 45%;
    transform: rotate(45deg);
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler:not(.collapsed) .hamburger-toggle .hamburger span:nth-child(2) {
    left: 50%;
    width: 0rem;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-toggler:not(.collapsed) .hamburger-toggle .hamburger span:last-child {
    top: 45%;
    transform: rotate(-45deg);
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-collapse {
    flex-grow: 0;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-expand-lg .navbar-collapse {
    justify-content: center;
    font-size: 2rem;
    transition: font-size 0.5s ease-in-out;
}

@media (max-width: 1400px) {
    html body.template-sanfrancisco header.sanfrancisco-header .navbar-expand-lg .navbar-collapse {
        font-size: 1.8rem;
    }
}

@media (min-width: 768px) {
    html body.template-sanfrancisco header.sanfrancisco-header .navbar-expand-lg .navbar-collapse {
        margin-left: 50px;
    }
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-nav {
    gap: 3rem;
    text-transform: uppercase;
}

html body.template-sanfrancisco header.sanfrancisco-header .nav-link {
    position: relative;
    text-decoration: none;
    transition: color 0.3s;
}

html body.template-sanfrancisco header.sanfrancisco-header .nav-link::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0.5rem;
    background-color: var(--secundario);
    bottom: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s, transform 0.3s;
}

@media (min-width: 991px) {
    html body.template-sanfrancisco header.sanfrancisco-header .nav-link:hover::after {
        width: 60%;
        transform: translateX(-50%) scaleX(1.5);
    }
}

html body.template-sanfrancisco header.sanfrancisco-header .nav-item a:hover {
    text-decoration: none;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-nav .nav-link,
html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-nav .nav-link:focus,
html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-nav .nav-link:hover,
html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-nav .nav-link.active,
html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-nav .show > .nav-link {
    color: var(--blanco);
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-nav .nav-link {
    font-size: 1.8rem;
    font-weight: 800;
    text-transform: none !important;
}

html body.template-sanfrancisco header.sanfrancisco-header .nav-link:focus,
html body.template-sanfrancisco header.sanfrancisco-header .nav-link:active {
    outline: none !important;
    box-shadow: none !important;
}

html body.template-sanfrancisco header.sanfrancisco-header .nav-link i {
    font-size: 1.2rem;
}

html body.template-sanfrancisco header.sanfrancisco-header .dropdown-menu.show {
    animation: sanfrancisco-fade-in 0.3s alternate;
}

@keyframes sanfrancisco-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mega menú */
html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega {
    position: static;
}

html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega .dropdown-menu,
html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega-2 .dropdown-menu {
    width: 100%;
    top: auto;
    text-transform: none;
    padding: 2rem 1rem;
    margin-top: 3.5rem;
}

@media (min-width: 992px) {
    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega-2 .dropdown-menu,
    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega .dropdown-menu {
        position: fixed;
        border-color: var(--blanco);
        max-height: calc(100vh - 150px);
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega .dropdown-menu .mega-content,
    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega-2 .dropdown-menu .mega-content {
        max-height: calc(100vh - 200px);
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        position: relative;
        z-index: 1;
    }
}

html body.template-sanfrancisco header.sanfrancisco-header .contenedor-columnas {
    display: flex;
    justify-content: flex-start;
    gap: 14px;
    flex-wrap: wrap;
}

html body.template-sanfrancisco header.sanfrancisco-header .columna {
    min-width: 25rem;
}

html body.template-sanfrancisco header.sanfrancisco-header .columna:last-child {
    margin-right: 0;
}

html body.template-sanfrancisco header.sanfrancisco-header .top-line {
    height: 2px;
    width: auto !important;
    margin-bottom: 8px;
    background: linear-gradient(to right, var(--primario), var(--secundario));
    border-radius: 2px;
}

html body.template-sanfrancisco header.sanfrancisco-header .columna-1 .top-line {
    border-top: 0.3rem solid var(--verde);
}

html body.template-sanfrancisco header.sanfrancisco-header .columna-2 .top-line {
    border-top: 0.3rem solid var(--violeta);
}

html body.template-sanfrancisco header.sanfrancisco-header .columna-3 .top-line {
    border-top: 0.3rem solid var(--naranja);
}

html body.template-sanfrancisco header.sanfrancisco-header .columna-4 .top-line {
    border-top: 0.3rem solid var(--amarillo);
}

html body.template-sanfrancisco header.sanfrancisco-header .columna-5 .top-line {
    border-top: 0.3rem solid var(--rojo);
}

html body.template-sanfrancisco header.sanfrancisco-header .columna-6 .top-line {
    border-top: 0.3rem solid var(--celeste);
}

html body.template-sanfrancisco header.sanfrancisco-header .columna-7 .top-line {
    border-top: 0.3rem solid var(--azul);
}

html body.template-sanfrancisco header.sanfrancisco-header .nombre-contendor-items {
    font-size: 1.7rem;
    font-weight: 800;
    display: inline-block;
    line-height: 0;
    padding-bottom: 1.5rem;
    text-transform: none !important;
}

html body.template-sanfrancisco header.sanfrancisco-header .icon-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

html body.template-sanfrancisco header.sanfrancisco-header .icon-label a {
    color: var(--negro);
}

html body.template-sanfrancisco header.sanfrancisco-header .icon-label a:hover {
    color: var(--primario);
}

html body.template-sanfrancisco header.sanfrancisco-header .items-group .sub-menu a {
    text-transform: none !important;
}

/* Botón del asistente */
html body.template-sanfrancisco header.sanfrancisco-header .header-assistant {
    display: flex;
    align-items: center;
    margin-left: 15px;
    height: 100%;
}

html body.template-sanfrancisco header.sanfrancisco-header .assistant-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 30px;
    background: var(--primario);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0 20px 0 50px;
    font-family: var(--fuente);
    text-transform: uppercase;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    font-size: 1.1rem;
    white-space: nowrap;
    position: relative;
    overflow: visible;
    cursor: pointer;
}

html body.template-sanfrancisco header.sanfrancisco-header .assistant-content {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

html body.template-sanfrancisco header.sanfrancisco-header .assistant-gif-container {
    position: absolute;
    left: -60px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    background: white;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: sanfrancisco-pulse 3s infinite;
}

html body.template-sanfrancisco header.sanfrancisco-header .assistant-gif {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html body.template-sanfrancisco header.sanfrancisco-header .assistant-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    background: linear-gradient(135deg, var(--secundario) 0%, var(--primario) 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

html body.template-sanfrancisco header.sanfrancisco-header .assistant-btn:hover .assistant-gif {
    transform: scale(1.08) rotate(-5deg);
}

html body.template-sanfrancisco header.sanfrancisco-header .assistant-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

html body.template-sanfrancisco header.sanfrancisco-header .assistant-btn:hover .assistant-gif-container {
    animation: none;
    transform: scale(1.05);
}

@keyframes sanfrancisco-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Asistente flotante mobile */
html body.template-sanfrancisco header.sanfrancisco-header .tana-float-mobile {
    display: none;
}

html body.template-sanfrancisco header.sanfrancisco-header .tana-float-mobile .assistant-gif {
    display: inline;
}

@media (max-width: 767px) {
    html body.template-sanfrancisco header.sanfrancisco-header .tana-float-mobile {
        display: block;
        position: fixed;
        bottom: 250px;
        right: 16px;
        z-index: 9998;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .tana-float-mobile picture img,
    html body.template-sanfrancisco header.sanfrancisco-header .tana-float-mobile .assistant-gif {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        border: 2px solid var(--primario);
    }
}

/*
 * Valores del legacy que _base/menu.css y _base/header.css redefinen, y valores de Bootstrap 5.0.2
 * (legacy) que difieren de Bootstrap 5.3.2 (core). Se fijan explícitos para igualar al legacy.
 */
html body.template-sanfrancisco header.sanfrancisco-header .menu {
    flex: 0 1 auto;
}

html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-2 .navbar {
    padding: 0.5rem 0;
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-nav .nav-link {
    padding: 0.5rem 0;
    border-bottom: 0;
    letter-spacing: normal;
    line-height: 1.5;
}

@media (min-width: 992px) {
    html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-nav .nav-link {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }
}

html body.template-sanfrancisco header.sanfrancisco-header .navbar-collapse {
    padding: 0;
    margin: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

html body.template-sanfrancisco header.sanfrancisco-header .sub-menu {
    margin-bottom: 0;
}

html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega .dropdown-menu,
html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega-2 .dropdown-menu {
    margin-top: 3.5rem;
    background-color: var(--blanco);
    color: #212529;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: none;
}

@media (min-width: 992px) {
    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega .dropdown-menu,
    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega-2 .dropdown-menu {
        border-color: var(--blanco);
    }
}

html body.template-sanfrancisco header.sanfrancisco-header .contenedor-columnas {
    flex-direction: row;
    align-items: normal;
}

html body.template-sanfrancisco header.sanfrancisco-header .columna {
    max-width: none;
}

html body.template-sanfrancisco header.sanfrancisco-header .nombre-contendor-items {
    margin-bottom: 0;
    color: #212529;
}

html body.template-sanfrancisco header.sanfrancisco-header .items-group {
    display: block;
    flex-direction: row;
    gap: normal;
}

html body.template-sanfrancisco header.sanfrancisco-header .header-assistant {
    min-width: auto;
}

html body.template-sanfrancisco header.sanfrancisco-header .sub-menu a {
    display: inline;
    padding: 0;
    font-size: inherit;
    transition: none;
}

html body.template-sanfrancisco header.sanfrancisco-header .sub-menu a:hover {
    padding-left: 0;
}

/* Responsive */
@media (max-width: 992px) {
    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-2 {
        background: var(--primario);
        padding: 0rem;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .container-fluid {
        padding: 0rem;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-2 .navbar {
        padding: 0;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .navbar-nav {
        gap: 1.5rem;
        padding: 2rem 1rem;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-brand {
        padding: 1rem;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega .dropdown-menu {
        width: 100%;
    }
}

@media (max-width: 768px) {
    html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-nav .nav-link {
        color: var(--negro) !important;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .navbar-collapse {
        background: var(--blanco);
    }

    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega .dropdown-menu,
    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega-2 .dropdown-menu {
        margin-top: 0rem !important;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega .dropdown-menu,
    html body.template-sanfrancisco header.sanfrancisco-header .nav-item.dropdown.dropdown-mega-2 .dropdown-menu {
        border: none;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .header-assistant {
        position: fixed;
        bottom: 20px;
        right: 15px;
        z-index: 1000;
        margin: 0;
        display: none;
        width: auto;
        height: auto;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-1 .header-assistant,
    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-2 .header-assistant {
        display: none !important;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .assistant-btn {
        min-width: 140px;
        height: 35px;
        font-size: 0.85rem;
        padding: 0 15px 0 45px;
        font-weight: 600;
        border-radius: 30px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    html body.template-sanfrancisco header.sanfrancisco-header .assistant-gif-container {
        width: 50px;
        height: 50px;
        left: -60px;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    }

    html body.template-sanfrancisco header.sanfrancisco-header .assistant-text {
        font-size: 1rem;
        line-height: 1.1;
        text-align: left;
        padding-right: 5px;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .assistant-btn:hover .assistant-gif {
        transform: scale(1.05) rotate(-3deg);
    }
}

@media (max-width: 576px) {
    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-columnas {
        flex-direction: column;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .menu {
        width: 100%;
    }
}

@media (max-width: 480px) {
    html body.template-sanfrancisco header.sanfrancisco-header .sub-menu {
        margin-bottom: 1rem;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .icon-label {
        font-size: 1.7rem;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .navbar-light .navbar-brand {
        padding: 1rem 0rem;
    }
}

@media (max-width: 991.98px) {
    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-1,
    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-2 {
        left: 0;
        right: 0;
        width: 100%;
        transform: none !important;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-1 {
        position: fixed;
        top: 0;
        z-index: 1090;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-2 {
        position: fixed;
        top: 46px;
        z-index: 1080;
    }

    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-1 .container,
    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-2 .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.template-sanfrancisco {
        padding-top: calc(110px + 64px);
    }

    html body.template-sanfrancisco header.sanfrancisco-header .contenedor-header-2 .navbar-collapse {
        max-height: calc(100vh - 46px - 64px);
        overflow-y: auto;
    }
}
