/* ============================================================
   CuponesNow — estilos públicos
   ============================================================ */
:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --brand: #ff5a1f;
    --brand-dark: #e64a12;
    --brand-soft: #fff1ea;
    --accent: #e11d48;
    --navy: #0f172a;
    --navy-2: #1e293b;
    --green: #059669;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(15, 23, 42, .07);
    --shadow-hover: 0 14px 34px rgba(15, 23, 42, .14);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

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

/* ============ Header ============ */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--navy);
    color: #fff;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .25);
}
.header-inner {
    display: flex; align-items: center; gap: 22px;
    min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.35rem; letter-spacing: -.5px; }
.logo em { color: var(--brand); font-style: normal; }
.logo-icon { font-size: 1.5rem; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
    padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: .95rem;
    color: #cbd5e1; transition: background .15s, color .15s;
}
.main-nav a:hover, .main-nav a.is-active { background: rgba(255, 255, 255, .1); color: #fff; }
.main-nav .nav-telegram { color: #7dd3fc; }

.header-search { margin-left: auto; display: flex; }
.header-search input {
    border: 0; border-radius: 8px 0 0 8px; padding: 9px 13px; width: 210px;
    font-size: .92rem; background: #fff; color: var(--ink); outline: none;
}
.header-search button {
    border: 0; border-radius: 0 8px 8px 0; background: var(--brand); color: #fff;
    padding: 0 14px; cursor: pointer; font-size: 1rem;
}
.header-search button:hover { background: var(--brand-dark); }

.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* ============ Hero ============ */
.hero {
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 90, 31, .25), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(255, 183, 3, .15), transparent 40%),
        linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
    padding: 64px 0 72px;
}
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -1px; margin-bottom: 14px; }
.hero-flash { color: var(--brand); }
.hero p { color: #cbd5e1; font-size: 1.12rem; max-width: 560px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============ Botones ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--navy); color: #fff; font-weight: 700; font-size: .95rem;
    padding: 11px 22px; border-radius: 10px; border: 0; cursor: pointer;
    transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 23, 42, .18); }
.btn-primary { background: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); }
.btn-sm { padding: 8px 14px; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }

/* ============ Secciones ============ */
.section { padding: 40px 0; }
.section-alt { background: #eef1f8; }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 22px; gap: 12px; flex-wrap: wrap;
}
.section-head h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.4px; }
.see-all { color: var(--brand); font-weight: 700; font-size: .92rem; }
.see-all:hover { text-decoration: underline; }

.page-head-section { padding-bottom: 10px; }
.page-title { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 800; letter-spacing: -.6px; }
.page-sub { color: var(--muted); margin-top: 6px; }

