/* ==========================================
   SHOPPING BY NIGHT - Estilos Globales v2.3
   ========================================== */

:root {
    --logo-gold: #c17c01;
    --primary: #061b55;
    --primary-light: #eef2ff;
    --accent: #f43f5e;
    --accent-light: #fff1f2;
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --text: #4b5563;
    --text-light: #9ca3af;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --success: #10b981;
    --white: #ffffff;
    --gray-light: #f3f4f6;
    --gray: #e5e7eb;
    --gray-dark: #d1d5db;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s ease;
    --font: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray);
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    gap: 1rem;
    position: relative;
}

.logo {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.logo-img {
    height: 74px;
    width: auto;
    max-width: 300px;
    display: block;
}

@media (max-width: 768px) {
    .logo-img {
        height: 56px;
        max-width: 220px;
    }
    
    .header {
        padding: 0.5rem 1rem;
    }
    
    .header-inner {
        min-height: 60px;
    }
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav a:hover {
    color: var(--accent);
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-light);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    position: relative;
}

.lang-selector select {
    background: transparent;
    border: none;
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    outline: none;
}

.lang-selector select option {
    background: var(--white);
    color: var(--text);
}

/* ==========================================
   CATEGORY MENU (Dropdown)
   ========================================== */

.category-menu {
    position: relative;
    display: inline-block;
}

.category-toggle {
    background: var(--bg);
    border: 1px solid var(--gray);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.category-toggle:hover {
    background: var(--gray-light);
}

.category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    min-width: 220px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
}

.category-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.category-dropdown li {
    list-style: none;
}

.category-dropdown li a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    transition: var(--transition);
}

.category-dropdown li a:hover {
    background: var(--gray-light);
    color: var(--primary);
}

/* ==========================================\n   HERO — Tamaño original
   ========================================== */

.hero {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--white) 100%);
    color: var(--primary);
    padding: 1.25rem 2rem 1.4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--gray-light);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.03) 0%, transparent 60%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--logo-gold);
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto 0;
    background: var(--white);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
    color: var(--text);
}

.search-box button {
    padding: 1rem 2rem;
    background: var(--accent);
    color: var(--white);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    font-size: 1rem;
}

.search-box button:hover {
    background: #d63050;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ==========================================
   CATEGORÍAS
   ========================================== */

.categories {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.section-title p {
    font-size: 1rem;
    color: var(--text-light);
}

.categories-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    gap: 1.5rem;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid transparent;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 0;
    flex: 1 1 0;
    min-width: 0;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.category-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.category-card p {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* ==========================================
   CODE CARDS - TARJETAS DE DESCUENTO
   ========================================== */

.codes-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
}

.codes-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.codes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.codes-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.codes-filters {
    display: flex;
    gap: 0.75rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--white);
    cursor: pointer;
    outline: none;
}

.codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.code-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid transparent;
    text-align: center;
}

.code-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.code-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.code-badge {
    background: var(--success);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.code-store {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.code-discount {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.code-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.code-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.code-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.btn-copy {
    background: var(--primary-light);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-copy:hover {
    background: var(--primary);
    color: white;
}

.btn-apply {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-apply:hover {
    background: #0a2a7a;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    z-index: 10000;
    animation: toast-in 0.3s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ==========================================
   FOOTER
   ========================================== */

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--gray);
    padding: 3rem 2rem 1.5rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: left;
}

.footer-col h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

/* ==========================================
   LEGAL PAGES
   ========================================== */

.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 0%;
    flex: 1 1 0%;
}

.legal-page h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-align: left;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.legal-page h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    text-align: left;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.legal-page p {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 1rem;
    text-align: justify;
}

.legal-page ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-page li {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.legal-page a {
    color: var(--primary);
    text-decoration: underline;
}

.legal-page a:hover {
    color: var(--accent);
}

.legal-page strong {
    font-weight: 600;
    color: var(--primary);
}

.footer-col p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ==========================================
   SOCIAL LINKS
   ========================================== */

.social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--primary);
    color: var(--white);
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

.social-icon[aria-label="Instagram"] {
    background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
    color: #ffffff;
}

.social-icon[aria-label="Facebook"] {
    background: #1877f2;
    color: #ffffff;
}

/* ==========================================
   BANNER PUBLICITARIO
   ========================================== */

.ad-banner {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 1.5rem auto !important;
    max-width: 970px !important;
    width: 100% !important;
    text-align: center !important;
}

.ad-banner img {
    max-width: 728px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Banners laterales */
.codes-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
}

.codes-wrapper .codes-section {
    flex: 1;
    min-width: 0;
    padding: 0;
    max-width: none;
    margin: 0;
}

.codes-wrapper .codes-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.codes-wrapper .codes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 320px));
    justify-content: center;
    gap: 1.5rem;
}

