/**
 * Estilos compartidos Header y Footer - Ticketshop
 * Variables de tema y reglas para que header/footer respondan al modo oscuro.
 * Incluir este CSS en todas las páginas que usan includes/header.php y includes/footer.php.
 */
:root {
    --header-height: 68px;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-tertiary: #6a6a6a;
    --border-color: #ddd;
    --shadow: rgba(0, 0, 0, 0.1);
    --overlay: rgba(255, 255, 255, 0.3);
}

/* Densidad adaptativa para notebooks con poca altura útil (por ejemplo, 13"). */
@media (min-width: 900px) and (max-height: 800px) {
    html {
        font-size: 14px;
    }

    :root {
        --header-height: 60px;
    }
}

[data-theme="dark"],
body[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --bg-tertiary: #333;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #888;
    --border-color: #444;
    --shadow: rgba(0, 0, 0, 0.5);
    --overlay: rgba(0, 0, 0, 0.7);
}

/* ----- Header ----- */
.header {
    background: var(--bg-secondary);
    padding: 4px 30px;
    box-shadow: 0 2px 10px var(--shadow);
    margin-bottom: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10010;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, color 0.35s ease, backdrop-filter 0.35s ease, -webkit-backdrop-filter 0.35s ease;
    isolation: isolate;
    backface-visibility: hidden;
}

/* Mantiene el header en su propia capa en Firefox sin perder el efecto glass. */
@supports (-moz-appearance: none) {
    .header,
    .header.header--glass,
    [data-theme="dark"] .header.header--glass,
    html[data-theme="dark"] .header.header--glass {
        position: fixed !important;
        transform: translateZ(0);
        will-change: transform;
    }

    .header.header--glass {
        background: rgba(255, 255, 255, 0.72);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        backdrop-filter: blur(20px) saturate(180%);
    }

    [data-theme="dark"] .header.header--glass,
    html[data-theme="dark"] .header.header--glass {
        background: rgba(28, 28, 30, 0.72);
    }
}

