/* ═══════════════════════════════════════════════════
   DealBot — Modern Deals Website
   Clean, fast, conversion-focused design
   ═══════════════════════════════════════════════════ */

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --surface-hover: #fafafa;
    --text: #1a1a2e;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --green: #16a34a;
    --green-bg: #dcfce7;
    --red: #dc2626;
    --red-bg: #fef2f2;
    --orange: #ea580c;
    --orange-bg: #fff7ed;
    --yellow: #eab308;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition: 180ms ease;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
}

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

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { display: block; max-width: 100%; }

/* ── Header ────────────────────────────────────── */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 0 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}

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

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.logo-accent { color: var(--accent); }

.tagline {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.disclosure {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.disclosure a { color: var(--text-secondary); }

/* ── Layout ────────────────────────────────────── */
.main-content {
    padding: 24px 24px 60px;
}

.layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
    position: sticky;
    top: 100px;
}

.filter-section {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 16px;
}

.filter-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 10px;
}

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

.category-link, .sort-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.category-link:hover, .sort-link:hover {
    background: var(--border-light);
    color: var(--text);
    text-decoration: none;
}

.category-link.active, .sort-link.active {
    background: var(--accent);
    color: white;
}

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

.category-count {
    font-size: 0.75rem;
    background: var(--border-light);
    padding: 1px 8px;
    border-radius: 10px;
    color: var(--text-muted);
}

/* ── Content Header ────────────────────────────── */
.content-header {
    margin-bottom: 16px;
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ── Deal Grid ─────────────────────────────────── */
.deal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
}

/* ── Deal Card ─────────────────────────────────── */
.deal-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    transition: box-shadow var(--transition), transform var(--transition);
}

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

/* Badges */
.badge {
    position: absolute;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-discount {
    top: 12px;
    right: 12px;
    background: var(--green);
    color: white;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 8px;
}

.badge-lightning {
    top: 12px;
    left: 12px;
    background: var(--red);
    color: white;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Image */
.deal-image-link {
    display: block;
}

.deal-image {
    aspect-ratio: 1;
    background: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
}

.deal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--transition);
}

.deal-card:hover .deal-image img {
    transform: scale(1.04);
}

/* Body */
.deal-body {
    padding: 16px;
}

.deal-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.deal-source {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
}

.deal-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.deal-title {
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.deal-title a {
    color: var(--text);
    transition: color var(--transition);
}

.deal-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.deal-brand {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Pricing */
.deal-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.price-current {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--orange);
    letter-spacing: -0.02em;
}

.price-original {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.price-savings {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--green);
    background: var(--green-bg);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Coupon */
.deal-coupon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--green);
    background: var(--green-bg);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px dashed var(--green);
    margin-bottom: 10px;
}

.coupon-icon { font-size: 0.9rem; }

/* Rating */
.deal-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 0.82rem;
}

.stars { color: var(--yellow); }

.review-count {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* CTA Button */
.deal-cta {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    text-align: center;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    transition: background var(--transition), transform var(--transition);
    border: none;
    cursor: pointer;
}

.deal-cta:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    text-decoration: none;
}

.deal-cta:active {
    transform: translateY(0);
}

/* ── Empty State ───────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.empty-icon { font-size: 3rem; margin-bottom: 16px; }

.empty-state h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: background var(--transition);
}

.btn:hover {
    background: var(--accent-hover);
    text-decoration: none;
}

/* ── Pagination ────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 32px 0 8px;
}

.page-btn {
    padding: 8px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.page-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Footer ────────────────────────────────────── */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 40px;
}

.footer-content {
    max-width: 720px;
}

.footer-disclosure h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.footer-disclosure p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.footer-links {
    margin-bottom: 12px;
    font-size: 0.82rem;
}

.footer-copy {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ── Breadcrumb ───────────────────────────────── */
.breadcrumb {
    margin-bottom: 24px;
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-item a {
    color: var(--accent);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    margin: 0 8px;
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}

/* ── Deal Detail Page ─────────────────────────── */
.deal-detail-layout {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 40px;
    align-items: start;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 32px;
}

.deal-detail-image-col {
    text-align: center;
}

.deal-detail-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #fafbfc;
}

.deal-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
    color: var(--text);
}

.deal-detail-pricing {
    margin: 20px 0;
    padding: 16px;
    background: var(--border-light);
    border-radius: var(--radius-sm);
}

.deal-detail-cta {
    margin-top: 24px;
    padding: 14px 24px;
    font-size: 1.05rem;
}

.deal-detail-description {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.deal-detail-description h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.deal-detail-description p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .deal-detail-layout {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 24px;
    }

    .deal-detail-title {
        font-size: 1.25rem;
    }

    .breadcrumb-item.active {
        max-width: 220px;
    }

    .sidebar {
        position: static;
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .filter-section {
        min-width: 200px;
        flex-shrink: 0;
    }

    .header-stats { display: none; }
}

@media (max-width: 640px) {
    .deal-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .deal-image { padding: 16px; }
    .deal-body { padding: 12px; }
    .deal-title { font-size: 0.82rem; }
    .price-current { font-size: 1.15rem; }
    .logo { font-size: 1.4rem; }

    .container { padding: 0 16px; }
    .main-content { padding: 16px 16px 40px; }
}

@media (max-width: 400px) {
    .deal-grid {
        grid-template-columns: 1fr;
    }
}