/* ============ Chips de categorías ============ */
.section-chips { padding: 22px 0 6px; }
.chips-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.chip {
    background: var(--card); border: 1px solid var(--line); border-radius: 999px;
    padding: 8px 18px; font-weight: 600; font-size: .92rem; white-space: nowrap;
    transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ============ Grilla y tarjetas ============ */
.grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card {
    background: var(--card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); display: flex; flex-direction: column;
    transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card.is-expired { opacity: .68; }

.card-media { position: relative; aspect-ratio: 16/10.5; overflow: hidden; background: #eef1f6; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-media img { transform: scale(1.05); }

.badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--accent); color: #fff; font-weight: 800; font-size: .85rem;
    padding: 4px 10px; border-radius: 8px; box-shadow: 0 3px 10px rgba(225, 29, 72, .35);
}
.badge-coupon { background: var(--brand); box-shadow: 0 3px 10px rgba(255, 90, 31, .35); }
.badge-expired { left: auto; right: 10px; background: #475569; box-shadow: none; font-size: .75rem; }
.badge-lg { font-size: 1.1rem; padding: 7px 14px; border-radius: 10px; }

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-meta { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-meta .store { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; font-size: .75rem; }
.card-title { font-size: 1rem; font-weight: 700; line-height: 1.35; }
.card-title a:hover { color: var(--brand); }

.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-now { color: var(--green); font-weight: 800; font-size: 1.25rem; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: .92rem; }
.price-row-lg .price-now { font-size: 2rem; }
.price-row-lg .price-old { font-size: 1.15rem; }

.code-row {
    display: flex; align-items: center; gap: 8px;
    border: 2px dashed var(--brand); border-radius: 10px;
    padding: 6px 10px; background: var(--brand-soft);
}
.code-row code { font-family: 'Cascadia Code', Consolas, monospace; font-weight: 700; font-size: .95rem; flex: 1; letter-spacing: 1px; }
.copy-btn {
    background: var(--brand); color: #fff; border: 0; border-radius: 7px;
    padding: 5px 12px; font-weight: 700; font-size: .8rem; cursor: pointer;
}
.copy-btn:hover { background: var(--brand-dark); }
.copy-btn.is-copied { background: var(--green); }

.card-actions { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 4px; }
.ago { color: var(--muted); font-size: .78rem; }

.empty-note { color: var(--muted); padding: 30px 0; grid-column: 1/-1; }

/* ============ Oferta del día ============ */
.deal-day {
    display: grid; grid-template-columns: minmax(280px, 46%) 1fr; gap: 0;
    background: var(--card); border-radius: 18px; overflow: hidden;
    box-shadow: var(--shadow-hover); border: 2px solid var(--brand);
}
.deal-media { position: relative; min-height: 300px; }
.deal-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.deal-info { padding: 34px 36px; display: flex; flex-direction: column; gap: 14px; }
.deal-label {
    align-self: flex-start; background: var(--brand-soft); color: var(--brand-dark);
    font-weight: 800; font-size: .85rem; padding: 6px 14px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: .6px;
}
.deal-info h2 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); font-weight: 800; line-height: 1.25; letter-spacing: -.5px; }
.deal-info h2 a:hover { color: var(--brand); }
.deal-meta { display: flex; gap: 8px; }
.deal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

.store-tag, .cat-tag {
    background: #eef1f8; border-radius: 999px; padding: 4px 14px;
    font-size: .82rem; font-weight: 700; color: var(--navy-2);
}

.countdown {
    align-self: flex-start; display: inline-flex; gap: 6px; align-items: center;
    background: var(--navy); color: #fff; border-radius: 10px;
    padding: 8px 16px; font-size: .92rem; font-weight: 600;
}
.countdown-value { font-family: Consolas, monospace; font-weight: 800; color: #fbbf24; }

/* ============ Tiendas ============ */
.stores-row { display: flex; gap: 10px; flex-wrap: wrap; }
.store-pill {
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 20px; font-weight: 700; font-size: .95rem;
    transition: border-color .15s, color .15s, transform .12s;
}
.store-pill:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }

/* ============ Filtros ============ */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.filter-bar select {
    border: 1px solid var(--line); border-radius: 10px; background: var(--card);
    padding: 9px 14px; font-size: .92rem; color: var(--ink); cursor: pointer; outline: none;
}
.filter-bar select:focus { border-color: var(--brand); }

/* ============ Detalle ============ */
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--brand); }

.detail {
    display: grid; grid-template-columns: minmax(300px, 46%) 1fr; gap: 34px;
    background: var(--card); border-radius: 18px; padding: 30px; box-shadow: var(--shadow);
}
.detail-media { position: relative; border-radius: 12px; overflow: hidden; align-self: start; }
.detail-info { display: flex; flex-direction: column; gap: 14px; }
.detail-info h1 { font-size: clamp(1.35rem, 3vw, 1.9rem); font-weight: 800; line-height: 1.3; letter-spacing: -.5px; }
.detail-actions { margin-top: 6px; }
.save-note { color: var(--green); font-weight: 700; }
.expired-note { color: var(--accent); font-weight: 600; background: #fef2f2; border-radius: 10px; padding: 10px 14px; }
.meta-note { color: var(--muted); font-size: .84rem; }

.code-box { border-radius: 12px; }
.code-label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 6px; }
.code-row-lg { padding: 10px 14px; }
.code-row-lg code { font-size: 1.25rem; }

.share-row { display: flex; gap: 12px; align-items: center; font-size: .88rem; color: var(--muted); flex-wrap: wrap; }
.share-row a { font-weight: 700; color: var(--navy-2); border-bottom: 2px solid var(--line); }
.share-row a:hover { color: var(--brand); border-color: var(--brand); }

