/* =========================================================
   CouponNest — main stylesheet
   ========================================================= */

/* ===== CSS Variables ===== */
:root {
    --color-primary:      #E8380D;
    --color-primary-dark: #C02B08;
    --color-accent:       #FFB300;
    --color-bg:           #F8F9FA;
    --color-surface:      #FFFFFF;
    --color-text:         #1A1A2E;
    --color-text-muted:   #6B7280;
    --color-border:       #E5E7EB;
    --color-success:      #16A34A;
    --color-badge-hot:    #EF4444;
    --radius-card:        12px;
    --shadow-card:        0 2px 8px rgba(0,0,0,0.08);
    --shadow-card-hover:  0 8px 24px rgba(0,0,0,0.12);
    --font-main:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== Reset-ish ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--color-primary); }

/* ===== Layout container ===== */
.cn-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.cn-main { padding: 40px 0; min-height: 50vh; }
.cn-section { margin-bottom: 56px; }
/* Offset anchor jumps so the sticky header doesn't cover section headings. */
.cn-section[id], [id^="pick-"] { scroll-margin-top: 90px; }

/* =========================================================
   Header / Navigation
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow 0.2s ease;
}

.site-header.is-scrolled { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 68px;
}

.site-brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.5px;
}

.site-brand:hover { color: var(--color-primary-dark); }

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.main-nav a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.15s ease;
}

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

.main-nav .menu-item--prime-day a {
    color: var(--color-primary);
    position: relative;
}

.main-nav .menu-item--prime-day a::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -10px;
    width: 7px;
    height: 7px;
    background: var(--color-badge-hot);
    border-radius: 50%;
    animation: cn-pulse 1.4s infinite;
}

@keyframes cn-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
    70%  { box-shadow: 0 0 0 7px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* Search toggle */
.header-search { display: flex; align-items: center; }
.header-search__toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 6px;
    color: var(--color-text);
    line-height: 1;
}
.header-search__form {
    display: none;
    position: absolute;
    top: 68px;
    right: 0;
    left: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}
.header-search__form.is-open { display: block; }
.header-search__form input[type="search"] {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    display: block;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
}

/* Mobile nav toggle */
.nav-toggle { display: none; }

@media (max-width: 880px) {
    .nav-toggle {
        display: inline-flex;
        background: none;
        border: none;
        font-size: 22px;
        cursor: pointer;
        color: var(--color-text);
    }
    .main-nav {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; align-items: flex-start; gap: 0; }
    .main-nav li { width: 100%; }
    .main-nav a { display: block; padding: 14px 20px; border-top: 1px solid var(--color-border); width: 100%; }
}

/* =========================================================
   Hero Banner (Prime Day)
   ========================================================= */
.hero-prime-day {
    background: linear-gradient(135deg, #1A1A2E 0%, #E8380D 100%);
    color: white;
    text-align: center;
    padding: 80px 20px;
}

.hero-prime-day .eyebrow {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 8px;
}

.hero-prime-day h1 {
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 800;
    margin: 0 0 12px;
    letter-spacing: -1px;
    line-height: 1.05;
}

.hero-prime-day .subtitle {
    font-size: 18px;
    opacity: 0.85;
    margin-bottom: 32px;
}

/* Regular (non-Prime-Day) hero */
.hero-standard {
    background: linear-gradient(135deg, #1A1A2E 0%, #2d2d4a 100%);
    color: white;
    text-align: center;
    padding: 64px 20px;
}
.hero-standard h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 800; margin: 0 0 12px; }
.hero-standard .subtitle { font-size: 18px; opacity: 0.85; margin-bottom: 28px; }
.hero-standard .hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ===== Countdown Timer ===== */
.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 32px;
    flex-wrap: wrap;
}

.countdown-unit { display: flex; flex-direction: column; align-items: center; }

.countdown-number {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.countdown-live {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
}

/* ===== Hero CTA ===== */
.hero-cta {
    display: inline-block;
    background: var(--color-accent);
    color: #1A1A2E !important;
    padding: 16px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none !important;
    transition: filter 0.15s ease, transform 0.1s ease;
}
.hero-cta:hover { filter: brightness(1.1); transform: scale(1.03); }

.hero-cta--ghost {
    background: transparent;
    color: #fff !important;
    border: 2px solid rgba(255,255,255,0.6);
}
.hero-cta--ghost:hover { background: rgba(255,255,255,0.1); filter: none; }

/* =========================================================
   Category icon row
   ========================================================= */
.category-icons {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 32px 20px;
    flex-wrap: wrap;
}

.category-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px 24px;
    transition: all 0.2s ease;
    min-width: 100px;
}

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

.category-icon-card .icon { font-size: 28px; }
.category-icon-card .label { font-size: 13px; font-weight: 600; }

/* =========================================================
   Section header
   ========================================================= */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.section-header h2 { font-size: 22px; font-weight: 700; margin: 0; }

