/* ============================================
   Coffee Beans AU - Styles
   Modern, responsive design for Australian market
   ============================================ */

/* CSS Variables */
:root {
    --color-primary: #6B4423;
    --color-primary-dark: #4A2F18;
    --color-primary-light: #8B6342;
    --color-secondary: #D4A574;
    --color-accent: #C9A66B;
    --color-background: #FDF8F3;
    --color-surface: #FFFFFF;
    --color-text: #2D2D2D;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-border: #E8E0D8;
    --color-success: #4CAF50;
    --color-warning: #FF9800;
    --color-error: #F44336;

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --transition: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
}

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

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

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

.section-subtitle {
    color: var(--color-text-light);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

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

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

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

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

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

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Header */
.header {
    background-color: var(--color-surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

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

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background-color: var(--color-primary);
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

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

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

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero h1 {
    color: white;
    margin-bottom: 20px;
    font-size: 3.5rem;
}

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

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

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

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 10px 20px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
}

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

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

/* Product Card */
.product-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition);
    text-align: left;
}

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

.product-image {
    width: 100%;
    height: 200px;
    background-color: var(--color-background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--color-primary-light);
}

.product-content {
    padding: 20px;
}

.product-brand {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text);
}

.product-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

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

.product-description {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 15px;
    line-height: 1.5;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.stars {
    color: #FFB800;
}

.product-price {
    font-weight: 600;
    color: var(--color-primary);
}

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

.product-actions .btn {
    flex: 1;
    padding: 10px;
    font-size: 0.85rem;
}

/* Quiz Section */
.quiz-section {
    padding: 80px 0;
    background-color: var(--color-surface);
    text-align: center;
}

.quiz-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--color-background);
    border-radius: var(--radius-lg);
    padding: 40px;
}

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

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

.progress-fill {
    height: 100%;
    background-color: var(--color-primary);
    transition: width var(--transition);
    width: 20%;
}

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

.quiz-content {
    margin-bottom: 30px;
}

.quiz-question {
    font-size: 1.25rem;
    margin-bottom: 25px;
    color: var(--color-text);
}

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

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

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

.quiz-option.selected {
    border-color: var(--color-primary);
    background-color: rgba(107, 68, 35, 0.05);
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.quiz-navigation .btn {
    min-width: 120px;
}

.quiz-results {
    max-width: 600px;
    margin: 0 auto;
}

.quiz-results h3 {
    font-size: 1.75rem;
    margin-bottom: 25px;
    color: var(--color-primary);
}

.result-product {
    background-color: var(--color-background);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 25px;
}

/* Compare Section */
.compare-section {
    padding: 80px 0;
    text-align: center;
}

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

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

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

.add-compare-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    font-size: 1rem;
    padding: 20px;
    transition: color var(--transition);
}

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

.plus-icon {
    font-size: 2.5rem;
    font-weight: 300;
}

.compare-slot-content {
    padding: 20px;
    text-align: center;
    width: 100%;
}

.compare-slot-content h4 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.remove-compare-btn {
    background: none;
    border: none;
    color: var(--color-error);
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 10px;
}

.remove-compare-btn:hover {
    text-decoration: underline;
}

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

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

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

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

.compare-table th:first-child {
    background-color: var(--color-primary-dark);
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

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

.modal-content h3 {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

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

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

.modal-search {
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
}

.modal-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.modal-products {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
}

.modal-product-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition);
}

.modal-product-item:hover {
    background-color: var(--color-background);
}

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

.modal-product-info h4 {
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.modal-product-info span {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

/* Table Section */
.table-section {
    padding: 80px 0;
    background-color: var(--color-surface);
    text-align: center;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box input {
    padding: 12px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    min-width: 250px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.view-toggle {
    display: flex;
    gap: 5px;
    background-color: var(--color-background);
    padding: 5px;
    border-radius: var(--radius-md);
}

.view-btn {
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-light);
    transition: all var(--transition);
}

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

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

.beans-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

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

.beans-table th {
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.beans-table th:hover {
    background-color: var(--color-primary-dark);
}

.sort-icon {
    margin-left: 5px;
    opacity: 0.6;
}

.beans-table th.sorted .sort-icon {
    opacity: 1;
}

.beans-table tbody tr:hover {
    background-color: var(--color-background);
}

.beans-table td:last-child {
    text-align: center;
}

/* List View */
.list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background-color: var(--color-background);
    border-radius: var(--radius-md);
    text-align: left;
}

.list-item-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
}

.list-item-content {
    flex: 1;
}

.list-item-content h4 {
    margin-bottom: 5px;
}

.list-item-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--color-text-light);
    flex-wrap: wrap;
}

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

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

.seo-section h2 {
    text-align: center;
    margin-bottom: 40px;
}

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

.seo-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--color-primary);
}

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

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

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

.footer-brand .logo-icon,
.footer-brand .logo-text {
    color: white;
}

.footer-brand p {
    margin-top: 15px;
    opacity: 0.8;
}

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

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

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

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

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

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

.affiliate-disclosure {
    margin-top: 10px;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 992px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

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

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

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

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--color-surface);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        box-shadow: var(--shadow-md);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition);
    }

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

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 15px 0;
        border-bottom: 1px solid var(--color-border);
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }

    .hero {
        padding: 60px 0;
    }

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

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

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

    .products-section,
    .quiz-section,
    .compare-section,
    .table-section,
    .seo-section {
        padding: 50px 0;
    }

    .quiz-container {
        padding: 25px;
    }

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

    .search-box input {
        width: 100%;
        min-width: auto;
    }

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

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

    .list-item {
        flex-direction: column;
        text-align: center;
    }

    .list-item-actions {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .beans-table {
        font-size: 0.85rem;
    }

    .beans-table th,
    .beans-table td {
        padding: 10px 8px;
    }
}

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

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

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

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

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}