.ad-sidebar-left,
.ad-sidebar-right {
    width: auto;
    max-width: 300px;    /* admite 120×600, 160×600 y 300×250 sin descuadrar el centro */
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;     /* alineados con el inicio de los códigos y separados de la banda azul */
}

.ad-sidebar-left img,
.ad-sidebar-right img {
    max-width: 300px;
    width: auto;
    height: auto;
    display: block;
    margin-bottom: 0;
}

/* Banner insertado como CÓDIGO HTML (p. ej. TradeTracker/Google Ads): el <a> no debe desbordar */
.ad-sidebar-left > a,
.ad-sidebar-right > a {
    max-width: 300px;
    display: block;
}

.ad-sidebar-right img {
    max-width: 300px;
    width: auto;
    height: auto;
    display: block;
    margin-bottom: 0;
}

.codes-layout .codes-section {
    flex: 1;
    min-width: 0;
    padding: 0;
    max-width: none;
    margin: 0;
}

.codes-layout .codes-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.codes-layout .codes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.codes-layout .codes-grid .code-card {
    min-width: 0;
}

.codes-layout .codes-grid .code-card {
    min-width: 0;
}

.codes-layout .codes-grid .code-card {
    min-width: 0;
}
    
    .codes-layout .codes-grid {
        width: 100%;
    }
}

.ad-label {
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    margin: 0.5rem 0;
    font-weight: 600;
}

