/* Global CSS Variables */
:root {
    --color-primary: #6B705C;
    --color-secondary: #A5A58D;
    --color-accent: #DDBEA9;
    --color-background: #FAF9F6;
    --color-text: #2F3E46;

    --font-primary: 'Playfair Display', serif;
    --font-secondary: 'Lato', sans-serif;

    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease;
}

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

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

body {
    font-family: var(--font-secondary);
    color: var(--color-text);
    background-color: var(--color-background);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh; /* Ensure minimum height for short content pages */
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto; /* Ensure footer stays at bottom */
}

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

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

a:hover {
    color: var(--color-accent);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    margin-bottom: var(--space-md);
    line-height: 1.3;
    color: var(--color-text);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

p {
    margin-bottom: var(--space-md);
}

ul, ol {
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
}

button, .button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-family: var(--font-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    display: inline-block; /* Ensure proper behavior for links styled as buttons */
    text-align: center;
}

button:hover, .button:hover {
    background-color: var(--color-accent);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md) 0;
}

/* Header Styles */
.site-header {
    background-color: var(--color-background);
    box-shadow: var(--shadow-sm);
    padding: var(--space-md) 0;
    position: relative;
    z-index: 100; /* Ensure header is above other elements */
}

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

.brand-title {
    font-family: var(--font-primary);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-left: var(--space-lg);
}

.nav-link {
    position: relative;
    font-weight: 500;
    color: var(--color-text);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: width var(--transition-fast);
}

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

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text);
    cursor: pointer;
    padding: var(--space-sm);
}

.close-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text);
    cursor: pointer;
    padding: var(--space-sm);
}

/* Hero Section */
.hero {
    padding: var(--space-xl) 0;
    background-color: var(--color-secondary);
    color: white;
    text-align: center;
}

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

.hero-title {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    color: white;
}

.hero-text {
    font-size: 1.2rem;
    margin-bottom: var(--space-lg);
    color: white;
}

/* Section Styles */
.section {
    padding: var(--space-xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-subtitle {
    text-align: center;
    color: var(--color-text);
    margin-bottom: var(--space-lg);
    font-size: 1.2rem;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.feature-item {
    background-color: white;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--color-accent);
    margin-bottom: var(--space-md);
}

.feature-title {
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.feature-item p {
    color: var(--color-text);
}

/* Collection Grid */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.product-card {
    background-color: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    height: 100%; /* Ensure consistent height */
    display: flex;
    flex-direction: column;
}

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

.product-image {
    height: 250px;
    background-color: var(--color-secondary);
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-medium);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background-color: var(--color-accent);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    z-index: 2;
}

.wellness-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background-color: var(--color-accent);
    color: var(--color-text);
    padding: var(--space-sm) var(--space-md);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
}

.product-details {
    padding: var(--space-md);
    flex-grow: 1; /* Make details section fill available space */
    display: flex;
    flex-direction: column;
}

.product-title {
    margin-bottom: var(--space-sm);
    font-size: 1.3rem;
    color: var(--color-text);
}

.product-description {
    color: var(--color-text);
    margin-bottom: var(--space-md);
    flex-grow: 1; /* Push product price to bottom */
}

.product-price {
    font-weight: bold;
    color: var(--color-primary);
    font-size: 1.2rem;
    margin-top: auto; /* Push to bottom of container */
    margin-bottom: var(--space-md);
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.form-checkbox {
    margin-right: var(--space-sm);
    margin-top: 4px;
}

/* Error message styles */
.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: var(--space-sm);
    display: block;
}

.form-input.error, .form-textarea.error {
    border-color: #e74c3c;
}

/* Contact grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--space-lg);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background-color: var(--color-accent);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: var(--space-md);
    flex-shrink: 0;
}

.contact-icon i {
    font-size: 1.5rem;
    color: white;
}

.contact-details {
    flex: 1;
}

.contact-details h3 {
    margin-bottom: var(--space-sm);
}

/* Map Container */
.map-container {
    height: 400px;
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Footer */
.site-footer {
    background-color: var(--color-primary);
    color: white;
    padding: var(--space-xl) 0;
    margin-top: auto; /* Push footer to bottom for short pages */
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    margin-bottom: var(--space-lg);
    padding-right: var(--space-md);
}

.footer-title {
    color: white;
    margin-bottom: var(--space-md);
    font-size: 1.2rem;
}

.footer-nav-list {
    list-style: none;
    padding: 0;
}

.footer-nav-item {
    margin-bottom: var(--space-sm);
}

.footer-nav-link {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-fast);
}

.footer-nav-link:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Privacy Policy Popup */
.policy-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--color-background);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: var(--space-lg);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform var(--transition-medium);
}

.policy-popup.active {
    transform: translateY(0);
}

.policy-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.policy-text {
    flex: 1;
    min-width: 200px;
    margin: 0;
}

/* Thank You Page */
.thank-you {
    text-align: center;
    padding: var(--space-xl) 0;
}

.thank-you-icon {
    font-size: 5rem;
    color: var(--color-accent);
    margin-bottom: var(--space-lg);
}

.thank-you-title {
    margin-bottom: var(--space-md);
}