/* Efecto Liquid Glass al hacer scroll: translúcido + blur (estilo iOS / Apple) */
.header.header--glass {
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .header.header--glass,
html[data-theme="dark"] .header.header--glass {
    background: rgba(28, 28, 30, 0.72);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 4px 24px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    position: relative;
}

.header-cart-button {
    position: relative;
    display: inline-flex;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-decoration: none;
}

.header-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 2px solid var(--bg-secondary);
    border-radius: 999px;
    background: var(--motogp-red, #c80502);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 16px;
    text-align: center;
}

.header-vip-experience-banner {
    position: absolute;
    top: 100%;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1rem;
    border-radius: 0 0 0.8rem 0.8rem;
    background: linear-gradient(100deg, #8a6810, #d4af37, #fff0a8, #b18413);
    color: #241a00;
    box-shadow: 0 8px 22px rgba(115, 80, 0, 0.28);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.header.header--glass .header-vip-experience-banner {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -0.75rem);
}

html[data-vip-experience] {
    /* Tokens del ticketshop (hex) + tokens Tailwind (HSL sin hsl()) */
    --motogp-red: #c69b22;
    --motogp-red-dark: #8a6810;
    --racing-red: 43 71% 45%;
    --racing-red-dark: 43 79% 30%;
    --primary: 43 71% 45%;
    --vip-gold-gradient: linear-gradient(100deg, #8a6810, #d4af37, #fff0a8, #b18413);
    --vip-gold-ink: #241a00;
}

html[data-vip-experience] .text-racing-red {
    color: #c69b22 !important;
}

html[data-vip-experience] .border-racing-red {
    border-color: #c69b22 !important;
}

/* CTAs Tailwind del flujo (merch, checkout, diálogos): mismo oro que en /buy */
html[data-vip-experience] .bg-racing-red,
html[data-vip-experience] .bg-gradient-red {
    background: var(--vip-gold-gradient) !important;
    color: var(--vip-gold-ink) !important;
    box-shadow: 0 8px 22px rgba(115, 80, 0, 0.28) !important;
}

html[data-vip-experience] .bg-racing-red:hover,
html[data-vip-experience] .bg-gradient-red:hover {
    background: var(--vip-gold-gradient) !important;
    color: var(--vip-gold-ink) !important;
    filter: brightness(1.05);
    box-shadow: 0 0 26px rgba(212, 175, 55, 0.46) !important;
}

html[data-vip-experience] .shadow-red {
    box-shadow: 0 10px 40px -10px rgba(180, 132, 12, 0.55) !important;
}

html[data-vip-experience] .header-cart-count,
html[data-vip-experience] .header-cart-badge {
    background: var(--vip-gold-gradient) !important;
    color: var(--vip-gold-ink) !important;
    border-color: #fff0a8;
}

.header-cta-motogp-wrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    pointer-events: none;
}
.header-cta-motogp-wrap.is-visible {
    pointer-events: auto;
}
.header-cta-motogp-wrap.is-visible .header-cta-motogp,
.header-cta-motogp-wrap.is-visible .header-cta-motogp-round {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.header-cta-motogp-round {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease, background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.header-cta-motogp-round:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
    transform: translateY(-1px);
}
.header-cta-motogp-round:focus {
    outline: 2px solid var(--motogp-red, #c80502);
    outline-offset: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-right-desktop {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botones del header: mismo estilo (fondo, borde) y cursor pointer */
.header-right-desktop .theme-toggle,
.header-right-desktop .preference-toggle,
.header-right-desktop .favorites-button,
.header-right-desktop .language-button,
.header-right-desktop .login-button,
.header-right-desktop .user-menu-button {
    height: 40px;
    border-radius: 999px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--border-color) !important;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.header-right-desktop .theme-toggle {
    width: auto;
    min-width: 62px;
    padding: 2px;
}

.header-right-desktop .preference-toggle {
    width: auto;
    min-width: auto;
    padding: 2px;
    gap: 0;
}

.header-right-desktop .preference-toggle--currency {
    min-width: 72px;
}

.header-right-desktop .preference-toggle--map {
    min-width: 72px;
}

.header-right-desktop .preference-toggle--lang {
    min-width: 96px;
}

.header-right-desktop .favorites-button {
    width: 40px;
    padding: 0;
}

.header-right-desktop .language-button {
    min-width: 72px;
}

.header-right-desktop .login-button {
    padding: 0 14px;
}

/* Botón COMPRAR TICKETS + Favoritos + Compartir en header (solo página MotoGP, se muestran al hacer scroll) */
.header-cta-motogp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    background: #c80502;
    border: none;
    border-radius: 9999px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.2s ease;
}
.header-cta-motogp:hover {
    background: #a00402;
    color: #fff;
}

.header-right-mobile {
    display: none;
    align-items: center;
    gap: 15px;
}

.mobile-menu-toggle,
.mobile-search-toggle {
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Logo header: 60px (50% más que 40px), solo una versión visible según tema */
.header-logo {
    height: 60px;
    max-height: 60px;
    width: auto;
    max-width: 240px;
    flex-shrink: 0;
}

.header-logo a {
    cursor: pointer;
    display: inline-block;
    height: 100%;
    line-height: 0;
}

.header-logo img {
    display: block;
    height: 60px;
    max-height: 60px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    object-position: left center;
    transition: opacity 0.3s ease;
}

/* Logo: mostrar solo uno según tema (con !important para que no lo pise otro CSS) */
.header .header-logo-light {
    display: block !important;
}

.header .header-logo-dark {
    display: none !important;
}

body[data-theme="dark"] .header .header-logo-light,
html[data-theme="dark"] .header .header-logo-light {
    display: none !important;
}

body[data-theme="dark"] .header .header-logo-dark,
html[data-theme="dark"] .header .header-logo-dark {
    display: block !important;
}

body[data-theme="light"] .header .header-logo-dark,
html[data-theme="light"] .header .header-logo-dark,
body:not([data-theme]) .header .header-logo-dark {
    display: none !important;
}

body[data-theme="light"] .header .header-logo-light,
html[data-theme="light"] .header .header-logo-light,
body:not([data-theme]) .header .header-logo-light {
    display: block !important;
}

/* Theme toggle — pill sol/luna (estilo Alcance / Apple) */
.theme-toggle {
    cursor: pointer;
    pointer-events: auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    margin: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
}

body[data-theme="light"] .theme-toggle,
html[data-theme="light"] .theme-toggle,
html:not(.dark) .theme-toggle,
body:not([data-theme]) .theme-toggle {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.06);
}

html.dark .theme-toggle,
html[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .theme-toggle {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.theme-toggle-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
    width: 56px;
    height: 30px;
}

.theme-toggle-track::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
    pointer-events: none;
    z-index: 0;
}

body[data-theme="light"] .theme-toggle-track::before,
html[data-theme="light"] .theme-toggle-track::before,
body:not([data-theme]) .theme-toggle-track::before {
    background: rgba(0, 0, 0, 0.12);
}

.theme-toggle[data-active-theme="dark"] .theme-toggle-track::before {
    transform: translateX(26px);
}

.theme-toggle-icon {
    position: relative;
    z-index: 1;
    width: 22px;
    height: 22px;
    padding: 4px;
    margin: 2px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.45);
    transition: color 0.25s ease;
}

body[data-theme="light"] .theme-toggle-icon,
html[data-theme="light"] .theme-toggle-icon,
body:not([data-theme]) .theme-toggle-icon {
    color: rgba(0, 0, 0, 0.35);
}

/* Icono activo: círculo de fondo (como Alcance bg-muted-foreground/25 en el sol) */
.theme-toggle[data-active-theme="light"] .theme-toggle-icon--sun,
.theme-toggle[data-active-theme="dark"] .theme-toggle-icon--moon {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.28);
}

html[data-theme="light"] .theme-toggle[data-active-theme="light"] .theme-toggle-icon--sun,
html[data-theme="light"] .theme-toggle[data-active-theme="dark"] .theme-toggle-icon--moon,
body[data-theme="light"] .theme-toggle[data-active-theme="light"] .theme-toggle-icon--sun,
body[data-theme="light"] .theme-toggle[data-active-theme="dark"] .theme-toggle-icon--moon {
    color: rgba(0, 0, 0, 0.78);
    background: rgba(0, 0, 0, 0.12);
}

.theme-toggle[data-active-theme="light"] .theme-toggle-icon--moon,
.theme-toggle[data-active-theme="dark"] .theme-toggle-icon--sun {
    color: rgba(255, 255, 255, 0.42);
    background: transparent;
}

html[data-theme="light"] .theme-toggle[data-active-theme="light"] .theme-toggle-icon--moon,
html[data-theme="light"] .theme-toggle[data-active-theme="dark"] .theme-toggle-icon--sun,
body[data-theme="light"] .theme-toggle[data-active-theme="light"] .theme-toggle-icon--moon,
body[data-theme="light"] .theme-toggle[data-active-theme="dark"] .theme-toggle-icon--sun {
    color: rgba(0, 0, 0, 0.38);
    background: transparent;
}

.theme-toggle-icon {
    border-radius: 50%;
}

.theme-toggle-mobile {
    width: auto;
    height: auto;
    min-height: 44px;
}

/* Moneda ($ / U$S) e idioma (EN / ES / PT) — mismo lenguaje visual que theme-toggle */
.preference-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    margin: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    gap: 2px;
}

body[data-theme="light"] .preference-toggle,
html[data-theme="light"] .preference-toggle {
    border-color: rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.06);
}

.preference-toggle-option {
    position: relative;
    z-index: 1;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--motogp-font-display, inherit);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

body[data-theme="light"] .preference-toggle-option,
html[data-theme="light"] .preference-toggle-option {
    color: rgba(0, 0, 0, 0.45);
}

.preference-toggle-option.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

body[data-theme="light"] .preference-toggle-option.is-active,
html[data-theme="light"] .preference-toggle-option.is-active {
    color: rgba(0, 0, 0, 0.88);
    background: rgba(0, 0, 0, 0.1);
}

.preference-toggle--currency .preference-toggle-option {
    min-width: 32px;
    font-size: 0.72rem;
}

.preference-toggle--lang .preference-toggle-option {
    min-width: 28px;
}

.preference-toggle--map .preference-toggle-option {
    min-width: 28px;
    font-size: 0.68rem;
    font-weight: 700;
}

.preference-toggle--mobile {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 4px;
}

.preference-toggle--mobile .preference-toggle-option {
    flex: 1;
    min-height: 36px;
    font-size: 0.8rem;
}

/* Language button: estilos unificados con favoritos */
.language-button {
    cursor: pointer;
    gap: 8px;
}
.language-button #languageFlag,
.language-button #languageFlagMobile {
    font-size: 1.35em;
    line-height: 1;
    margin-right: 4px;
}

