/* Echo de Chez Moi - Styles */

/* Slideshow transition */
#potager-image {
    transition: opacity 0.5s ease-in-out;
}

:root {
    /* Nouvelle Palette basée sur le Logo */
    --color-primary: #155E35;
    /* Vert foncé du Logo */
    --color-secondary: #FFC107;
    /* Jaune/Or du logo (Remplace le rouge) */
    --color-accent: #F9A825;
    /* Or plus foncé pour le survol */
    --color-danger: #E65100;
    /* Orange foncé pour les alertes/promos (au lieu du rouge) */

    --color-bg: #F9F9F9;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-white: #FFFFFF;
    --font-main: 'Inter', sans-serif;
    --radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header */
header {
    background-color: var(--color-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--color-secondary);
}

.nav-link-image:hover img {
    transform: scale(1.1) rotate(-2deg);
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    /* Removed static background, handled by slideshow */
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    padding: 0 1rem;
    position: relative;
    overflow: hidden;
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Below content */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Dark overlay for text readability */
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    /* Above slides and overlay */
}

/* Slide Items */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Ensure centered */
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
}

/* Mobile: Zoom videos to avoid black bars if baked in or aspect ratio mismatch */
@media (max-width: 768px) {
    video.hero-slide {
        transform: scale(1.3);
        /* Force zoom */
        object-fit: cover !important;
    }

    /* Adjust active state to keep zoom */
    video.hero-slide.active {
        opacity: 1;
        transform: scale(1.3);
    }
}

.hero-slide.active {
    opacity: 1;
}

/* Transitions - Combined with opacity transition above */
/* Note: For videos on mobile, we override these transforms to keep the scale(1.3) or similar */
@media (min-width: 769px) {
    .hero-slide.zoom-in {
        transform: scale(1);
        transition: opacity 1s ease-in-out, transform 6s linear;
    }

    .hero-slide.active.zoom-in {
        transform: scale(1.1);
    }

    .hero-slide.slide-left {
        transform: translateX(5%);
        transition: opacity 1s ease-in-out, transform 6s linear;
    }

    .hero-slide.active.slide-left {
        transform: translateX(0);
    }

    .hero-slide.slide-right {
        transform: translateX(-5%);
        transition: opacity 1s ease-in-out, transform 6s linear;
    }

    .hero-slide.active.slide-right {
        transform: translateX(0);
    }
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    padding: 0.8rem 2rem;
    background-color: var(--color-primary);
    /* Use Green for main buttons now */
    color: var(--color-white);
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
}

/* Sections */
.section {
    padding: 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--color-secondary);
    margin: 0.5rem auto 0;
}

/* Search Bar */
.search-container input:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(34, 139, 34, 0.2) !important;
}

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.category-card {
    background-color: var(--color-white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.category-card:hover,
.category-card.active {
    border-color: var(--color-primary);
    transform: translateY(-5px);
    cursor: pointer;
    background-color: #f0fdf4;
    /* Light green bg on hover */
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Catalog */
.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-primary);
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

/* Ensure 3 per row on large screens for Featured (max 6 items) */
@media (min-width: 1024px) {
    #featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.product-card {
    background-color: var(--color-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    cursor: pointer;
    /* Clickable */
}

.product-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}


.product-image-container {
    position: relative;
    overflow: hidden;
    /* Ensure zoomed image stays in box */
}

.product-image {
    height: 200px;
    width: 100%;
    object-fit: contain;
    background-color: #fff;
    /* White background for borders */
    transition: transform 0.3s ease;
    /* Smooth zoom in/out */
    transform-origin: center center;
}

.product-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    font-size: 0.8rem;
    color: var(--color-secondary);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.product-name {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.product-desc {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.stock-status {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.stock-available {
    background-color: #e6f4ea;
    color: #1e8e3e;
}

.stock-limited {
    background-color: #fef7e0;
    color: #b06000;
}

.stock-order {
    background-color: #e8f0fe;
    color: #1967d2;
}

.order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.order-btn:hover {
    background-color: #1b6e1b;
}

/* Cart Specific Styles */
.cart-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--color-secondary);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 999;
    transition: var(--transition);
}

.cart-fab:hover {
    transform: scale(1.1);
    background-color: var(--color-accent);
}

.cart-icon {
    font-size: 1.8rem;
    color: var(--color-white);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--color-danger);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Modals (Cart & Product) */
.cart-modal,
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    /* Darker overlay for product modal */
    z-index: 2000;
    align-items: center;
    /* Centered */
    justify-content: center;
    padding: 1rem;
}

.cart-modal.active,
.product-modal.active {
    display: flex;
}

.cart-content {
    background-color: white;
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

/* Product Modal Specifics */
.product-modal-content {
    background-color: white;
    width: 95%;
    max-width: 900px;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: fadeInUp 0.3s ease-out;
}

.close-cart,
.close-product-modal {
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    z-index: 10;
}

.close-cart:hover,
.close-product-modal:hover {
    color: #333;
}

.product-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    /* For Zoom */
}

#modal-main-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    /* Don't crop */
    border-radius: var(--radius);
    background-color: #fff;
    transition: transform 0.3s ease;
    transform-origin: center center;
    cursor: zoom-in;
}

.thumbnails-grid {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: var(--transition);
}

.thumbnail:hover,
.thumbnail.active {
    opacity: 1;
    border-color: var(--color-primary);
}

@media (max-width: 768px) {
    .product-modal-body {
        grid-template-columns: 1fr;
    }

    #modal-main-image {
        height: 300px;
    }
}

/* Cart Items & Header (Reused from before but specific to Cart) */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f5f5f5;
}

.cart-item-details h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.cart-item-price {
    font-size: 0.9rem;
    color: #888;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qty-btn {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background-color: #f0f0f0;
}

.remove-btn {
    color: var(--color-danger);
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 0.5rem;
}

.cart-footer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
    background-color: #25D366;
    /* WhatsApp Green */
}

.checkout-btn:hover {
    background-color: #128C7E;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Animation Class */
.animate {
    animation: fadeInUp 0.6s ease-out forwards;
}


/* Footer */
footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 3rem 5% 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h3 {
    color: var(--color-secondary);
    margin-bottom: 1rem;
}

.copyright {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
    color: #888;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Mobile menu to be implemented if needed */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--color-white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .hero-content h1 {
        font-size: 2rem;
    }
}

/* Checkout Page Styles */
.checkout-container {
    padding: 2rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .checkout-summary-column {
        order: -1;
        /* Show summary first on mobile? Or verify preference. Commonly summary is last. Keep default. */
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.checkout-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.checkout-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(21, 94, 53, 0.1);
}

.options-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.option-card {
    border: 1px solid #ddd;
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    cursor: pointer;
    min-width: 150px;
    transition: var(--transition);
}

.option-card:hover {
    border-color: #aaa;
}

.option-card.active {
    border-color: var(--color-primary);
    background-color: #f0fdf4;
    border-width: 2px;
}

.summary-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.checkout-items {
    margin-top: 1.5rem;
}

.checkout-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.checkout-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.checkout-item-info {
    flex-grow: 1;
}