/* ==========================================================================
   DESIGN SYSTEM — LA FERME DE MBAP (VCL THEME)
   Palette : Vert Forêt (#2D6A4F), Terre Dorée (#D4A373), Crème (#F8F4F0)
   Typographie : Playfair Display (Titres) + Inter (Corps & UI)
   Mobile-First · 100% Data-Driven
   ========================================================================== */

:root {
    --color-primary: #2D6A4F;
    --color-primary-dark: #1F4F3A;
    --color-accent: #D4A373;
    --color-accent-hover: #C28F5A;
    --color-bg: #F8F4F0;
    --color-surface: #FFFFFF;
    --color-text: #3D2B1F;
    --color-text-muted: #7A6B5D;
    --color-text-small: #5A4A3A;
    --color-border: #E8E0D8;
    --color-whatsapp: #25D366;
    
    --font-heading: "Playfair Display", Georgia, serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 40px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    padding-bottom: 80px;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }

.text-body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
}
.text-small {
    font-size: 0.9rem;
    color: var(--color-text-small);
}
.text-muted {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }

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

/* ===== HEADER ===== */
.header {
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.header-logo {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.header-logo span {
    font-weight: 400;
    color: var(--color-accent);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-actions .icon-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    color: var(--color-text);
    position: relative;
    text-decoration: none;
}
.header-actions .icon-btn:hover {
    background: #F0EAE4;
}
.cart-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.burger-btn {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    min-height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    padding: 0;
}

.nav-mobile {
    display: none;
    flex-direction: column;
    background: var(--color-surface);
    padding: 16px 18px 24px;
    border-bottom: 2px solid var(--color-border);
    gap: 6px;
    width: 100%;
}
.nav-mobile.open {
    display: flex;
}
.nav-mobile a {
    padding: 12px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    border-bottom: 1px solid #F0EAE4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
}
.nav-mobile a:last-child {
    border-bottom: none;
}
.nav-mobile a .arrow {
    color: var(--color-accent);
    font-size: 0.8rem;
}

.nav-desktop {
    display: none;
    gap: 28px;
    align-items: center;
}
.nav-desktop a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text);
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
    text-decoration: none;
}
.nav-desktop a:hover {
    border-bottom-color: var(--color-accent);
}
.nav-desktop .dropdown {
    position: relative;
    cursor: pointer;
}
.nav-desktop .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px 0;
    min-width: 240px;
    border: 1px solid var(--color-border);
    z-index: 50;
}
.nav-desktop .dropdown:hover .dropdown-menu {
    display: block;
}
.nav-desktop .dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 0.9rem;
    border-bottom: none;
    color: var(--color-text);
}
.nav-desktop .dropdown-menu a:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

@media (min-width: 768px) {
    .burger-btn { display: none; }
    .nav-desktop { display: flex; }
    .nav-mobile { display: none !important; }
}

/* ===== BOUTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    min-height: 56px;
    min-width: 56px;
    touch-action: manipulation;
    text-align: center;
    font-family: var(--font-body);
    text-decoration: none;
}
.btn-primary {
    background: var(--color-primary);
    color: #FFFFFF;
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(45, 106, 79, 0.25);
}
.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}
.btn-secondary:hover {
    background: var(--color-primary);
    color: #FFFFFF;
}
.btn-accent {
    background: var(--color-accent);
    color: #FFFFFF;
}
.btn-accent:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
}
.btn-outline-light {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid rgba(255, 255, 255, 0.6);
}
.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #FFFFFF;
}
.btn-sm {
    padding: 10px 18px;
    font-size: 0.85rem;
    min-height: 44px;
    min-width: 44px;
}

/* ===== HERO ===== */
.hero {
    padding: 40px 0 48px;
    background: linear-gradient(135deg, #2D6A4F 0%, #1F4F3A 100%);
    color: #FFFFFF;
    border-radius: 0 0 40px 40px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(212, 163, 115, 0.08);
    border-radius: 50%;
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}
.hero-content h1 {
    font-size: 2.2rem;
    color: #FFFFFF;
    margin-bottom: 8px;
}
.hero-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 560px;
    margin: 0 auto 24px;
    line-height: 1.6;
}
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

@media (min-width: 768px) {
    .hero-content h1 { font-size: 3rem; }
    .hero-content p { font-size: 1.25rem; }
}

/* ===== SECTIONS ===== */
.section { padding: 32px 0; }
.section-title {
    text-align: center;
    margin-bottom: 24px;
}
.section-title h2 { color: var(--color-primary); }
.section-title p {
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 4px auto 0;
}

/* ===== UNIVERS ===== */
.univers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.univers-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px 18px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform 0.25s, box-shadow 0.25s;
    text-decoration: none;
    color: var(--color-text);
    display: block;
}
.univers-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.univers-card .icon {
    font-size: 2.8rem;
    display: block;
    margin-bottom: 8px;
}
.univers-card h3 {
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 4px;
}
.univers-card p {
    font-size: 0.9rem;
    color: var(--color-text-small);
    margin-bottom: 12px;
}
.univers-card .link {
    font-weight: 600;
    color: var(--color-accent);
    font-size: 0.9rem;
}