.language-selector {
    position: relative;
}

.language-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 6px var(--shadow);
    z-index: 1002;
    min-width: 120px;
    margin-top: 5px;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Favorites button: mismo comportamiento que el resto (sin movimiento en hover) */
.favorites-button {
    cursor: pointer;
}

.favorites-button:hover {
    transform: none;
}

.favorites-wrapper {
    position: relative;
}

.favorites-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 300px;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px var(--shadow);
    z-index: 1001;
}

.favorites-dropdown.show {
    display: block;
}

.favorites-dropdown-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.favorites-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}
.favorites-dropdown-item:hover {
    background: var(--bg-tertiary);
}
.favorites-dropdown-item-img {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-tertiary);
}
.favorites-dropdown-item-body {
    flex: 1;
    min-width: 0;
}
.favorites-dropdown-item-name {
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.favorites-dropdown-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.favorites-dropdown-item-meta span {
    display: block;
}

.favorites-dropdown-footer a {
    color: var(--text-primary);
    cursor: pointer;
}

/* Carrito header */
.cart-wrapper {
    position: relative;
}
.cart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
body[data-theme="light"] .cart-button,
body:not([data-theme]) .cart-button {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.3);
    color: #000;
}
.cart-button:hover {
    background: rgba(255, 255, 255, 0.2);
}
body[data-theme="light"] .cart-button:hover,
body:not([data-theme]) .cart-button:hover {
    background: rgba(0, 0, 0, 0.2);
}
.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: #e74c3c;
    border-radius: 999px;
}

