/**
 * 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 {
    --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);
}

[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;
}

/* 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-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 .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 .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;
}

/* 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;
    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-content {
    padding: 80px 20px 20px;
    height: 100%;
    color: var(--text-primary);
}

.mobile-menu-close {
    color: var(--text-primary);
    cursor: pointer;
}

.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: #667eea;
}

/* 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: #667eea;
    border-color: #667eea;
    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: #667eea;
}

.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;
}