/* 404 Page */
.error-page {
    text-align: center;
    padding: var(--space-xl) 0;
}

.error-code {
    font-size: 8rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: var(--space-md);
}

.error-title {
    margin-bottom: var(--space-md);
}

/* Filter buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.filter-button {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-primary);
    margin: 0 var(--space-sm) var(--space-sm) 0;
    transition: all var(--transition-fast);
}

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

/* Legal Content Styling */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h2 {
    margin-top: var(--space-xl);
}

.legal-content h3 {
    margin-top: var(--space-lg);
}

.legal-content ul, .legal-content ol {
    margin-bottom: var(--space-lg);
}

.legal-content li {
    margin-bottom: var(--space-sm);
}

.legal-toc {
    background-color: var(--color-background);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    border-left: 4px solid var(--color-primary);
}

.legal-toc ul {
    list-style-type: none;
    padding-left: 0;
}

.legal-toc li {
    margin-bottom: var(--space-sm);
}

.legal-toc a {
    text-decoration: none;
    color: var(--color-primary);
}

.legal-toc a:hover {
    text-decoration: underline;
}

/* Cookie table */
.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-lg);
}

.cookie-table th, .cookie-table td {
    padding: var(--space-md);
    border: 1px solid #ddd;
}

.cookie-table th {
    background-color: var(--color-secondary);
    color: white;
    text-align: left;
}

.cookie-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Process steps */
.process-steps {
    counter-reset: step-counter;
    list-style-type: none;
    padding-left: 0;
}

.process-steps li {
    position: relative;
    padding-left: 50px;
    margin-bottom: var(--space-lg);
}

.process-steps li:before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    left: 0;
    top: 0;
    width: 35px;
    height: 35px;
    background-color: var(--color-primary);
    border-radius: 50%;
    color: white;
    text-align: center;
    line-height: 35px;
    font-weight: bold;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: var(--space-xl) auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--color-accent);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: white;
    border: 4px solid var(--color-primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-left {
    left: 0;
}

.timeline-right {
    left: 50%;
}

.timeline-left::after {
    right: -10px;
}

.timeline-right::after {
    left: -10px;
}

.timeline-content {
    padding: var(--space-md);
    background-color: white;
    position: relative;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.timeline-year {
    position: absolute;
    top: 0;
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--color-text);
}

.timeline-left .timeline-year {
    right: 20px;
}

.timeline-right .timeline-year {
    left: 20px;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.team-member {
    text-align: center;
    background-color: white;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.team-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: var(--space-md);
    border: 4px solid var(--color-accent);
}

.team-social {
    margin-top: var(--space-md);
}

.team-social a {
    display: inline-block;
    margin: 0 var(--space-sm);
    color: var(--color-text);
    transition: color var(--transition-fast);
}

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

/* Values Grid */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.value-item {
    text-align: center;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    background-color: white;
    box-shadow: var(--shadow-sm);
}

.value-icon {
    width: 80px;
    height: 80px;
    line-height: 80px;
    text-align: center;
    background-color: var(--color-accent);
    color: white;
    font-size: 2rem;
    border-radius: 50%;
    margin: 0 auto var(--space-md);
}

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

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .feature-grid,
    .team-grid,
    .values-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

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

    .nav-list {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background-color: var(--color-background);
        flex-direction: column;
        padding: var(--space-xl) var(--space-lg);
        transition: right var(--transition-medium);
        z-index: 1000;
        box-shadow: var(--shadow-lg);
        overflow-y: auto; /* Enable scrolling for long menus */
    }

    .nav-list.active {
        right: 0;
    }

    .nav-item {
        margin: var(--space-md) 0;
        margin-left: 0; /* Reset the left margin */
    }

    .close-menu {
        display: block;
        position: absolute;
        top: var(--space-md);
        right: var(--space-md);
        z-index: 1001; /* Ensure it's above other elements */
    }

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

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

    /* Timeline responsive adjustments */
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 80px;
        padding-right: 0;
    }

    .timeline-item::after {
        left: 21px;
    }

    .timeline-left::after,
    .timeline-right::after {
        left: 21px;
    }

    .timeline-right {
        left: 0;
    }

    .timeline-left .timeline-year,
    .timeline-right .timeline-year {
        left: 80px;
        right: auto;
    }

    .footer-section {
        min-width: 100%; /* Full width on mobile */
    }

    .policy-content {
        flex-direction: column;
    }

    .policy-text {
        margin-bottom: var(--space-md);
    }

    /* Table responsive */
    .cookie-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        width: 95%;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .section {
        padding: var(--space-lg) 0;
    }

    .feature-item,
    .product-card,
    .team-member,
    .value-item {
        padding: var(--space-md);
    }

    .brand-title {
        font-size: 1.4rem; /* Smaller brand title on very small screens */
    }

    .product-image {
        height: 200px; /* Smaller product images on mobile */
    }

    .team-photo {
        width: 150px;
        height: 150px;
    }

    .process-steps li {
        padding-left: 40px;
    }

    .process-steps li:before {
        width: 30px;
        height: 30px;
        line-height: 30px;
    }

    .error-code {
        font-size: 5rem;
    }
}