/* Modal perder carrito al ir al home */
.leave-cart-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.leave-cart-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}
.leave-cart-modal-content {
    position: relative;
    max-width: 420px;
    width: 100%;
    padding: 24px;
    background: var(--bg-secondary, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.leave-cart-modal-title {
    margin: 0 0 16px;
    font-size: 1.25rem;
    color: var(--text-primary, #1a1a1a);
}
.leave-cart-modal-text {
    margin: 0 0 12px;
    font-size: 0.95rem;
    color: var(--text-secondary, #4a4a4a);
    line-height: 1.4;
}
.leave-cart-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}
.leave-cart-modal-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--border-color, #ddd);
    background: var(--bg-tertiary, #eee);
    color: var(--text-primary, #1a1a1a);
}
.leave-cart-modal-btn.confirm {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}
.leave-cart-modal-btn.confirm:hover {
    background: #c0392b;
}

/* Login / User: estilos unificados con HOME (pill, dropdown en columna) */
.login-button,
.user-menu-button {
    cursor: pointer;
}

.user-menu-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #ffffff;
    transition: all 0.3s ease;
    width: 100%;
}
body[data-theme="light"] .user-menu-button,
body:not([data-theme]) .user-menu-button {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.3);
    color: #000000;
}
.user-menu-button:hover {
    background: rgba(255, 255, 255, 0.2);
}
body[data-theme="light"] .user-menu-button:hover,
body:not([data-theme]) .user-menu-button:hover {
    background: rgba(0, 0, 0, 0.2);
}

.login-container {
    position: relative;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    min-width: 200px;
    z-index: 1002;
    overflow: hidden;
    flex-direction: column;
}

.user-dropdown.show {
    display: flex;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.user-dropdown-item:hover {
    background: var(--bg-secondary);
}

.user-dropdown-item.logout-item {
    border-top: 1px solid var(--border-color);
    color: #dc3545;
}

.user-dropdown-item.logout-item:hover {
    background: rgba(220, 53, 69, 0.1);
}

.user-dropdown-item svg {
    flex-shrink: 0;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.user-info.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-secondary);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 10012;
    transition: right 0.3s ease;
    overflow-y: auto;
    color: var(--text-primary);
    border-left: 1px solid var(--border-color);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10011;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.mobile-menu-content {
    padding: 80px 20px 20px;
    height: 100%;
    color: var(--text-primary);
    position: relative;
}

.mobile-menu-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.25rem;
}

.mobile-menu-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-menu-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu-section-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.mobile-menu-item--theme {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 16px !important;
}

.mobile-menu-theme-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary) !important;
}

