/* === CSS Variables === */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --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);

    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;

    --container-width: 1200px;
    --header-height: 72px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

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

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

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

input, select {
    font-family: inherit;
    font-size: inherit;
}

/* === Utility Classes === */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

.hidden {
    display: none !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: var(--transition);
    white-space: nowrap;
}

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

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

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

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

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

.logo-icon {
    font-size: 28px;
}

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

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

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

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

.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    flex-direction: column;
    gap: 16px;
    z-index: 999;
}

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

/* === Hero Section === */
.hero {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

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

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 100px;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    gap: 48px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

/* === Categories === */
.categories {
    padding: 48px 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

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

.category-icon {
    font-size: 32px;
}

.category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* === Products Section === */
.products-section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 15px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
}

.view-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    padding: 4px;
}

.view-btn {
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: var(--transition);
}

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

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

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

.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

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

.product-image {
    position: relative;
    height: 200px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 100px;
}

.product-badge.bestseller {
    background: var(--success);
}

.product-badge.premium {
    background: var(--secondary);
}

.product-content {
    padding: 20px;
}

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

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.feature-tag {
    padding: 4px 10px;
    background: var(--bg-tertiary);
    font-size: 12px;
    border-radius: 100px;
    color: var(--text-secondary);
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stars {
    color: var(--accent);
    font-size: 14px;
}

.rating-count {
    font-size: 13px;
    color: var(--text-muted);
}

.product-price {
    font-size: 14px;
    color: var(--text-secondary);
}

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

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

/* === Products Table === */
.products-table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
}

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

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

.products-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

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

.products-table tr:hover {
    background: var(--bg-secondary);
}

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

.table-product-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-product-info {
    display: flex;
    flex-direction: column;
}

.table-product-name {
    font-weight: 600;
    color: var(--text-primary);
}

.table-product-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* === Quiz Section === */
.quiz-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

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

.quiz-header {
    text-align: center;
    margin-bottom: 40px;
}

.quiz-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 100px;
    margin-bottom: 16px;
}

.quiz-header h2 {
    font-size: 32px;
    margin-bottom: 12px;
}

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

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

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 100px;
    transition: width 0.3s ease;
    width: 20%;
}

.progress-text {
    font-size: 14px;
    color: var(--text-muted);
}

.quiz-question {
    margin-bottom: 24px;
}

.quiz-question h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

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

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

.quiz-option-icon {
    font-size: 24px;
}

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

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

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

.result-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.result-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.result-products {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.result-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    text-align: left;
}

.result-product-icon {
    font-size: 40px;
}

.result-product-info h4 {
    font-weight: 600;
    margin-bottom: 4px;
}

.result-product-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.compare-selector {
    margin-bottom: 48px;
}

.compare-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

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

.compare-slot:hover {
    border-color: var(--primary);
}

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

.slot-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.slot-icon {
    font-size: 48px;
    font-weight: 300;
    color: var(--border-color);
}

.slot-text {
    font-weight: 500;
}

.slot-product {
    width: 100%;
    padding: 20px;
    position: relative;
}

.slot-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    font-size: 18px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.slot-content {
    text-align: center;
}

.slot-content .product-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.slot-content .product-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.slot-content .product-cat {
    font-size: 13px;
    color: var(--text-muted);
}

/* === 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: 1001;
    padding: 24px;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    font-size: 24px;
    color: var(--text-muted);
    padding: 4px;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.compare-product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compare-product-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.compare-product-item:hover {
    background: var(--bg-tertiary);
}

.compare-product-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.compare-product-icon {
    font-size: 32px;
}

.compare-product-info h4 {
    font-weight: 600;
    font-size: 15px;
}

.compare-product-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* === Comparison Table === */
.comparison-table {
    overflow-x: auto;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

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

.comparison-table th,
.comparison-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--bg-secondary);
}

.comparison-table th:first-child {
    font-weight: 600;
    color: var(--text-secondary);
}

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

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

.compare-product-header .icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.compare-product-header .name {
    font-weight: 600;
    font-size: 15px;
}

.compare-check {
    color: var(--success);
}

.compare-cross {
    color: var(--text-muted);
}

/* === Guide Section === */
.guide-section {
    padding: 80px 0;
}

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

.guide-card {
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
}

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

.guide-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.guide-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.guide-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* === SEO Content Section === */
.seo-content {
    padding: 80px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.seo-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.seo-wrapper h2 {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.seo-wrapper h3 {
    font-size: 20px;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.seo-wrapper p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.8;
}

/* === Footer === */
.footer {
    background: var(--secondary);
    color: white;
    padding: 64px 0 32px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 64px;
    margin-bottom: 48px;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 16px;
    line-height: 1.7;
}

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

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.footer-column h4 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.footer-column a {
    display: block;
    color: white;
    opacity: 0.8;
    padding: 8px 0;
    font-size: 15px;
}

.footer-column a:hover {
    opacity: 1;
    color: white;
}

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

.footer-bottom p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.affiliate-disclosure {
    font-size: 13px !important;
    opacity: 0.7;
}

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

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

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

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .nav {
        display: none;
    }

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

    .hero {
        padding: 120px 0 60px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

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

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

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

    .section-header h2 {
        font-size: 28px;
    }

    .quiz-container {
        padding: 32px 24px;
    }

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

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

    .footer-links {
        grid-template-columns: 1fr 1fr;
    }

    .products-table th,
    .products-table td {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .category-card {
        padding: 16px 12px;
    }

    .category-icon {
        font-size: 24px;
    }

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

    .footer-links {
        grid-template-columns: 1fr;
    }

    .quiz-option {
        padding: 14px 16px;
    }
}

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

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

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