/* ================================
   Cubby House Australia - Styles
   Modern, Clean, Child-Friendly Design
   ================================ */

/* CSS Variables */
:root {
    --primary: #2D9C5E;
    --primary-dark: #237A4A;
    --primary-light: #E8F5EE;
    --secondary: #F59E0B;
    --secondary-dark: #D97706;
    --accent: #6366F1;
    --background: #FAFBFC;
    --surface: #FFFFFF;
    --text: #1F2937;
    --text-light: #6B7280;
    --text-lighter: #9CA3AF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --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);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
    line-height: 1.3;
    font-weight: 700;
}

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

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

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

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

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(45, 156, 94, 0.4);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 156, 94, 0.5);
    color: white;
}

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

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

.btn-amazon {
    background: #FF9900;
    color: #111;
    font-weight: 700;
}

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

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

/* 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-light);
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

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

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

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

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

.nav-links a {
    color: var(--text);
    font-weight: 600;
    padding: 8px 0;
    position: relative;
}

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

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

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

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

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

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

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(45, 156, 94, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 20px;
    color: var(--text);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

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

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

/* Filter Section */
.filter-section {
    padding: 60px 0 30px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
}

.filter-section h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 30px;
}

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

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

.filter-group label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}

.filter-group select {
    padding: 10px 36px 10px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    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 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: var(--transition);
}

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

.view-toggle {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--border-light);
    border-radius: var(--radius-sm);
    margin-left: 20px;
}

.view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn svg {
    fill: var(--text-light);
    transition: var(--transition);
}

.view-btn:hover svg {
    fill: var(--text);
}

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

.view-btn.active svg {
    fill: var(--primary);
}

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

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Product Card */
.product-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

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

.product-image {
    position: relative;
    padding-top: 65%;
    background: linear-gradient(135deg, #E8F5EE 0%, #FEF3C7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    opacity: 0.5;
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    z-index: 1;
}

.badge-popular {
    background: var(--secondary);
    color: #111;
}

.badge-best-value {
    background: var(--primary);
    color: white;
}

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

.product-compare-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1;
}

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

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

.product-compare-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.product-info {
    padding: 20px;
}

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

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.4;
}

.product-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--secondary);
    font-weight: 600;
}

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

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

.feature-tag {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--border-light);
    color: var(--text-light);
    border-radius: 20px;
}

.product-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
}

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

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

.product-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.9rem;
}

/* Products Table */
.products-table-wrapper {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

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

.products-table th {
    background: var(--border-light);
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

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

.products-table tbody tr:hover {
    background: var(--primary-light);
}

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

.product-mini-icon {
    font-size: 1.5rem;
}

.products-table .rating-stars {
    color: var(--secondary);
}

/* Quiz Section */
.quiz-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}

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

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

.quiz-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

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

.quiz-progress {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    margin-bottom: 32px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

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

.quiz-question h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: var(--text);
}

.quiz-question p {
    color: var(--text-light);
    margin-bottom: 24px;
}

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

.quiz-option {
    padding: 16px 20px;
    background: var(--border-light);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
}

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

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

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

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

.quiz-result h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: var(--primary);
}

.quiz-result-product {
    background: var(--primary-light);
    padding: 24px;
    border-radius: var(--radius);
    margin: 24px 0;
}

.quiz-result-product h4 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.quiz-result-product p {
    color: var(--text-light);
    margin-bottom: 16px;
}

.quiz-restart {
    margin-top: 20px;
}

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

.compare-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 8px;
}

.compare-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
}

.compare-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.compare-slot {
    position: relative;
}

.compare-select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    font-family: inherit;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    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 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: var(--transition);
}

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

.compare-clear {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: var(--transition);
}

.compare-clear:hover {
    background: #EF4444;
    color: white;
}

.compare-table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

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

.compare-table th {
    background: var(--border-light);
    font-weight: 700;
}

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

.compare-table tbody tr:hover {
    background: var(--primary-light);
}

.compare-product-header {
    padding: 20px;
    background: white;
}

.compare-product-header h4 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.compare-check {
    color: var(--primary);
    font-size: 1.2rem;
}

.compare-cross {
    color: var(--text-lighter);
    font-size: 1.2rem;
}

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

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

.seo-content h2 {
    font-size: 2rem;
    margin-bottom: 24px;
    color: var(--text);
}

.seo-content h3 {
    font-size: 1.4rem;
    margin: 32px 0 16px;
    color: var(--text);
}

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

.seo-content ul {
    margin: 16px 0 24px 24px;
}

.seo-content li {
    margin-bottom: 12px;
    color: var(--text-light);
    line-height: 1.7;
}

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

/* Footer */
.footer {
    background: var(--text);
    color: var(--text-lighter);
    padding: 60px 0 30px;
}

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

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

.footer-brand .logo-text {
    font-size: 1.3rem;
    color: white;
}

.footer-brand p {
    margin-top: 16px;
    line-height: 1.7;
}

.footer-links h4,
.footer-info h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 20px;
}

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

.footer-links li,
.footer-info li {
    margin-bottom: 12px;
}

.footer-links a,
.footer-info a {
    color: var(--text-lighter);
    transition: var(--transition);
}

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

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

.footer-bottom p {
    margin-bottom: 8px;
}

.affiliate-disclosure {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: white;
    padding: 14px 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--surface);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

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

    .nav-links li {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

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

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

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

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

    .hero-stats {
        gap: 24px;
    }

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

    .filter-group {
        justify-content: space-between;
    }

    .filter-group select {
        flex: 1;
    }

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

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

    .quiz-container {
        padding: 24px;
    }

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

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

    .seo-content h2 {
        font-size: 1.6rem;
    }

    .seo-content h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

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

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

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

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

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

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

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

.quiz-question {
    animation: fadeIn 0.3s ease;
}
