/* ========================================
   Queen Mattress Australia - Main Styles
   ======================================== */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --white: #ffffff;
    --black: #000000;

    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 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-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul {
    list-style: none;
}

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

select {
    font-family: inherit;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

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

.btn-outline {
    background: transparent;
    color: var(--gray-800);
    border: 2px solid var(--gray-300);
}

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

.btn-text {
    background: transparent;
    color: var(--gray-600);
    padding: 0.5rem 1rem;
}

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

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    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 transparent;
    transition: all var(--transition);
}

.navbar.scrolled {
    border-bottom-color: var(--gray-200);
    box-shadow: var(--shadow);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gray-900);
}

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

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

.nav-link {
    font-weight: 500;
    color: var(--gray-600);
    transition: color var(--transition);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
    overflow: hidden;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 1.5rem;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    max-width: 540px;
}

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

.hero-stats {
    display: flex;
    gap: 3rem;
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.hero-visual {
    position: relative;
}

.hero-image-container {
    position: relative;
}

.hero-image {
    background: var(--gray-100);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

.hero-image svg {
    width: 100%;
    height: auto;
}

.floating-badge {
    position: absolute;
    background: var(--white);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

.badge-1 {
    top: 10%;
    right: -10%;
    animation-delay: 0s;
}

.badge-1 span {
    color: var(--warning);
}

.badge-2 {
    bottom: 20%;
    left: -5%;
    animation-delay: 1.5s;
}

.badge-2 span {
    color: var(--success);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ========================================
   Features Section
   ======================================== */
.features {
    padding: 4rem 0;
    background: var(--white);
}

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

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

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

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--gray-600);
}

/* ========================================
   Section Header
   ======================================== */
.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 3rem;
}

.section-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--gray-100);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--gray-600);
    font-size: 1.125rem;
}

/* ========================================
   Quiz Section
   ======================================== */
.quiz-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}

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

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

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    width: 20%;
}

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

.quiz-question {
    display: none;
}

.quiz-question.active {
    display: block;
    animation: fadeIn var(--transition-slow);
}

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

.quiz-question h3 {
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.quiz-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    cursor: pointer;
}

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

.quiz-option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

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

.option-text {
    font-weight: 500;
    color: var(--gray-700);
}

.quiz-submit {
    display: block;
    width: 100%;
    margin-top: 2rem;
}

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

.results-header {
    margin-bottom: 2rem;
}

.results-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.results-products {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-product {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    text-align: left;
    transition: all var(--transition);
}

.result-product:hover {
    background: var(--white);
    box-shadow: var(--shadow-md);
}

.result-rank {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 40px;
}

.result-info {
    flex: 1;
}

.result-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.result-info p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.result-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

/* ========================================
   Products Section
   ======================================== */
.products-section {
    padding: 5rem 0;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
}

.filter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: 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='%236b7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

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

.view-toggle {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
    background: var(--white);
    padding: 0.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
}

.view-btn {
    padding: 0.5rem;
    color: var(--gray-400);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

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

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

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

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

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.product-image {
    position: relative;
    background: var(--gray-100);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.product-image svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.product-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-bestseller {
    background: var(--warning);
    color: var(--white);
}

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

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

.product-compare {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.compare-checkbox {
    display: none;
}

.compare-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

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

.compare-checkbox:checked + .compare-label {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.compare-label svg {
    width: 18px;
    height: 18px;
}

.product-content {
    padding: 1.5rem;
}

.product-brand {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.product-title a {
    color: var(--gray-900);
}

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

.product-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

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

.product-features {
    margin-bottom: 1.5rem;
}

.product-features li {
    font-size: 0.875rem;
    color: var(--gray-600);
    padding-left: 1.25rem;
    position: relative;
    margin-bottom: 0.375rem;
}

.product-features li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 600;
}

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

.product-price {
    display: flex;
    flex-direction: column;
}

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

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

.product-cta .btn {
    gap: 0.375rem;
}

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

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

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

.products-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.products-table tbody tr {
    transition: background var(--transition);
}

.products-table tbody tr:hover {
    background: var(--gray-50);
}

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

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

.table-product-image {
    width: 60px;
    height: 60px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-product-image svg {
    width: 50px;
    height: 50px;
}

.table-product-info h4 {
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.table-product-info span {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

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

.table-rating .stars {
    font-size: 0.75rem;
}

.table-price {
    font-weight: 600;
    color: var(--gray-900);
}

/* ========================================
   Compare Section
   ======================================== */
.compare-section {
    padding: 5rem 0;
    background: var(--gray-50);
}

.compare-selector {
    margin-bottom: 3rem;
}

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

.compare-slot {
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition);
}

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

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

.slot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.slot-icon {
    font-size: 2rem;
    font-weight: 300;
}

.slot-text {
    font-size: 0.875rem;
}

.slot-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: var(--white);
    cursor: pointer;
}

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

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

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

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

.compare-table th {
    background: var(--gray-50);
    font-weight: 600;
}

.compare-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--gray-700);
    background: var(--gray-50);
}

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

.compare-header-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.compare-header-cell h4 {
    font-size: 1rem;
}

.compare-header-cell span {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 400;
}

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

.compare-value-bad {
    color: var(--error);
}

/* ========================================
   Buying Guide Section
   ======================================== */
.guide-section {
    padding: 5rem 0;
}

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

.guide-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition);
}

.guide-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.guide-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.guide-card h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

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

/* ========================================
   SEO Content Section
   ======================================== */
.seo-section {
    padding: 5rem 0;
    background: var(--gray-50);
}

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

.seo-content h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.seo-content h3 {
    margin: 2rem 0 1rem;
    color: var(--gray-800);
}

.seo-content p {
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 4rem 0 2rem;
}

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

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.9375rem;
    line-height: 1.7;
}

.footer-links h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

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

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

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--gray-800);
    text-align: center;
    font-size: 0.875rem;
}

.affiliate-disclosure {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ========================================
   Compare Floating Bar
   ======================================== */
.compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 1rem 0;
    animation: slideUp var(--transition-slow);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.compare-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compare-bar-items {
    display: flex;
    gap: 1rem;
}

.compare-bar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: var(--radius);
}

.compare-bar-item span {
    font-size: 0.875rem;
    font-weight: 500;
}

.compare-bar-item button {
    color: var(--gray-400);
    transition: color var(--transition);
}

.compare-bar-item button:hover {
    color: var(--error);
}

.compare-bar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.compare-count {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        order: 1;
    }

    .hero-visual {
        order: 0;
        max-width: 500px;
        margin: 0 auto;
    }

    .hero-subtitle {
        margin: 0 auto 2rem;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

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

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

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

    .compare-slots .compare-slot:last-child {
        grid-column: span 2;
        max-width: 50%;
        margin: 0 auto;
    }

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

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

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1.5rem;
        border-bottom: 1px solid var(--gray-200);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

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

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .floating-badge {
        display: none;
    }

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

    .quiz-container {
        padding: 2rem 1.5rem;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

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

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-select {
        width: 100%;
    }

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

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

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

    .compare-slots .compare-slot:last-child {
        grid-column: span 1;
        max-width: 100%;
    }

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

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .compare-bar-content {
        flex-direction: column;
        gap: 1rem;
    }

    .compare-bar-items {
        flex-wrap: wrap;
        justify-content: center;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

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

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

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

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

    .product-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .product-cta {
        width: 100%;
    }

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

/* ========================================
   Utility Classes
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.no-results h3 {
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}
