:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --orange: #ea580c;
    --bg: #f8fafc;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--gray-900);
    line-height: 1.6;
}

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

/* HEADER */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--gray-900);
}

.logo-icon { margin-right: 4px; }
.logo-dot { color: var(--primary); }

.nav a {
    text-decoration: none;
    color: var(--gray-500);
    margin-left: 24px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

/* HERO */
.hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: white;
    padding: 60px 0 50px;
    text-align: center;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.hero-sub {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 620px;
    margin: 0 auto 32px;
}

.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 1rem;
    outline: none;
    font-family: inherit;
}

.search-input:focus { border-color: var(--primary); }

.search-btn {
    padding: 16px 28px;
    background: var(--orange);
    color: white;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    white-space: nowrap;
}

.search-btn:hover { background: #c2410c; }

/* RESULTS */
.results-section { padding: 32px 0 16px; }

.no-results {
    background: var(--white);
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.no-results h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.no-results ul {
    margin: 8px 0 0 20px;
    color: var(--gray-500);
}

.no-results li { margin: 4px 0; }

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover { text-decoration: underline; }

/* COUPONS */
.coupons-section { padding: 32px 0; }

.coupons-section > h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.coupon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.coupon-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 24px;
    transition: box-shadow 0.2s;
}

.coupon-card:hover { box-shadow: var(--shadow-lg); }

.coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.coupon-store {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
}

.coupon-badges { display: flex; gap: 6px; }

.coupon-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coupon-badge.code { background: #dbeafe; color: #1e40af; }
.coupon-badge.deal { background: #fef3c7; color: #92400e; }
.coupon-badge.exclusive { background: #dcfce7; color: #166534; }

.coupon-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.coupon-desc {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.coupon-code-box {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.coupon-code {
    flex: 1;
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    padding: 12px 16px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-align: center;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--gray-900);
}

.copy-btn {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: 2px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn:hover { background: var(--primary-dark); }
.copy-btn.copied { background: var(--success); border-color: var(--success); }

.coupon-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.coupon-expiry { color: var(--gray-500); }

.coupon-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.coupon-link:hover { text-decoration: underline; }

.coupon-terms {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.coupon-terms summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-700);
}

.coupon-terms p { margin-top: 8px; }

/* STORES */
.stores-section { padding: 20px 0 40px; }

.stores-section h2 {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.store-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.store-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.store-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.95rem;
}

.store-count {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* HOW IT WORKS */
.how-it-works {
    padding: 40px 0;
    text-align: center;
}

.how-it-works h2 {
    font-size: 1.5rem;
    margin-bottom: 32px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    max-width: 800px;
    margin: 0 auto;
}

.step {
    padding: 24px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.step h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.step p {
    font-size: 0.9rem;
    color: var(--gray-500);
}

/* ABOUT */
.about-section {
    padding: 20px 0 48px;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-section h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.about-section p {
    font-size: 0.95rem;
    color: var(--gray-500);
    line-height: 1.7;
}

/* FOOTER */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 40px 0 24px;
    margin-top: 40px;
}

.footer-inner {
    text-align: center;
}

.footer-info {
    margin-bottom: 20px;
}

.footer-info strong {
    color: var(--white);
    font-size: 1.1rem;
}

.affiliate-disclosure {
    font-size: 0.8rem;
    max-width: 700px;
    margin: 12px auto 0;
    line-height: 1.6;
    color: var(--gray-500);
}

.footer-links {
    margin-bottom: 16px;
}

.footer-links a {
    color: var(--gray-300);
    text-decoration: none;
    margin: 0 12px;
    font-size: 0.85rem;
}

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

.footer-copy {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* BROWSE PAGE */
.browse-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: white;
    padding: 40px 0 32px;
    text-align: center;
}

.browse-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.browse-hero-sub {
    font-size: 1rem;
    opacity: 0.9;
}

.browse-layout {
    display: flex;
    gap: 32px;
    padding-top: 32px;
    padding-bottom: 48px;
    align-items: flex-start;
}

.browse-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
}

.browse-sidebar h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--gray-700);
}

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

.category-list li {
    margin-bottom: 4px;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.category-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.category-active {
    background: var(--primary);
    color: white !important;
}

.category-active:hover {
    background: var(--primary-dark);
    color: white !important;
}

.category-count {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0,0,0,0.08);
    padding: 2px 8px;
    border-radius: 10px;
}

.category-active .category-count {
    background: rgba(255,255,255,0.25);
    color: white;
}

.browse-main {
    flex: 1;
    min-width: 0;
}

.browse-main .coupon-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.coupon-meta {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.coupon-added {
    font-style: italic;
}

.category-badge {
    background: #f0f9ff !important;
    color: #0369a1 !important;
    font-size: 0.65rem !important;
}

.nav-active {
    color: var(--primary) !important;
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.6rem; }
    .hero-sub { font-size: 0.95rem; }

    .search-form {
        flex-direction: column;
    }

    .search-input {
        border-radius: var(--radius);
        margin-bottom: 8px;
    }

    .search-btn {
        border-radius: var(--radius);
        padding: 14px;
    }

    .coupon-grid {
        grid-template-columns: 1fr;
    }

    .stores-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-inner {
        flex-direction: column;
        gap: 12px;
    }

    .nav a { margin-left: 16px; }

    .browse-layout {
        flex-direction: column;
    }

    .browse-sidebar {
        width: 100%;
        position: static;
    }

    .category-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .category-list li {
        margin-bottom: 0;
    }

    .category-link {
        padding: 6px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .browse-hero h1 { font-size: 1.5rem; }
}
