/* ==========================================================================
   SanMiguel — Header / Menú principal
   CSS autocontenido. No depende del build de Tailwind (style.css es precompilado).
   Prefijo: .sm-hdr / .sm-nav
   ========================================================================== */

.sm-hdr {
    --sm-h-primary: #bb976d;
    --sm-h-primary-dark: #a37f56;
    --sm-h-title: #172430;
    --sm-h-body: #55606b;
    --sm-h-line: #e2ddd5;
    --sm-h-ease: cubic-bezier(0.22, 1, 0.36, 1);
    transition: top 0.35s var(--sm-h-ease);
    will-change: top;
}

/* --- Barra ---------------------------------------------------------------- */
.sm-hdr__bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(23, 36, 48, 0.07);
    border-radius: 6px;
    padding: 10px 14px 10px 18px;
    box-shadow: 0 12px 34px rgba(15, 24, 33, 0.1);
    transition: padding 0.35s var(--sm-h-ease), background 0.35s ease, box-shadow 0.35s ease, border-radius 0.35s ease;
}

@media (min-width: 1025px) {
    .sm-hdr__bar {
        padding: 6px 8px 6px 24px;
    }
}

/* Estado fijo al hacer scroll (scripts.js agrega .sticky-header a partir de 245px).
   La barra blanca de ancho completo la pinta .header-v4.sticky-header en style.css,
   así que aquí desactivamos la tarjeta flotante para que se lea como una sola barra. */
.sm-hdr.sticky-header .sm-hdr__bar {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-color: transparent;
    border-radius: 0;
    box-shadow: none;
    padding-top: 4px;
    padding-bottom: 4px;
}

@media (min-width: 1025px) {
    .sm-hdr.sticky-header .sm-hdr__bar {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* --- Logo ----------------------------------------------------------------- */
.sm-hdr__brand {
    display: flex;
    align-items: center;
    flex: none;
}

.sm-hdr__brand img {
    display: block;
    width: auto;
    height: 46px;
    transition: height 0.35s var(--sm-h-ease);
}

.sm-hdr.sticky-header .sm-hdr__brand img {
    height: 38px;
}

@media (max-width: 640px) {
    .sm-hdr__brand img {
        height: 38px;
    }
}

/* --- Zona derecha --------------------------------------------------------- */
.sm-hdr__right {
    display: flex;
    align-items: center;
    gap: 18px;
}

@media (min-width: 1025px) {
    .sm-hdr__right {
        gap: 28px;
    }
}

/* --- Navegación ----------------------------------------------------------- */
.sm-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sm-nav__link {
    position: relative;
    font-family: "Josefin Sans", ui-sans-serif, system-ui, sans-serif;
    color: var(--sm-h-body);
    line-height: 1;
    transition: color 0.25s ease;
}

.sm-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--sm-h-primary);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.35s var(--sm-h-ease);
}

.sm-nav__link:hover,
.sm-nav__link.is-active {
    color: var(--sm-h-title);
}

.sm-nav__link:hover::after,
.sm-nav__link.is-active::after {
    transform: scaleX(1);
}

@media (min-width: 1025px) {
    .sm-hdr .main-menu > ul {
        display: flex;
        align-items: center;
        gap: 32px;
    }

    .sm-hdr .main-menu > ul > li {
        padding-top: 20px;
        padding-bottom: 20px;
        transition: padding 0.35s var(--sm-h-ease);
    }

    .sm-hdr.sticky-header .main-menu > ul > li {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .sm-hdr .main-menu ul li a.sm-nav__link {
        display: inline-flex;
        font-size: 16.5px;
        font-weight: 500;
        letter-spacing: 0.01em;
        padding: 0 0 6px;
    }

    .sm-hdr .main-menu ul li a.sm-nav__link.is-active {
        font-weight: 600;
    }
}

/* --- Teléfono ------------------------------------------------------------- */
.sm-hdr__phone {
    display: none;
    align-items: center;
    gap: 8px;
    color: var(--sm-h-title);
    font-family: "Josefin Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    white-space: nowrap;
    transition: color 0.25s ease;
}

.sm-hdr__phone svg {
    width: 17px;
    height: 17px;
    flex: none;
    stroke: var(--sm-h-primary);
}

.sm-hdr__phone:hover {
    color: var(--sm-h-primary);
}

@media (min-width: 1024px) {
    .sm-hdr__phone--desk {
        display: inline-flex;
    }
}

/* --- CTA ------------------------------------------------------------------ */
.sm-hdr__cta {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--sm-h-primary);
    color: #fff;
    font-family: "Josefin Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1;
    padding: 14px 22px;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.3s ease, transform 0.3s var(--sm-h-ease), box-shadow 0.3s ease;
}

.sm-hdr__cta svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.sm-hdr__cta:hover {
    background: var(--sm-h-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(187, 151, 109, 0.35);
}

@media (min-width: 1025px) {
    .sm-hdr__cta--desk {
        display: inline-flex;
    }
}

/* --- Panel móvil ---------------------------------------------------------- */
.sm-nav__foot {
    display: none;
}

@media (max-width: 1024px) {
    .sm-hdr .main-menu {
        border-radius: 0 0 8px 8px;
        border-top: 1px solid var(--sm-h-line);
        box-shadow: 0 18px 34px rgba(15, 24, 33, 0.14);
        padding: 4px 18px 20px;
    }

    .sm-hdr .main-menu > ul > li + li {
        border-top: 1px solid rgba(23, 36, 48, 0.08);
    }

    .sm-hdr .main-menu ul li a.sm-nav__link {
        display: flex;
        align-items: center;
        font-size: 17px;
        font-weight: 500;
        color: var(--sm-h-title);
        padding: 15px 2px;
    }

    .sm-hdr .main-menu ul li a.sm-nav__link::after {
        left: 0;
        right: auto;
        width: 22px;
        bottom: 9px;
    }

    .sm-hdr .main-menu ul li a.sm-nav__link.is-active {
        color: var(--sm-h-primary);
    }

    .sm-nav__foot {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-top: 18px;
    }

    .sm-nav__foot .sm-hdr__cta,
    .sm-nav__foot .sm-hdr__phone {
        display: inline-flex;
        justify-content: center;
    }

    .sm-nav__foot .sm-hdr__phone {
        font-size: 16px;
    }
}

/* --- Accesibilidad -------------------------------------------------------- */
.sm-hdr a:focus-visible,
.sm-hdr button:focus-visible {
    outline: 2px solid var(--sm-h-primary);
    outline-offset: 3px;
    border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .sm-hdr,
    .sm-hdr__bar,
    .sm-hdr__brand img,
    .sm-nav__link::after,
    .sm-hdr__cta {
        transition: none !important;
    }
}