.detail-desc { margin-top: 30px; background: var(--card); border-radius: 14px; padding: 26px 30px; box-shadow: var(--shadow); }
.detail-desc h2 { font-size: 1.15rem; margin-bottom: 10px; }
.detail-desc p { color: #334155; }

/* ============ Paginación ============ */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.page-link {
    background: var(--card); border: 1px solid var(--line); border-radius: 9px;
    min-width: 40px; padding: 8px 12px; text-align: center; font-weight: 700; font-size: .9rem;
}
.page-link:hover { border-color: var(--brand); color: var(--brand); }
.page-link.is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-dots { align-self: center; color: var(--muted); }

/* ============ Footer ============ */
.site-footer { background: var(--navy); color: #94a3b8; margin-top: 50px; }
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1.2fr 1fr; gap: 34px;
    padding: 46px 20px 30px;
}
.footer-logo { color: #fff; font-size: 1.2rem; margin-bottom: 12px; }
.footer-grid p { font-size: .92rem; line-height: 1.6; }
.footer-grid h4 { color: #fff; font-size: .95rem; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .6px; }
.footer-grid a { display: block; padding: 4px 0; font-size: .92rem; color: #94a3b8; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding-top: 18px; padding-bottom: 22px; font-size: .82rem; flex-wrap: wrap;
}
.footer-admin { color: #475569; }
.footer-admin:hover { color: #94a3b8; }

/* ============ Páginas legales ============ */
.legal { max-width: 820px; }
.legal h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; letter-spacing: -.6px; margin-bottom: 6px; }
.legal-updated { color: var(--muted); font-size: .88rem; margin-bottom: 26px; }
.legal h2 { font-size: 1.15rem; font-weight: 800; margin: 28px 0 10px; letter-spacing: -.3px; }
.legal p { margin-bottom: 12px; color: #334155; }
.legal ul { margin: 0 0 14px 22px; color: #334155; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--brand); font-weight: 600; }
.legal a:hover { text-decoration: underline; }
.legal code { background: #e2e8f0; border-radius: 5px; padding: 2px 7px; font-size: .85em; }
.legal-links { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }

.table-scroll { overflow-x: auto; margin-bottom: 14px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.legal-table th { background: var(--navy); color: #fff; text-align: left; padding: 10px 14px; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.legal-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: #334155; }
.legal-table tr:last-child td { border-bottom: 0; }

/* ============ Preferencias de cookies ============ */
.cookie-prefs { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 22px; margin-bottom: 26px; }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.pref-row:last-of-type { border-bottom: 0; }
.pref-info { display: flex; flex-direction: column; gap: 3px; }
.pref-info strong { font-size: .98rem; }
.pref-info span { color: var(--muted); font-size: .86rem; }
.pref-actions { display: flex; align-items: center; gap: 12px; padding: 16px 0 18px; flex-wrap: wrap; }
.prefs-saved { color: var(--green); font-weight: 700; font-size: .9rem; }
.btn-ghost-dark { background: #eef1f6; color: var(--ink); }
.btn-ghost-dark:hover { background: #e2e8f0; }

.switch { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; border-radius: 999px; transition: background .2s; }
.slider::before { content: ""; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(24px); }
.switch.is-locked .slider { background: var(--navy); cursor: not-allowed; opacity: .55; }

/* ============ Banner de cookies ============ */
.cookie-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: var(--navy); color: #e2e8f0;
    border-radius: 14px; padding: 14px 20px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, .45);
    max-width: 1100px; margin: 0 auto;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-text { font-size: .9rem; line-height: 1.5; flex: 1 1 320px; }
.cookie-banner-text a { color: #fbbf24; font-weight: 700; }
.cookie-banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-banner .btn { white-space: nowrap; }
.cookie-banner .btn:not(.btn-primary) { background: rgba(255, 255, 255, .12); }

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .deal-day, .detail { grid-template-columns: 1fr; }
    .deal-media { min-height: 220px; }
    .deal-media img { position: static; height: 220px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    .nav-toggle { display: block; order: 2; margin-left: auto; }
    .header-search { order: 3; width: 100%; margin: 0 0 4px; }
    .header-search input { width: 100%; }
    .main-nav {
        display: none; order: 4; width: 100%; flex-direction: column; padding-bottom: 10px;
    }
    .main-nav.is-open { display: flex; }
    .hero { padding: 44px 0 50px; }
    .deal-info { padding: 24px 22px; }
    .detail { padding: 20px; gap: 22px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
