/*
 * Cabecera, footer y botón "volver arriba" compartidos entre la SPA (spa/index.html)
 * y las páginas de client (productos, producto-detalle).
 * No define colores de body para no pisar los estilos propios de cada página.
 */

:root {
    --black: #0a0a0a;
    --red: #c8102e;
    --red-dark: #920b21;
    /* Guinda de los botones, el mismo del botón de WhatsApp de Contáctenos. */
    --guinda: #8b1a1a;
    --guinda-dark: #6f1414;
    --white: #ffffff;
    --gray-text: #c7c7c7;
    --line-dark: rgba(255, 255, 255, 0.08);
    --font: 'Montserrat', Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    padding-top: 82px;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Header */

.header {
    background: var(--black);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-family: var(--font);
}

.header__bar {
    max-width: 1360px;
    height: 82px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 48px;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img {
    height: 30px;
    width: auto;
    display: block;
}

.nav {
    display: flex;
    align-items: center;
    gap: 36px;
    margin-right: auto;
}

.nav__link {
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
    text-decoration: none;
    padding-bottom: 6px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav__link:hover {
    color: var(--red);
}

.nav__link.is-active {
    color: var(--red);
    border-bottom-color: var(--red);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
}

/* Selector de idioma */

.lang-switch {
    position: relative;
    flex-shrink: 0;
    font-family: var(--font);
    /* Hasta que el JS pinta el idioma activo se oculta para no mostrar una
       bandera que no corresponde. */
    visibility: hidden;
}

.lang-switch.is-ready {
    visibility: visible;
}

.lang-switch__toggle,
.lang-switch__option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    background: none;
    border: 0;
    cursor: pointer;
}

.lang-switch__toggle {
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.lang-switch__toggle:hover,
.lang-switch.is-open .lang-switch__toggle {
    border-color: var(--red);
    background: rgba(200, 16, 46, 0.12);
}

.lang-switch__flag {
    display: flex;
    width: 20px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.lang-switch__flag img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.lang-switch__chevron {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.lang-switch.is-open .lang-switch__chevron {
    transform: rotate(180deg);
}

.lang-switch__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 156px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
    display: none;
    z-index: 50;
}

.lang-switch.is-open .lang-switch__menu {
    display: block;
}

.lang-switch__option {
    width: 100%;
    padding: 9px 10px;
    border-radius: 7px;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-switch__option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lang-switch__option.is-active {
    color: var(--red);
}

/*
 * Google Translate inyecta su propia barra superior y un contenedor visible.
 * Se ocultan porque el control del idioma es el de arriba, y sobre todo porque
 * esa barra empuja el <body> y descuadra el header fijo.
 */

#google_translate_element,
.goog-te-banner-frame,
.goog-te-gadget,
iframe.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}

/* Footer */

.footer {
    position: relative;
    background: var(--black);
    color: var(--gray-text);
    padding: 72px 0 0;
    overflow: hidden;
    font-family: var(--font);
}

.footer__watermark {
    position: absolute;
    top: 0;
    right: 4%;
    height: 100%;
    width: auto;
    opacity: 0.05;
    pointer-events: none;
    user-select: none;
}

.footer__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr 1.4fr;
    gap: 40px;
    padding-bottom: 56px;
}

.footer__brand {
    position: relative;
    padding-right: 40px;
}

.footer__brand::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.18);
}

.footer__logo {
    height: 26px;
    width: auto;
    display: block;
    margin: 0 0 14px 0;
}

.footer__tagline {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px 0;
    max-width: 280px;
}

.footer__social {
    display: flex;
    gap: 12px;
}

.footer__social a {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sin esto, el display:flex de arriba le gana a la regla [hidden] del navegador. */
.footer__social a[hidden] {
    display: none;
}

.footer__social img {
    width: 38px;
    height: 38px;
    display: block;
}

.footer__col h4 {
    color: var(--white);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0 0 18px 0;
}

.footer__col a,
.footer__col p {
    display: block;
    font-size: 14px;
    line-height: 2;
    color: var(--gray-text);
    text-decoration: none;
    margin: 0;
}

.footer__copy {
    margin: 24px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.footer__col .footer__contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer__contact-row img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
}

/* Scroll to top */

.scroll-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--guinda);
    color: var(--white);
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    z-index: 45;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background-color 0.2s ease;
}

.scroll-top svg {
    width: 20px;
    height: 20px;
}

/* Botón flotante de WhatsApp: siempre visible, justo encima del de "volver
   arriba" para que no se pisen cuando ese aparece al hacer scroll. */
.whatsapp-float {
    position: fixed;
    right: 24px;
    bottom: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    color: var(--white);
    background: #25d366;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    z-index: 45;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.whatsapp-float:hover {
    background: #1da851;
    transform: translateY(-2px);
}

.whatsapp-float svg {
    width: 30px;
    height: 30px;
}

.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--guinda-dark);
}

/* Responsive */

@media (max-width: 960px) {
    .footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer__brand {
        grid-column: 1 / -1;
        padding-right: 0;
        padding-bottom: 32px;
    }

    .footer__brand::after {
        top: auto;
        bottom: 0;
        left: 0;
        right: auto;
        width: 100%;
        height: 1px;
    }
}

@media (max-width: 720px) {
    body {
        padding-top: 68px;
    }

    .whatsapp-float {
        right: 16px;
        bottom: 76px;
        width: 48px;
        height: 48px;
    }

    .whatsapp-float svg {
        width: 26px;
        height: 26px;
    }

    .scroll-top {
        right: 16px;
        bottom: 16px;
    }

    .header__bar {
        height: 68px;
        padding: 0 20px;
        gap: 12px;
    }

    /* El .nav queda fuera de flujo (absolute), así que el margen automático del
       selector empuja a la derecha todo el bloque idioma + botón de menú. */
    .lang-switch {
        order: 1;
        margin-left: auto;
    }

    .nav-toggle {
        display: flex;
        order: 2;
    }

    .lang-switch__toggle {
        padding: 6px 10px;
        font-size: 13px;
    }

    .lang-switch__label {
        display: none;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--black);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 8px 20px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        display: none;
    }

    .nav.is-open {
        display: flex;
    }

    .nav__link {
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .footer__grid {
        grid-template-columns: 1fr;
    }

    .footer__brand {
        grid-column: auto;
    }
}