/* ===== PRODUITS & CATALOGUE ===== */
.products-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.product-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform 0.25s, box-shadow 0.25s;
    text-decoration: none;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.product-card .image-placeholder, .product-card .product-img-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #E8E0D8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #B0A090;
    overflow: hidden;
}
.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-card .info, .product-card .product-body {
    padding: 14px 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.product-card .info h4, .product-card .product-name {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}
.product-card .info .price, .product-card .product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 4px;
}

.empty-catalog {
    text-align: center;
    padding: 48px 20px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}
.empty-catalog .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}
.empty-catalog h3 {
    font-family: var(--font-body);
    color: var(--color-text);
    font-size: 1.15rem;
    margin-bottom: 6px;
}
.empty-catalog p {
    max-width: 420px;
    margin: 0 auto;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .products-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== FORMATIONS ===== */
.formations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.formation-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.formation-card h4 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--color-primary);
    font-weight: 700;
}
.formation-card p {
    font-size: 0.9rem;
    color: var(--color-text-small);
}

@media (min-width: 768px) {
    .formations-list { flex-direction: row; flex-wrap: wrap; }
    .formation-card { flex: 1; min-width: 250px; }
}

/* ===== PARCOURS ÉLEVEUR ===== */
.parcours {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    border: 1px solid var(--color-border);
}
.parcours-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}
.parcours-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--color-bg);
    border-radius: 12px;
}
.parcours-step .num {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-accent);
    min-width: 32px;
}
.parcours-step .content { flex: 1; }
.parcours-step .content .title {
    font-weight: 600;
    color: var(--color-primary);
}
.parcours-step .content .desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

@media (min-width: 768px) {
    .parcours-steps {
        flex-direction: row;
        justify-content: space-between;
    }
    .parcours-step {
        flex: 1;
        flex-direction: column;
        text-align: center;
        gap: 6px;
        padding: 16px;
    }
    .parcours-step .num { font-size: 1.6rem; }
}

/* ===== CONTACT RAPIDE ===== */
.contact-rapide {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    border: 1px solid var(--color-border);
    text-align: center;
}
.contact-rapide .whatsapp {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-top: 4px;
}
.contact-rapide .whatsapp span { color: var(--color-accent); }

/* ===== FOOTER ===== */
.footer {
    background: var(--color-primary);
    color: rgba(255, 255, 255, 0.8);
    padding: 32px 0 24px;
    margin-top: 16px;
    border-radius: 40px 40px 0 0;
}
.footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}
.footer a:hover { color: #FFFFFF; }
.footer .container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    text-align: center;
}
.footer .footer-brand {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #FFFFFF;
}
.footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    justify-content: center;
    font-size: 0.9rem;
}
.footer .footer-bottom {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
    width: 100%;
}

/* ===== WHATSAPP FLOATING ===== */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--color-whatsapp);
    color: #FFFFFF;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 200;
    text-decoration: none;
    transition: transform 0.2s;
}
.whatsapp-float:hover { transform: scale(1.05); }

@media (max-width: 380px) {
    html { font-size: 16px; }
    h1 { font-size: 1.6rem; }
    .products-grid { grid-template-columns: 1fr; }
    .univers-grid { grid-template-columns: 1fr; }
}

/* ===== PANIER TIROIR (CART OVERLAY & DRAWER) ===== */
.cart-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 300;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.cart-overlay.active {
    display: block;
    opacity: 1;
}
.cart-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: var(--color-surface);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 301;
    display: flex;
    flex-direction: column;
    padding: 24px;
}
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 16px;
}
.cart-header h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-primary);
}
.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color 0.2s;
}
.cart-close:hover {
    color: var(--color-primary);
}
.cart-items-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 0;
}
.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}
.btn-checkout {
    background: var(--color-primary);
    color: #FFFFFF;
    border: none;
    padding: 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 16px;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}
.btn-checkout:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(45, 106, 79, 0.3);
}

/* ===== FICHE PRODUIT (PDP LAYOUT & DETAILS) ===== */
.product-page-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 24px 0 60px 0;
}
@media (max-width: 768px) {
    .product-page-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.main-product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #FFFFFF;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
}
.main-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #FAFAFA;
}
.thumbnails-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}
.thumb-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    background: #fff;
}
.thumb-img.active {
    border-color: var(--color-accent);
}
.product-info-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.variant-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.variant-chip-btn {
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    font-family: var(--font-body);
    transition: all 0.15s ease;
}
.variant-chip-btn:hover {
    border-color: var(--color-accent);
}
.variant-chip-btn.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #FFFFFF;
}
.btn-add-to-cart {
    background: var(--color-primary);
    color: #FFFFFF;
    padding: 16px;
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    font-family: var(--font-body);
    transition: all 0.2s ease;
}
.btn-add-to-cart:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(45, 106, 79, 0.3);
}

/* ===== TUNNEL DE COMMANDE (CHECKOUT PAGE) ===== */
.checkout-container {
    max-width: 640px;
    margin: 24px auto 60px auto;
}
.checkout-box {
    background: #FFFFFF;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.checkout-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--color-primary);
    margin-bottom: 16px;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-body);
    background: #FFFFFF;
    color: var(--color-text);
    outline: none;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--color-accent);
}
.option-card-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.option-card-label.selected {
    border-color: var(--color-primary);
    background-color: rgba(45, 106, 79, 0.04);
}
.option-card-label input {
    margin-top: 3px;
    accent-color: var(--color-primary);
}

