/* CSS Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --accent: #f59e0b;
    --dark: #1f2937;
    --dark-light: #374151;
    --gray: #6b7280;
    --gray-light: #9ca3af;
    --gray-lighter: #e5e7eb;
    --white: #ffffff;
    --off-white: #f9fafb;
    --background: #f3f4f6;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--background);
}

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

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* Header & Navigation */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text .highlight {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    font-weight: 500;
    color: var(--dark-light);
    transition: var(--transition);
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--dark);
    border-radius: 3px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--white);
    color: var(--primary);
}

.btn-primary:hover {
    background: var(--off-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary);
}

.btn-amazon {
    background: #ff9900;
    color: var(--dark);
}

.btn-amazon:hover {
    background: #ffad33;
    transform: translateY(-2px);
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.875rem;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Products Section */
.products-section {
    padding: 80px 0;
    background: var(--white);
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark);
}

.section-subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--off-white);
    border-radius: var(--radius);
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: var(--dark-light);
}

.filter-group select {
    padding: 10px 16px;
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 0.875rem;
    color: var(--dark);
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:hover {
    border-color: var(--primary);
}

.view-toggle {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.view-btn {
    padding: 10px;
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray);
}

.view-btn.active,
.view-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--gray-lighter);
}

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

.product-image {
    width: 100%;
    height: 220px;
    background: var(--off-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    position: relative;
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-bestseller {
    background: var(--accent);
    color: var(--dark);
}

.badge-new {
    background: var(--secondary);
    color: var(--white);
}

.badge-sale {
    background: #ef4444;
    color: var(--white);
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
    line-height: 1.3;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.feature-tag {
    padding: 4px 10px;
    background: var(--off-white);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--gray);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.stars {
    color: var(--accent);
    font-size: 0.875rem;
}

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

.product-price {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.price-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.price-original {
    font-size: 1rem;
    color: var(--gray-light);
    text-decoration: line-through;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.product-actions .btn {
    flex: 1;
}

.btn-compare {
    background: var(--off-white);
    color: var(--dark);
    border: 1px solid var(--gray-lighter);
}

.btn-compare:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-compare.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Products Table */
.products-table {
    overflow-x: auto;
}

.products-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.products-table th,
.products-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-lighter);
}

.products-table th {
    background: var(--dark);
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.products-table tr:hover {
    background: var(--off-white);
}

.products-table .product-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.products-table .product-thumb {
    width: 50px;
    height: 50px;
    background: var(--off-white);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.hidden {
    display: none !important;
}

/* Quiz Section */
.quiz-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
}

.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    color: var(--dark);
}

.quiz-progress {
    margin-bottom: 32px;
}

.progress-bar {
    height: 8px;
    background: var(--gray-lighter);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 20%;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--gray);
}

.quiz-content h3 {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--dark);
}

.quiz-options {
    display: grid;
    gap: 12px;
}

.quiz-option {
    padding: 16px 20px;
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: var(--off-white);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.quiz-option-icon {
    font-size: 1.5rem;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
}

.quiz-result {
    text-align: center;
}

.quiz-result h3 {
    color: var(--secondary);
    font-size: 1.75rem;
    margin-bottom: 24px;
}

.recommended-card {
    background: var(--off-white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.recommended-card .product-image {
    height: 180px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

/* Compare Section */
.compare-section {
    padding: 80px 0;
    background: var(--off-white);
}

.compare-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.compare-slot {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.compare-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-lighter);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 0.875rem;
    color: var(--dark);
    cursor: pointer;
    margin-bottom: 16px;
}

.selected-preview {
    min-height: 150px;
    background: var(--off-white);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-light);
    font-size: 0.875rem;
}

.selected-preview.has-product {
    flex-direction: column;
    padding: 16px;
    text-align: center;
}

.selected-preview .preview-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.selected-preview .preview-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.875rem;
}

.selected-preview .preview-price {
    color: var(--primary);
    font-weight: 700;
    margin-top: 4px;
}

.compare-table {
    overflow-x: auto;
}

.compare-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.compare-table th,
.compare-table td {
    padding: 16px 20px;
    text-align: center;
    border-bottom: 1px solid var(--gray-lighter);
}

.compare-table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.compare-table th:first-child {
    background: var(--dark);
    text-align: left;
}

.compare-table td:first-child {
    font-weight: 600;
    background: var(--off-white);
    text-align: left;
}

.compare-table .check {
    color: var(--secondary);
    font-size: 1.25rem;
}

.compare-table .cross {
    color: #ef4444;
    font-size: 1.25rem;
}

/* SEO Section */
.seo-section {
    padding: 80px 0;
    background: var(--white);
}

.seo-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-bottom: 48px;
}

.seo-block {
    padding: 24px;
    background: var(--off-white);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.seo-block h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--dark);
}

.seo-block p {
    color: var(--gray);
    line-height: 1.7;
}

.trust-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--off-white);
    border-radius: var(--radius);
    font-weight: 500;
}

.badge-icon {
    font-size: 1.25rem;
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: var(--gray-light);
    margin-top: 16px;
    font-size: 0.875rem;
}

.footer-links h4 {
    margin-bottom: 16px;
    font-size: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--gray-light);
    font-size: 0.875rem;
    transition: var(--transition);
}

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

.footer-bottom {
    border-top: 1px solid var(--dark-light);
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    color: var(--gray-light);
    font-size: 0.875rem;
}

.affiliate-disclosure {
    margin-top: 8px;
    font-size: 0.75rem !important;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 500px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray);
}

.modal-content h3 {
    margin-bottom: 16px;
    color: var(--dark);
}

.modal-content p {
    color: var(--gray);
    margin-bottom: 12px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }

    .seo-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: 24px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        margin-left: 0;
        justify-content: center;
    }

    .compare-selector {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .quiz-container {
        padding: 24px;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .product-actions {
        flex-direction: column;
    }

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

    .trust-badges {
        flex-direction: column;
        align-items: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.5s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

/* Smooth scroll offset for fixed header */
section[id] {
    scroll-margin-top: 80px;
}

/* Focus states for accessibility */
a:focus,
button:focus,
select:focus,
input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .hero-cta,
    .filters,
    .quiz-section,
    .compare-section,
    .footer {
        display: none;
    }
}
