/* === Dealfolioo — Professional Deal Aggregation CSS === */

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

:root {
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #dbeafe;
    --border: #e2e8f0;
    --badge-best: #059669;
    --badge-ai: #7c3aed;
    --danger: #dc2626;
    --warning: #f59e0b;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --max-width: 1100px;
    --transition: 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

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

/* ===================== HEADER ===================== */
header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

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

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo:hover { text-decoration: none; }

nav {
    display: flex;
    gap: 0.25rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

nav a:hover {
    color: var(--text);
    background: var(--bg);
    text-decoration: none;
}

/* ===================== MAIN CONTENT ===================== */
main {
    flex: 1;
    padding: 2rem 0 3rem;
}

h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.empty {
    color: var(--text-muted);
    text-align: center;
    padding: 5rem 0;
    font-size: 1.05rem;
}

/* ===================== DEAL GRID ===================== */
.deal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.deal-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    display: flex;
    flex-direction: column;
}

.deal-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--accent);
    text-decoration: none;
}

.deal-image {
    width: 100%;
    height: 190px;
    object-fit: cover;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
}

.deal-image.placeholder {
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
}

.deal-info {
    padding: 1rem 1.15rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.deal-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    font-weight: 700;
}

.deal-info h2 {
    font-size: 0.95rem;
    margin: 0.3rem 0 0.6rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
}

.deal-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
    margin-top: auto;
}

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

.deal-price {
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
}

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

/* ===================== BADGES ===================== */
.deal-badges {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.best-value {
    background: #d1fae5;
    color: var(--badge-best);
}

.ai-pick {
    background: #ede9fe;
    color: var(--badge-ai);
}

/* ===================== SINGLE DEAL PAGE ===================== */
.deal-single {
    max-width: 720px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    padding: 0.3rem 0;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.deal-hero {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: var(--radius);
    background: #f1f5f9;
    margin-bottom: 1.75rem;
    border: 1px solid var(--border);
}

.deal-header {
    margin-bottom: 1.75rem;
}

.deal-header h1 {
    margin-bottom: 0.3rem;
    font-size: 1.75rem;
}

.brand {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

/* Price block */
.price-block {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

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

.original-price {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.discount {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    background: var(--badge-best);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

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

.shipping.free {
    color: var(--badge-best);
    font-weight: 600;
}

.meta-row {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.description {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.description h2 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.description p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.ai-reason {
    margin: 1rem 0;
    padding: 0.85rem 1.15rem;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: #5b21b6;
    line-height: 1.6;
}

/* CTA Button */
.cta-button {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1.1rem;
    margin: 1.75rem 0;
    background: var(--accent);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    letter-spacing: -0.01em;
}

.cta-button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: #fff;
}

/* Inline disclosure on deal page */
.inline-disclosure {
    margin-top: 1.25rem;
    padding: 0.85rem 1.15rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.6;
}

/* ===================== BLOG PAGES ===================== */
.blog-index {
    max-width: 720px;
    margin: 0 auto;
}

.blog-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.blog-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.blog-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--accent);
    text-decoration: none;
}

.blog-card-content h2 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.blog-card-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.blog-date {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.blog-read-more {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    margin-left: 1rem;
}

/* Blog post page */
.blog-post {
    max-width: 900px;
    margin: 0 auto;
}

.blog-post-header {
    margin-bottom: 2rem;
}

.blog-post-header h1 {
    font-size: 2rem;
}

/* ===================== FOOTER ===================== */
footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
}

.disclosure {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    background: #fffbeb;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius);
    border: 1px solid #fde68a;
}

.disclosure p {
    color: #92400e;
    margin: 0;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px) {
    .deal-grid {
        grid-template-columns: 1fr;
    }

    .current-price {
        font-size: 1.6rem;
    }

    .cta-button {
        font-size: 1rem;
        padding: 0.9rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .blog-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .blog-read-more {
        margin-left: 0;
    }

    nav {
        gap: 0;
    }

    nav a {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }
}