@media (max-width: 768px) {
    .ad-banner {
        margin: 1rem auto;
    }
    
    .ad-banner img {
        max-width: 100%;
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .hero { padding: 3rem 1rem; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .search-box { max-width: 100%; }
    .hero-stats { gap: 1.5rem; }
    .stat-number { font-size: 1.5rem; }
    
    .categories { padding: 2rem 1rem; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    
    .codes-section { padding: 2rem 1rem; }
    .codes-grid { grid-template-columns: 1fr; }
    .code-actions { flex-direction: column; }
    
    .footer-inner { grid-template-columns: 1fr; }
}


/* ===== Desplegables personalizados (fondo blanco, letras oscuras) ===== */
.cs-dropdown { position: relative; display: inline-block; font-family: var(--font); }
.cs-dropdown-btn {
    padding: 0.5rem 1rem; border: 1px solid var(--gray); border-radius: var(--radius-sm);
    background: #ffffff; color: #374151; font-family: var(--font); font-size: 0.9rem;
    cursor: pointer; display: flex; align-items: center; gap: 0.5rem; white-space: nowrap;
}
.cs-dropdown-btn:hover { border-color: var(--primary); }
.cs-caret { font-size: 0.7rem; color: #9ca3af; }
.cs-dropdown-list {
    position: absolute; top: 100%; left: 0; margin-top: 4px; background: #ffffff;
    border: 1px solid var(--gray); border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    min-width: 100%; padding: 0.35rem 0; list-style: none; display: none; z-index: 2000;
    max-height: 320px; overflow: auto;
}
.cs-dropdown.open .cs-dropdown-list { display: block; }
.cs-dropdown-list li { padding: 0.5rem 1rem; color: #374151; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
.cs-dropdown-list li:hover { background: #f3f4f6; color: var(--primary); }
.cs-dropdown-list li.cs-all { font-size: 0.75rem; color: #9ca3af; }

/* ==== RESPONSIVE MÓVIL: códigos y categorías ==== */
@media (max-width: 768px) {
    /* Apilar layout de códigos y quitar banners laterales */
    .codes-wrapper { flex-direction: column; flex-wrap: wrap; padding: 0 1rem; gap: 0; }
    .ad-sidebar-left, .ad-sidebar-right { display: none !important; }
    .codes-section { width: 100%; min-width: 0; }
    .codes-grid { grid-template-columns: 1fr !important; }
    .codes-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .codes-header h2 { font-size: 1.5rem; }
    .codes-filters { flex-wrap: wrap; width: 100%; }

    /* Categorías: pasar de flex-fila a grid 2 columnas */
    .categories { padding: 2rem 1rem; }
    .categories-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.9rem;
    }
    .category-card { padding: 1rem; }
    .category-card h3 { font-size: 0.9rem; }
    .category-card p { font-size: 0.72rem; }

    /* Buscador: evitar recorte del botón */
    .search-box { width: 100%; max-width: 100%; }
    .search-box input { padding: 0.9rem 1rem; font-size: 0.95rem; min-width: 0; }
    .search-box button { padding: 0.9rem 1.1rem; font-size: 0.95rem; flex-shrink: 0; }

    /* Banner horizontal */
    .ad-banner { padding: 0 1rem; }
}


/* Logo de tienda en las tarjetas — TAMAÑO ESTÁNDAR único (2026-10-15).
   Los ficheros de logo van recortados sin margen blanco, así todos se ven igual. */
.code-store { display: flex; align-items: center; justify-content: center; min-height: 64px; }
.store-logo {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    margin: 0 auto;
    object-fit: contain;
    background: #ffffff;
    border-radius: 4px;
    display: block;
}


/* ===== Popup / Modal de detalle del código ===== */
.code-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 5000; padding: 1rem;
}
.code-modal {
    background: #fff; width: 100%; max-width: 420px;
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    animation: codeModalIn .18s ease-out;
}
@keyframes codeModalIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.code-modal-head { background: var(--primary); height: 46px; display: flex; justify-content: flex-end; align-items: center; padding: 0 0.4rem; }
.code-modal-close { background: transparent; border: none; color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; padding: 0 0.6rem; }
.code-modal-body { padding: 1.5rem; text-align: center; }

/* ===== Solo para códigos con texto MUY largo (p. ej. Alibaba) =====
   El popup se ensancha y su cuerpo hace scroll, así la ✕ queda siempre visible
   y el texto se reparte en 2 columnas. El resto de popups no cambian. */
.code-modal--largo { max-width: 760px; max-height: 88vh; display: flex; flex-direction: column; }
.code-modal--largo .code-modal-head { flex: 0 0 auto; }
.code-modal--largo .code-modal-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 700px) { .code-modal--largo .code-modal-cond { column-count: 2; column-gap: 1.6rem; } }
@media (max-width: 700px) {
    .code-modal--largo { max-height: 92vh; }
    .code-modal--largo .code-modal-close { font-size: 2rem; padding: 0 0.85rem; }
}
.code-modal-logo { height: 60px; width: auto; max-width: 240px; object-fit: contain; margin: 0 auto 0.75rem; display: block; background: #fff; }
.code-modal-storename { font-weight: 700; color: var(--primary); font-size: 1.2rem; margin-bottom: 0.75rem; }
.code-modal-store { font-size: 0.72rem; letter-spacing: .5px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.15rem; }
.code-modal-title { font-size: 1.15rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.code-modal-code { background: #f3f4f6; border: 1px dashed var(--gray); border-radius: 8px; padding: 0.9rem; font-size: 1.1rem; font-weight: 700; letter-spacing: 2px; color: var(--primary); margin-bottom: 0.85rem; }
.code-modal-launch { display: block; color: var(--primary); text-decoration: underline; font-weight: 600; margin-bottom: 1rem; cursor: pointer; }
.code-modal-cond { font-size: 0.72rem; color: var(--text-muted); line-height: 1.45; text-align: left; }

.code-modal-coderow { display: flex; gap: 0.5rem; align-items: stretch; margin-bottom: 0.85rem; }
.code-modal-coderow .code-modal-code { flex: 1; margin-bottom: 0; display: flex; align-items: center; justify-content: center; }
.code-modal-copy { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 0 1rem; font-weight: 600; font-size: 0.85rem; cursor: pointer; white-space: nowrap; font-family: var(--font); }
.code-modal-copy:hover { background: #0a2a7a; }

.code-modal-copy.is-copied { background: var(--logo-gold); }

.code-modal-expire { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.85rem; }


/* ===== Página de tienda ===== */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.store-hero { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.store-hero-logo { height: 64px; width: auto; max-width: 240px; object-fit: contain; background: #fff; border-radius: 10px; padding: 6px; }
.store-desc { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem 0; box-sizing: border-box; }
.store-desc-inner { background: #ffffff; border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow-sm); text-align: center; }
.store-desc-logo { height: 70px; width: auto; max-width: 260px; object-fit: contain; margin: 0 auto 1rem; display: block; }
.store-desc h2 { color: var(--primary); font-size: 1.25rem; margin-bottom: 0.75rem; }
.store-desc p { color: var(--text); line-height: 1.7; font-size: 0.95rem; }
.code-store-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ===== FASE 1: dinamismo (barra de confianza, carrusel, badges, animaciones) ===== */
.trust-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2.75rem; max-width: 1000px; margin: 0 auto; padding: 1.35rem 1rem .75rem; box-sizing: border-box; }
.trust-item { display: flex; align-items: center; gap: .65rem; }
.trust-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.trust-item strong { display: block; color: var(--primary); font-size: 1.1rem; line-height: 1.1; }
.trust-item small { color: var(--text-muted); font-size: .78rem; }

/* ===== CARRUSEL DE BANNERS (centrado: 1 al centro + 2 laterales cortados) =====
   👉 --dc-alto    : ALTO de los banners (ej. 200px / 240px / 300px)
   👉 --dc-slide-w : ANCHO de cada banner. Lo que sobra hasta 100% se reparte
                     entre los 2 laterales (con 52% cada lateral muestra ~la mitad).
   👉 --dc-gap     : separación entre banners */
.deals-carousel {
    --dc-alto: 240px;
    --dc-slide-w: 52%;
    --dc-gap: 16px;
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.6rem 0 2rem;
    box-sizing: border-box;
    background: var(--bg-secondary);
    overflow: hidden;
}
.dc-viewport { overflow: hidden; }
.dc-track { display: flex; gap: var(--dc-gap); transition: transform .55s cubic-bezier(.4,0,.2,1); will-change: transform; }
.dc-slide {
    flex: 0 0 var(--dc-slide-w);
    box-sizing: border-box;
    position: relative;
    display: flex; align-items: center;
    min-height: var(--dc-alto);
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(120deg, var(--primary) 0%, #10307e 100%);
    background-size: cover; background-position: center;
    color: #fff;
    opacity: .45;
    transform: scale(.93);
    transition: opacity .45s ease, transform .45s ease;
}
.dc-slide.activo { opacity: 1; transform: scale(1); }
.dc-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,27,85,.95) 0%, rgba(6,27,85,.78) 45%, rgba(6,27,85,.35) 100%); }
.dc-slide:not(.dc-slide--img) .dc-shade { display: none; }
.dc-content { position: relative; z-index: 1; width: 100%; padding: 1.5rem 1.9rem; display: flex; align-items: center; gap: 1.1rem; box-sizing: border-box; }
.dc-logo { height: 50px; width: auto; max-width: 120px; object-fit: contain; background: #fff; border-radius: 9px; padding: 6px; flex-shrink: 0; }
.dc-body { flex: 1; min-width: 0; }
.dc-kicker { display: inline-block; background: var(--logo-gold); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .22rem .6rem; border-radius: 999px; margin-bottom: .5rem; }
.dc-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 .4rem; line-height: 1.35; color: #fff; }
.dc-meta { font-size: .82rem; opacity: .85; }
.dc-btn { background: var(--logo-gold); color: #fff; border: 0; border-radius: 9px; padding: .75rem 1.25rem; font-weight: 700; cursor: pointer; white-space: nowrap; font-size: .9rem; }
.dc-btn:hover { filter: brightness(1.08); }
.dc-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); color: var(--primary); box-shadow: 0 2px 12px rgba(6,27,85,.28); cursor: pointer; font-size: 1.3rem; line-height: 1; z-index: 5; }
.dc-prev { left: 1rem; } .dc-next { right: 1rem; }
.dc-dots { position: absolute; left: 0; right: 0; bottom: .4rem; display: flex; justify-content: center; gap: .4rem; z-index: 5; margin: 0; }
.dc-dot { width: 9px; height: 9px; border-radius: 999px; background: rgba(6,27,85,.22); border: 0; cursor: pointer; padding: 0; transition: all .25s; }
.dc-dot.activo { background: var(--primary); width: 26px; }

.code-badges { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; margin-bottom: .55rem; min-height: 18px; }
.badge-pill { font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .2rem .5rem; border-radius: 999px; white-space: nowrap; }
.badge-exclusivo { background: var(--logo-gold); color: #fff; }
.badge-verificado { background: #e8f5ee; color: #0f7a4d; }
.badge-urgente { background: #fee2e2; color: #b91c1c; }
.badge-proximo { background: #fff4e5; color: #b45309; }

@keyframes sbnEntrada { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.code-card { transition: transform .18s ease, box-shadow .18s ease; }
.code-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(6,27,85,.15); }
.reveal { opacity: 0; }
.reveal.visible { animation: sbnEntrada .5s ease forwards; }

@media (max-width: 640px) {
    .deals-carousel { --dc-alto: 215px; --dc-slide-w: 84%; padding: 1rem 0 1.6rem; }
    .dc-content { flex-direction: column; text-align: center; gap: .9rem; padding: 1.2rem 1.1rem; }
    .dc-arrow { display: none; }
    .trust-bar { gap: .8rem 1.5rem; }
}

/* ===== Header estilo VoucherCodes: logo + buscador + nav + barra de categorías ===== */
.header { padding: 0; }
.header-inner { padding: .7rem 1.5rem; gap: 1.5rem; }
.header-search { flex: 1 1 auto; display: flex; max-width: 520px; margin: 0 auto; }
.header-search input { flex: 1; border: 1.5px solid #d9dfec; border-right: 0; border-radius: 10px 0 0 10px; padding: .68rem .95rem; font-size: .92rem; outline: none; font-family: inherit; color: var(--text); }
.header-search input:focus { border-color: var(--primary); }
.header-search button { border: 0; background: var(--primary); color: #fff; border-radius: 0 10px 10px 0; padding: 0 1.15rem; cursor: pointer; font-weight: 700; font-size: .95rem; }
.header-search button:hover { background: #0a2a7a; }
.nav { gap: 1.15rem; }
.cats-bar { border-top: 1px solid #eaeef6; background: var(--white); }
.cats-bar-inner { max-width: 1200px; margin: 0 auto; display: flex; gap: .5rem; padding: .55rem 1.5rem; overflow-x: auto; scrollbar-width: none; }
.cats-bar-inner::-webkit-scrollbar { display: none; }
.cpill { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; padding: .42rem .9rem; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: .83rem; font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
.cpill:hover { background: var(--primary); color: #fff; }
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: .7rem; }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; }
}

/* ===== Menú de la barra: Categorías / Más populares / Los últimos ===== */
.cats-bar-inner { align-items: center; overflow: visible; }
.menu-item { position: relative; }
.menu-btn { background: none; border: 0; font: inherit; font-size: .88rem; font-weight: 600; color: var(--primary); padding: .5rem .85rem; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.menu-btn:hover { background: var(--primary-light); }
.menu-caret { font-size: .7rem; opacity: .75; transition: transform .18s; }
.menu-item.abierto .menu-caret { transform: rotate(180deg); }
.menu-drop { position: absolute; top: calc(100% + 6px); left: 0; min-width: 245px; background: #fff; border: 1px solid #e6eaf3; border-radius: 12px; box-shadow: 0 14px 34px rgba(6,27,85,.16); padding: .45rem; margin: 0; list-style: none; display: none; z-index: 1400; max-height: 340px; overflow-y: auto; }
.menu-item.abierto .menu-drop { display: block; }
.menu-drop li { margin: 0; }
.menu-drop a { display: flex; align-items: center; gap: .55rem; padding: .52rem .65rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .87rem; line-height: 1.3; }
.menu-drop a:hover { background: var(--primary-light); color: var(--primary); }
.menu-drop img { height: 22px; width: auto; max-width: 46px; object-fit: contain; flex-shrink: 0; }
.menu-drop .md-tag { margin-left: auto; font-size: .68rem; font-weight: 700; color: var(--logo-gold); background: #fdf3e2; padding: .1rem .4rem; border-radius: 999px; }

/* Menú Categorías: 2 columnas, sin scroll, + "Todas las categorías" */
.menu-drop--cats { min-width: 265px; padding: .6rem; grid-template-columns: 1fr; gap: .1rem; max-height: none; overflow: visible; }
.menu-item.abierto .menu-drop--cats { display: grid; }
.md-todas { grid-column: 1 / -1; border-top: 1px solid #eef2f8; margin-top: .4rem; padding-top: .45rem; }
.md-todas a { color: var(--primary); font-weight: 700; }
@media (max-width: 720px) {
    .menu-drop--cats { min-width: 0; width: max(250px, 68vw); }
}

/* Listas (Más populares / Los últimos): estrechas, ajustadas al texto */
.menu-drop--lista { min-width: 168px; width: max-content; max-width: 280px; padding: .4rem; }
.menu-drop--lista a { padding: .45rem .6rem; }

/* ===== Imagen de campaña en la tarjeta (Fase 2) ===== */
.code-img {
    margin: -1.5rem -1.5rem 1rem;
    border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
    overflow: hidden;
    background: var(--bg-secondary);
}
.code-img img {
    width: 100%;
    aspect-ratio: 300 / 250;
    object-fit: cover;
    display: block;
}

/* Puente invisible: evita que el menú se cierre al mover el ratón del botón al desplegable */
.menu-drop::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }


/* ===== Página "Todas las categorías" (/{lang}/categorias/) ===== */
.cats-hero {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #061b55 0%, #0d2a75 55%, #1440a8 100%);
    color: #fff; text-align: center; padding: 2.8rem 1.5rem 2.4rem;
}
.cats-hero::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background-image:
        radial-gradient(circle at 10% 25%, rgba(193,124,1,.35) 0, transparent 42%),
        radial-gradient(circle at 90% 75%, rgba(255,255,255,.12) 0, transparent 45%);
}
.cats-hero-inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; }
.cats-hero h1 { font-size: 2.1rem; font-weight: 800; margin: 0 0 .55rem; color: #fff; line-height: 1.2; }
.cats-hero p { font-size: 1.03rem; opacity: .92; margin: 0; }

.cats-page { padding: 2.6rem 1.5rem 3.6rem; background: var(--bg-secondary); }
.cats-grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.1rem; }

.cat-tile {
    position: relative; display: flex; align-items: center; gap: 1rem;
    padding: 1.2rem 2.2rem 1.2rem 1.15rem;
    background: #fff; border: 1.5px solid #e8ecf5; border-radius: 16px;
    text-decoration: none; overflow: hidden;
    box-shadow: 0 2px 10px rgba(6,27,85,.05);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    animation: catIn .5s ease backwards; animation-delay: var(--d, 0s);
}
.cat-tile::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--logo-gold));
    opacity: 0; transition: opacity .22s ease;
}
.cat-tile:hover { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(6,27,85,.16); border-color: var(--logo-gold); }
.cat-tile:hover::before { opacity: 1; }
.cat-ico {
    flex-shrink: 0; width: 58px; height: 58px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center; font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, #dfe7fa 100%);
    transition: transform .22s ease;
}
.cat-tile:hover .cat-ico { transform: scale(1.1) rotate(-5deg); }
.cat-txt { min-width: 0; flex: 1; }
.cat-txt h3 { font-size: 1.03rem; color: var(--primary); margin: 0 0 .22rem; line-height: 1.25; font-weight: 700; }
.cat-txt p { font-size: .82rem; color: var(--text-muted); margin: 0; line-height: 1.4; }
.cat-n {
    position: absolute; top: .75rem; right: 1.9rem;
    font-size: .66rem; font-weight: 700; letter-spacing: .02em;
    background: var(--logo-gold); color: #fff; padding: .16rem .5rem; border-radius: 999px;
    display: none;
}
.cat-n.visible { display: inline-block; }
.cat-go {
    position: absolute; right: .85rem; top: 50%; transform: translateY(-50%);
    font-size: 1.4rem; color: #c8d2e6; transition: color .22s ease, right .22s ease;
}
.cat-tile:hover .cat-go { color: var(--logo-gold); right: .7rem; }
@keyframes catIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
    .cats-hero h1 { font-size: 1.55rem; }
    .cats-hero { padding: 2rem 1.2rem 1.8rem; }
    .cats-grid { grid-template-columns: 1fr; gap: .8rem; }
}

/* Banda azul de las páginas de categoría: más estrecha y centrada */
.cats-hero--cat {
    width: 100%;                      /* a TODO lo ancho, igual que la newsletter */
    max-width: none;
    margin: 0;
    border-radius: 0;
    background: #061b55;              /* el MISMO azul plano de la newsletter */
    padding: 2rem 1rem;
}
.cats-hero--cat::after { display: none; }   /* sin destellos: azul limpio como la newsletter */
.cats-hero--cat .cats-hero-inner { max-width: 900px; }
.cats-hero--cat h1 { font-size: 1.8rem; margin-bottom: .45rem; }
.cats-hero--cat p { font-size: 1rem; opacity: .9; }
.store-desc { padding: 2rem 1.5rem 0; }

/* Home: el título principal con la MISMA banda azul que las categorías */
.cats-hero--home .cats-hero-inner { max-width: 900px; }
.cats-hero--home h1 { font-size: 2rem; }
.cats-hero--home h1 span { color: var(--logo-gold); }   /* la palabra destacada, en dorado */
.cats-hero--home p { font-size: 1.12rem; opacity: .92; margin-top: .35rem; }

/* ===== Menú cats-bar en MÓVIL: que los 3 botones quepan (2026-10-07) ===== */
@media (max-width: 900px) {
  .header-search, .header-search input { min-width: 0; }
  .cats-bar-inner { padding: .4rem .5rem; gap: .2rem; }
  .menu-btn { font-size: .73rem; padding: .4rem .42rem; gap: .12rem; }
  .menu-caret { font-size: .55rem; }
}
@media (max-width: 374px) {
  .cats-bar-inner { padding: .3rem .35rem; gap: .14rem; }
  .menu-btn { font-size: .69rem; padding: .35rem .32rem; gap: .1rem; }
  .menu-caret { display: none; }
}

/* Carrusel de portada: slide con CÓDIGO HTML (panel → Banners de portada).
   El HTML pegado sustituye a la imagen; se centra y se adapta al tamaño del hueco. */
.dc-slide--html .dc-html img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.dc-slide--html .dc-html > * { max-width: 100%; }


/* ==========================================
   PÁGINA "CÓMO FUNCIONA"
   ========================================== */

.legal-page h1 {
    font-size: 2rem;                 /* igual que el título de "À propos" */
    font-weight: 700;
    color: var(--primary);           /* azul del logo */
    text-align: left;
    margin-bottom: 0.75rem;
    border-bottom: none;
    padding-bottom: 0;
}

.legal-page h2.legal-sub {
    font-size: 1.5rem;               /* un poco más pequeño que el título */
    font-weight: 500;
    color: var(--logo-gold);         /* dorado del logo */
    text-align: left;
    border-bottom: 2px solid var(--primary);   /* la raya que divide, antes de los pasos */
    padding-bottom: 0.5rem;
    margin-top: 0;
    margin-bottom: 2rem;
}

.legal-page h2.legal-note {
    font-size: 1.5rem;               /* = tamaño del subtítulo */
    color: var(--logo-gold);         /* dorado del logo */
    margin-top: 3rem;                /* aire extra tras el último paso */
}
