/* CSS Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --background: #ffffff;
    --surface: #f8fafc;
    --surface-dark: #f1f5f9;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --transition: 0.2s 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;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--secondary);
}

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

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav a {
    font-weight: 500;
    color: var(--text-light);
    transition: color var(--transition);
}

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

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--secondary);
    transition: var(--transition);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius);
    transition: all var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-dark);
    border-color: var(--text-lighter);
}

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

.btn-accent:hover {
    background: #d97706;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Hero Section */
.hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, var(--surface) 0%, #e0e7ff 100%);
}

.hero .container {
    display: grid;
    gap: 3rem;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--secondary);
    margin-bottom: 1.25rem;
}

.hero-content .highlight {
    color: var(--primary);
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 540px;
    margin-bottom: 2rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Categories */
.categories {
    padding: 4rem 0;
}

.categories h2 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

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

.category-card.active {
    background: white;
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.category-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.category-card span {
    font-weight: 600;
    color: var(--text);
}

/* Products Section */
.products {
    padding: 4rem 0;
    background: var(--surface);
}

.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-select {
    padding: 0.625rem 2.5rem 0.625rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 1rem center;
    cursor: pointer;
    transition: border-color var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.view-toggle {
    display: flex;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    color: var(--text-light);
    transition: all var(--transition);
}

.view-btn:hover {
    color: var(--primary);
}

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

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

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

.product-image {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--surface);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-dark) 100%);
}

.product-image-placeholder svg {
    width: 64px;
    height: 64px;
    color: var(--text-lighter);
}

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--accent);
    color: white;
    border-radius: 9999px;
}

.product-info {
    padding: 1.25rem;
}

.product-info h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-rating svg {
    width: 14px;
    height: 14px;
    fill: var(--accent);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.product-price span {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-light);
}

.product-actions {
    display: flex;
    gap: 0.75rem;
}

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

.compare-btn {
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius);
    color: var(--text-light);
    transition: all var(--transition);
}

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

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

/* Product Table */
.product-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.product-table {
    width: 100%;
    border-collapse: collapse;
}

.product-table th,
.product-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.product-table th {
    font-weight: 600;
    color: var(--text-light);
    background: var(--surface);
    white-space: nowrap;
}

.product-table td {
    vertical-align: middle;
}

.product-table tbody tr:hover {
    background: var(--surface);
}

.table-product-name {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.table-product-thumb {
    width: 60px;
    height: 45px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.table-product-thumb svg {
    width: 100%;
    height: 100%;
    padding: 0.5rem;
    color: var(--text-lighter);
}

.table-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.table-rating svg {
    width: 14px;
    height: 14px;
    fill: var(--accent);
}

/* Quiz Section */
.quiz-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--secondary) 0%, #1e3a5f 100%);
}

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

.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.quiz-header p {
    color: var(--text-light);
}

.quiz-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 8px;
    background: var(--surface);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

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

.quiz-question {
    margin-bottom: 1.5rem;
}

.quiz-question h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.quiz-options {
    display: grid;
    gap: 0.75rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

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

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

.quiz-option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
}

.quiz-option.selected .quiz-option-radio {
    border-color: var(--primary);
    background: var(--primary);
}

.quiz-option.selected .quiz-option-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.quiz-option-text {
    font-weight: 500;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.quiz-results h3 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.result-card-image {
    width: 80px;
    height: 60px;
    background: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-card-image svg {
    width: 40px;
    height: 40px;
    color: var(--text-lighter);
}

.result-card-info {
    flex: 1;
    min-width: 0;
}

.result-card-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.result-card-info p {
    font-size: 0.875rem;
    color: var(--text-light);
}

.result-card .btn-sm {
    flex-shrink: 0;
}

/* Compare Section */
.compare-section {
    padding: 5rem 0;
}

.compare-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-desc {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.compare-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.compare-slot {
    min-height: 200px;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.compare-slot.filled {
    border-style: solid;
    border-color: var(--primary-light);
}

.add-compare-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    color: var(--text-light);
    transition: color var(--transition);
}

.add-compare-btn:hover {
    color: var(--primary);
}

.add-compare-btn svg {
    width: 48px;
    height: 48px;
}

.compare-product {
    width: 100%;
    padding: 1rem;
    position: relative;
}

.remove-compare {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.remove-compare:hover {
    background: var(--error);
    color: white;
}

.compare-product-info {
    text-align: center;
}

.compare-product-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.compare-product-info p {
    font-size: 0.875rem;
    color: var(--text-light);
}

.compare-table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
}

.compare-table th,
.compare-table td {
    padding: 1rem 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.compare-table th:first-child,
.compare-table td:first-child {
    text-align: left;
    font-weight: 600;
    background: var(--surface);
    color: var(--text-light);
    width: 180px;
}

.compare-table tbody tr:last-child td {
    border-bottom: none;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform var(--transition);
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-light);
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--error);
}

.modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.modal-product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.modal-product-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.modal-product-item:hover {
    background: white;
    border-color: var(--primary-light);
}

.modal-product-item.selected {
    border-color: var(--primary);
}

.modal-product-thumb {
    width: 50px;
    height: 38px;
    background: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-product-thumb svg {
    width: 24px;
    height: 24px;
    color: var(--text-lighter);
}

.modal-product-name {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Guide Section */
.guide-section {
    padding: 5rem 0;
    background: var(--surface);
}

.guide-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.guide-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

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

.guide-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.guide-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.guide-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.guide-card p {
    font-size: 0.9375rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* SEO Section */
.seo-section {
    padding: 5rem 0;
}

.seo-content {
    max-width: 900px;
    margin: 0 auto;
}

.seo-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.seo-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.seo-content strong {
    color: var(--text);
}

/* Footer */
.footer {
    background: var(--secondary);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    margin-top: 1rem;
    color: var(--text-lighter);
    max-width: 280px;
}

.footer-brand .logo {
    color: white;
}

.footer-brand .logo svg {
    color: var(--primary-light);
}

.footer-links h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    color: var(--text-lighter);
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition);
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

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

.affiliate-disclosure {
    margin-top: 0.75rem;
    font-size: 0.8125rem !important;
    opacity: 0.7;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        padding: 1.5rem;
        background: white;
        border-bottom: 1px solid var(--border);
        gap: 1rem;
    }

    .nav.active {
        display: flex;
    }

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

    .hero {
        padding: 7rem 0 3rem;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 2rem;
    }

    .stat {
        flex: 1;
        min-width: 80px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-controls {
        flex-wrap: wrap;
        width: 100%;
    }

    .filter-select {
        flex: 1;
        min-width: 140px;
    }

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

    .compare-slot {
        min-height: 150px;
    }

    .quiz-container {
        padding: 1.5rem;
    }

    .modal-product-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .footer-brand p {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .quiz-nav {
        flex-direction: column;
    }

    .quiz-nav .btn {
        width: 100%;
    }
}