.mobile-menu-item--user {
    display: flex !important;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.login-button-mobile {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px !important;
    font-size: 1rem;
    font-weight: 600;
}

.mobile-menu-item,
.mobile-menu-item a {
    cursor: pointer;
}

.mobile-menu-close:hover {
    background: var(--bg-tertiary);
}

.mobile-menu-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary) !important;
}

.mobile-menu-item:hover {
    background: var(--bg-primary);
    color: var(--text-primary) !important;
}

.mobile-menu-item i,
.mobile-menu-item span,
.mobile-menu-item button {
    color: var(--text-primary) !important;
}

.mobile-menu-motogp-cta {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.mobile-menu-item--comprar {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    color: #fff !important;
    background: var(--motogp-red, #c80502) !important;
    border: none !important;
    border-radius: 9999px;
    margin-bottom: 12px;
}
.mobile-menu-item--comprar:hover {
    background: #a00402 !important;
    color: #fff !important;
}
.mobile-menu-motogp-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.mobile-menu-item--round {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-primary) !important;
    background: var(--bg-tertiary) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 9999px;
    flex: 1;
}
.mobile-menu-item--round:hover {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

.mobile-search-header {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.mobile-search-header h2 {
    color: var(--text-primary);
}

.mobile-search-close {
    color: var(--text-primary);
}

.mobile-search-close:hover {
    background: var(--bg-tertiary);
}

@media (max-width: 768px) {
    .header-content {
        justify-content: space-between;
    }
    .header-cta-motogp-wrap {
        display: none !important;
    }
    .header-logo {
        flex-shrink: 0;
    }
    .header-right-mobile {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0;
        background: transparent;
        border: 2px solid var(--border-color);
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease;
    }
    .mobile-menu-toggle:hover {
        background: var(--bg-tertiary);
        border-color: var(--text-tertiary);
    }
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
        background-color: var(--text-primary);
        border-radius: 2px;
        transition: all 0.3s ease;
    }
    .mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    .header-right-desktop {
        display: none;
    }
}

/* ----- Footer ----- */
.custom-footer-content {
    background: var(--bg-secondary);
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

#footer_wrapper {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    position: relative;
    z-index: 2;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 30px;
    gap: 20px;
}

.footer-sections-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-info {
    text-align: left;
}

.footer-social-section {
    text-align: center;
}

.footer-support {
    text-align: right;
}

.footer-social-section .footer-social {
    justify-content: center;
}

.footer-logo {
    height: 50px;
    width: auto;
    max-width: 200px;
}

.footer-section h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    cursor: pointer;
}

.footer-section ul li a:hover {
    color: var(--motogp-red, #c80502);
}

/* Redes sociales: mismo tamaño que en el HOME (iconos no enormes) */
.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 36px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: var(--motogp-red, #c80502);
    border-color: var(--motogp-red, #c80502);
    transform: translateY(-3px);
}

.footer-social a svg {
    width: 20px;
    height: 20px;
    fill: var(--text-primary);
}

.footer-social a:hover svg {
    fill: white;
}

.footer-copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    color: var(--text-secondary);
}

/* App stores: una sola vez según viewport (desktop dentro de redes, móvil en sección aparte) */
.footer-app-stores {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Por defecto (móvil): ocultar el bloque desktop, mostrar la sección móvil */
.footer-social-section .footer-app-stores-desktop {
    display: none !important;
}

.footer-stores-section {
    order: 4;
    text-align: center;
}

.footer-app-stores-mobile {
    display: flex;
}

/* Desktop: mostrar stores dentro de redes, ocultar sección móvil */
@media (min-width: 769px) {
    .footer-social-section .footer-app-stores-desktop {
        margin-top: 30px;
        display: flex !important;
    }

    .footer-stores-section {
        display: none !important;
    }

    .footer-app-store-icon {
        height: 62.5px;
        max-width: 187.5px;
    }
}

.footer-app-store-link {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.footer-app-store-link:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.footer-app-store-icon {
    height: 50px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .custom-footer-content {
        padding: 30px 15px;
        margin-top: 40px;
    }

    .footer-sections-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
        display: flex;
        flex-direction: column;
    }

    .footer-social-section {
        order: 1;
        text-align: center;
    }

    .footer-info {
        order: 2;
        text-align: center;
    }

    .footer-support {
        order: 3;
        text-align: center;
    }

    .footer-social-section h3 {
        display: none;
    }

    .footer-social-section .footer-social {
        justify-content: center;
        margin-bottom: 20px;
    }

    .footer-app-store-icon {
        height: 35px;
        max-width: 100px;
    }
}

.footer-link-btn {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    transition: color 0.3s ease;
}

.footer-link-btn:hover {
    color: var(--motogp-red, #c80502);
}

.footer-logo-light { display: block; }
.footer-logo-dark { display: none; }

[data-theme="dark"] .footer-logo-light,
body[data-theme="dark"] .footer-logo-light {
    display: none;
}

[data-theme="dark"] .footer-logo-dark,
body[data-theme="dark"] .footer-logo-dark {
    display: block;
}

/* ----- Modal compartir (global, respeta tema claro/oscuro) ----- */
:root {
    --motogp-red: #c80502;
    --motogp-red-dark: #a00402;
}

.motogp-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10020;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.motogp-share-modal.is-open {
    display: flex;
}

.motogp-share-modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.motogp-share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.motogp-share-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.motogp-share-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
}

.motogp-share-modal-close:hover {
    color: var(--text-primary);
}

.motogp-share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.motogp-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.35rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.motogp-share-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-tertiary);
}

.motogp-share-btn.whatsapp {
    color: #25d366;
    border-color: #25d366;
    background: var(--bg-primary);
}

.motogp-share-btn.whatsapp:hover {
    background: rgba(37, 211, 102, 0.15);
}

.motogp-share-btn.x {
    color: #fff;
    background: #000;
    border-color: #000;
}

.motogp-share-btn.x:hover {
    background: #333;
    border-color: #333;
}

.motogp-share-btn.facebook {
    color: #1877f2;
    border-color: #1877f2;
    background: var(--bg-primary);
}

.motogp-share-btn.facebook:hover {
    background: rgba(24, 119, 242, 0.15);
}

.motogp-share-btn.instagram {
    color: #e4405f;
    border-color: #e4405f;
    background: var(--bg-primary);
}

.motogp-share-btn.instagram:hover {
    background: rgba(228, 64, 95, 0.15);
}

.motogp-share-copy-wrap {
    margin-top: 0.5rem;
}

.motogp-share-copy-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: var(--motogp-red);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.motogp-share-copy-wrap input {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    box-sizing: border-box;
}

.motogp-share-copy-btn:hover {
    background: var(--motogp-red-dark);
}

.motogp-share-copy-btn.copied {
    background: #0a7a0a;
}