.section-header .view-all {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.section-header .view-all:hover { text-decoration: underline; }

.update-indicator {
    font-size: 13px;
    color: var(--color-success);
    font-weight: 500;
    margin: -8px 0 16px;
}

/* =========================================================
   Deal Card Grid + Card
   ========================================================= */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 8px 0;
}

@media (max-width: 1024px) { .deals-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .deals-grid { grid-template-columns: 1fr; } }

.deal-card {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.deal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }

/* Badge */
.deal-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
}
.deal-badge--hot     { background: #EF4444; }
.deal-badge--new     { background: #3B82F6; }
.deal-badge--limited { background: #F59E0B; }

/* Category label */
.deal-category-label {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--color-border);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Image */
.deal-card__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.deal-card__image img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }

.deal-card__image-placeholder {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(45deg, #eef0f2, #eef0f2 12px, #e6e8eb 12px, #e6e8eb 24px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.deal-card__image-placeholder::after { content: "🛍️"; font-size: 40px; opacity: 0.5; }

/* Body */
.deal-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.deal-card__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}
.deal-card__title a { color: var(--color-text); text-decoration: none; }
.deal-card__title a:hover { color: var(--color-primary); }
.deal-card__merchant { color: var(--color-primary); font-weight: 700; }

/* Shipping / blurb / features (DealNews info hierarchy) */
.deal-card__shipping {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-muted);
    font-weight: 500;
}
.deal-card__blurb {
    margin: 0;
    font-size: 13px;
    color: var(--color-text);
    background: #F0FDF4;
    border-left: 3px solid var(--color-success);
    padding: 6px 10px;
    border-radius: 0 6px 6px 0;
    line-height: 1.45;
}
.deal-card__features {
    font-size: 13px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0;
}
.deal-card__features summary {
    cursor: pointer;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    list-style: none;
    user-select: none;
}
.deal-card__features summary::-webkit-details-marker { display: none; }
.deal-card__features summary::before { content: "▸ "; }
.deal-card__features[open] summary::before { content: "▾ "; }
.deal-card__features ul {
    margin: 0;
    padding: 0 16px 12px 28px;
    color: var(--color-text);
}
.deal-card__features li { margin-bottom: 4px; }

/* Popularity rating */
.deal-meta-tag--popularity { color: var(--color-accent); font-weight: 700; letter-spacing: -1px; }
.deal-popularity-num { color: var(--color-text-muted); font-weight: 600; margin-left: 4px; letter-spacing: 0; }

/* Clickable taxonomy tags */
.deal-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.deal-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    background: #F1F3F5;
    color: var(--color-text-muted);
    text-decoration: none;
    border: 1px solid var(--color-border);
    transition: all 0.12s ease;
    white-space: nowrap;
}
.deal-tag:hover { background: var(--color-text); color: #fff; border-color: var(--color-text); }
.deal-tag--status {
    background: #FEF2F2;
    color: var(--color-primary);
    border-color: #FECACA;
}
.deal-tag--status:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* Pricing */
.deal-card__pricing { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.deal-card__original-price { font-size: 13px; color: var(--color-text-muted); text-decoration: line-through; }
.deal-card__sale-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.deal-card__discount {
    background: #FEF3C7;
    color: #92400E;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

/* Meta */
.deal-card__meta { display: flex; gap: 12px; flex-wrap: wrap; }
.deal-meta-tag { font-size: 12px; padding: 2px 0; }
.deal-meta-tag--verified { color: var(--color-success); font-weight: 600; }
.deal-meta-tag--expiry   { color: var(--color-text-muted); }

/* CTA */
.deal-card__cta {
    display: block;
    background: var(--color-primary);
    color: white !important;
    text-align: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background 0.15s ease, transform 0.1s ease;
    margin-top: auto;
}
.deal-card__cta:hover { background: var(--color-primary-dark); transform: scale(1.02); }

/* =========================================================
   Prime Day strip banner
   ========================================================= */
.prime-day-strip {
    background: var(--color-primary);
    color: white;
    padding: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    border-radius: var(--radius-card);
}
.prime-day-strip h3 { margin: 0; font-size: 20px; font-weight: 800; }
.prime-day-strip p  { margin: 0; opacity: 0.9; font-size: 14px; }
.prime-day-strip-cta {
    background: var(--color-accent);
    color: #1A1A2E !important;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 700;
    white-space: nowrap;
    font-size: 14px;
}
.prime-day-strip-cta:hover { filter: brightness(1.08); }

/* =========================================================
   Anchor nav (Prime Day page)
   ========================================================= */
.anchor-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 24px 0;
}
.anchor-nav a {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 30px;
    padding: 8px 18px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s ease;
}
.anchor-nav a:hover { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* =========================================================
   FAQ
   ========================================================= */
.faq-section { max-width: 820px; margin: 0 auto; }
.faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 14px;
}
.faq-item h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.faq-item p  { margin: 0; color: var(--color-text-muted); }

/* =========================================================
   Single deal
   ========================================================= */
.single-deal { max-width: 900px; margin: 0 auto; }
.single-deal__layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 720px) { .single-deal__layout { grid-template-columns: 1fr; } }
.single-deal__media { background: var(--color-surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.single-deal__media img { width: 100%; display: block; padding: 24px; object-fit: contain; }
.single-deal h1 { font-size: 28px; font-weight: 800; margin: 0 0 16px; }
.single-deal .deal-card__cta { font-size: 16px; padding: 16px; }
.single-deal__content { margin-top: 32px; }

/* =========================================================
   Blog list
   ========================================================= */
.cn-post-list { max-width: 760px; margin: 0 auto; }
.cn-post-item { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 24px; margin-bottom: 20px; }
.cn-post-item__title { margin: 0 0 6px; font-size: 20px; }
.cn-post-item__title a { color: var(--color-text); text-decoration: none; }
.cn-post-item__title a:hover { color: var(--color-primary); }
.cn-post-item__meta { font-size: 13px; color: var(--color-text-muted); margin-bottom: 10px; }
.cn-pagination { text-align: center; margin-top: 24px; }

/* =========================================================
   Roundup / Best-Of pages
   ========================================================= */
.roundup { max-width: 880px; margin: 0 auto; }
.roundup__title { font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.15; margin: 0 0 8px; }
.roundup__meta { color: var(--color-text-muted); font-size: 14px; margin: 0 0 24px; }
.roundup__intro { font-size: 17px; line-height: 1.7; margin-bottom: 32px; }
.roundup__intro p { margin: 0 0 14px; }

/* Comparison table */
.roundup-table-wrap { overflow-x: auto; margin-bottom: 40px; border: 1px solid var(--color-border); border-radius: var(--radius-card); }
.roundup-table { width: 100%; border-collapse: collapse; background: var(--color-surface); font-size: 14px; }
.roundup-table th, .roundup-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.roundup-table thead th { background: #1A1A2E; color: #fff; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.roundup-table tbody tr:last-child td { border-bottom: none; }
.roundup-table tbody tr:hover { background: #fafbfc; }
.roundup-table__rank { font-weight: 800; white-space: nowrap; }
.roundup-table__award { display: inline-block; font-size: 10px; font-weight: 700; color: var(--color-primary); text-transform: uppercase; letter-spacing: 0.3px; }
.roundup-table a { color: var(--color-text); text-decoration: none; font-weight: 600; }
.roundup-table a:hover { color: var(--color-primary); }
.roundup-table__cta { display: inline-block; background: var(--color-primary); color: #fff !important; padding: 6px 14px; border-radius: 6px; font-size: 13px; white-space: nowrap; }
.roundup-table__cta:hover { background: var(--color-primary-dark); }

/* Ranked picks */
.roundup-list { display: flex; flex-direction: column; gap: 24px; }
.roundup-item {
    position: relative;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 24px;
    scroll-margin-top: 90px;
}
@media (max-width: 640px) { .roundup-item { grid-template-columns: 1fr; } }

.roundup-item__rank { position: absolute; top: 0; left: 0; display: flex; align-items: center; gap: 8px; background: #1A1A2E; color: #fff; padding: 6px 14px; border-radius: var(--radius-card) 0 var(--radius-card) 0; }
.roundup-item__num { font-size: 16px; font-weight: 800; }
.roundup-item__award { font-size: 11px; font-weight: 700; color: var(--color-accent); text-transform: uppercase; letter-spacing: 0.5px; }

.roundup-item__media { display: flex; align-items: center; justify-content: center; background: #f3f4f6; border-radius: 8px; aspect-ratio: 1/1; overflow: hidden; }
.roundup-item__media img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.roundup-item__media .deal-card__image-placeholder { border-radius: 8px; }

.roundup-item__body { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.roundup-item__title { font-size: 19px; font-weight: 700; line-height: 1.35; margin: 8px 0 0; }
.roundup-item__why { margin: 0; font-size: 14px; line-height: 1.6; color: var(--color-text); }
.roundup-item__pros { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
@media (max-width: 480px) { .roundup-item__pros { grid-template-columns: 1fr; } }
.roundup-item__pros li { font-size: 13px; color: var(--color-text-muted); padding-left: 20px; position: relative; }
.roundup-item__pros li::before { content: "✓"; position: absolute; left: 0; color: var(--color-success); font-weight: 700; }
.roundup-item__cta { max-width: 280px; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
    background: #1A1A2E;
    color: rgba(255,255,255,0.7);
    padding: 48px 20px 24px;
    margin-top: 60px;
}
.site-footer a { color: rgba(255,255,255,0.85); text-decoration: none; }
.site-footer a:hover { color: #fff; }

.site-footer__brand { font-size: 22px; font-weight: 800; color: var(--color-primary); }
.site-footer__tagline { margin: 4px 0 24px; color: rgba(255,255,255,0.6); }

.footer-menu {
    list-style: none;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding: 0;
    margin: 0 0 16px;
}
.footer-menu a { font-weight: 600; }

.footer-disclaimer {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 32px;
    line-height: 1.7;
}
.footer-copyright { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 16px; }

/* Utility */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
    white-space: nowrap;
}
