/* ============================================================
   CSS FINAL V3 — IVERMECTINE / FENBENDAZOLE CURE LAB
   PC ≥ 993px · Tablette 641-992px · Mobile ≤ 640px
   Panier mobile : bottom sheet (panneau du bas)
   ============================================================ */

/* ============ RESET & BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; } /* anti-débordement horizontal */
body { font-family: 'Segoe UI', Arial, sans-serif; color: #1a1a2e; line-height: 1.6; background: #f8fafc; }
img { max-width: 100%; height: auto; display: block; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.section { padding: 70px 0; }
.section-alt { background: #eef6f0; }
.section-title { font-size: 2rem; color: #0b6e4f; text-align: center; margin-bottom: 10px; }
.section-subtitle { text-align: center; color: #555; margin-bottom: 40px; }

/* ancres : pas cachées sous le header sticky */
section[id] { scroll-margin-top: 90px; }

/* ============ HEADER ============ */
.header { position: sticky; top: 0; z-index: 1000; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 15px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid #0b6e4f; }
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 1.45rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase;
  background: linear-gradient(90deg, #0b6e4f, #17a56e); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo-slogan { font-size: .8rem; font-style: italic; color: #666; }
.nav ul { list-style: none; display: flex; gap: 25px; }
.nav a { text-decoration: none; color: #1a1a2e; font-weight: 600; padding: 8px 4px; position: relative; transition: color .3s; }
.nav a::after { content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 3px; background: #0b6e4f; transition: width .3s; }
.nav a:hover, .nav a.active { color: #0b6e4f; }
.nav a:hover::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.lang-select { padding: 8px 10px; border: 1.5px solid #0b6e4f; border-radius: 8px; background: #fff; font-size: .9rem; cursor: pointer; }
.cart-btn { position: relative; background: #0b6e4f; color: #fff; border: none; border-radius: 50%; width: 44px; height: 44px; font-size: 1.2rem; cursor: pointer; transition: background .3s; }
.cart-btn:hover { background: #17a56e; }
.cart-badge { position: absolute; top: -6px; right: -6px; background: #e63946; color: #fff; font-size: .75rem; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.menu-toggle { display: none; background: none; border: none; font-size: 2rem; cursor: pointer; color: #0b6e4f; line-height: 1; }

/* ============ HERO VIDÉO ============ */
.hero { position: relative; height: 85vh; min-height: 480px; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.hero-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: rgba(0, 40, 25, .62); }
.hero-content { position: relative; z-index: 2; color: #fff; max-width: 820px; padding: 20px; }
.hero-badge { display: inline-block; background: rgba(23, 165, 110, .85); padding: 8px 18px; border-radius: 30px; font-weight: 600; margin-bottom: 18px; }
.hero-content h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.15; margin-bottom: 14px; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.hero-content p { font-size: clamp(.95rem, 2vw, 1.15rem); margin-bottom: 25px; }

/* ============ BOUTONS ============ */
.btn { display: inline-block; background: #0b6e4f; color: #fff; padding: 12px 30px; border-radius: 30px; text-decoration: none;
  font-weight: 700; border: none; cursor: pointer; transition: background .3s, transform .2s; font-size: 1rem; text-align: center; }
.btn:hover { background: #17a56e; transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn:disabled { background: #9aa8a2; cursor: not-allowed; transform: none; }

/* ============ GRILLE PRODUITS : auto-adaptative ============ */
.products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; }
.product-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.08);
  display: flex; flex-direction: column; transition: transform .3s, box-shadow .3s; }
.product-card:hover { transform: translateY(-6px); box-shadow: 0 12px 28px rgba(11,110,79,.22); }
.product-img { position: relative; height: 180px; background: linear-gradient(135deg, #d9f2e5, #a8e6c4);
  display: flex; align-items: center; justify-content: center; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder { font-size: 3.2rem; }
.min-badge { position: absolute; top: 10px; left: 10px; background: #e63946; color: #fff;
  font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.product-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.product-body h3 { font-size: 1.05rem; color: #0b6e4f; margin-bottom: 6px; }
.product-format { font-size: .8rem; color: #888; margin-bottom: 8px; }
.product-desc { font-size: .88rem; color: #555; flex: 1; margin-bottom: 12px; overflow-wrap: break-word; }
.product-price { font-size: 1.35rem; font-weight: 800; color: #1a1a2e; margin-bottom: 12px; }
.price-unit { font-size: .8rem; color: #888; font-weight: 400; }

.qty-selector { display: flex; align-items: center; justify-content: space-between; background: #f0f5f2;
  border-radius: 30px; padding: 5px; margin-bottom: 10px; }
.qty-btn { width: 34px; height: 34px; border: none; border-radius: 50%; background: #fff; color: #0b6e4f;
  font-size: 1.2rem; font-weight: 700; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-input { width: 50px; text-align: center; border: none; background: transparent; font-weight: 700; font-size: 1rem; color: #1a1a2e; }
.qty-input:focus { outline: none; }
.product-error { color: #e63946; font-size: .8rem; font-weight: 600; text-align: center; margin-bottom: 8px; min-height: 16px; }
.add-btn { width: 100%; padding: 11px; border-radius: 30px; }

/* ============ PAIEMENT ============ */
.pay-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; }
.pay-card { background: #fff; border-radius: 16px; padding: 30px; text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,.07); }
.pay-icon { font-size: 2.2rem; display: block; margin-bottom: 10px; }
.pay-card h3 { color: #0b6e4f; margin-bottom: 8px; }
.pay-card p { color: #555; font-size: .92rem; }

/* ============ FOOTER ============ */
.footer { background: #0d1f1a; color: #cfd8d4; padding-top: 60px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; padding-bottom: 40px; }
.footer-col h3 { color: #fff; margin-bottom: 15px; font-size: 1.1rem; }
.footer-col p { margin-bottom: 8px; font-size: .92rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { color: #cfd8d4; text-decoration: none; transition: color .3s; }
.footer-col ul a:hover { color: #17a56e; }
.footer .logo-name { background: linear-gradient(90deg, #fff, #17a56e); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.footer .logo-slogan { color: #9fb8ad; }
.footer-contact-line { color: #17a56e; }
.contact-form { display: flex; flex-direction: column; gap: 10px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 11px 14px; border: 1px solid #3a5a4e; border-radius: 8px;
  background: #16291f; color: #fff; font-family: inherit; font-size: .92rem; outline: none; transition: border-color .3s; }
.contact-form input:focus, .contact-form textarea:focus { border-color: #17a56e; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: #7f9c90; }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-message { padding: 10px; border-radius: 8px; margin-bottom: 12px; font-size: .85rem; text-align: center; }
.form-message.success { background: #143a2a; color: #7ce0a8; }
.form-message.error { background: #3a1414; color: #ff9a9a; }
.footer-bottom { border-top: 1px solid #2a4a3e; text-align: center; padding: 18px 0; font-size: .9rem; }

/* ============ PANIER (DESKTOP / TABLETTE : tiroir droit 400 px) ============ */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: .3s; z-index: 2000; }
.cart-overlay.open { opacity: 1; visibility: visible; }

.cart-drawer { position: fixed; top: 0; right: -420px; width: 400px; max-width: 100vw; height: 100%; background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,.15); z-index: 2001; display: flex; flex-direction: column;
  transition: right .35s ease; overflow-x: hidden; }
.cart-drawer.open { right: 0; }

.cart-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid #eee; }
.cart-header h2 { color: #0b6e4f; }
.cart-close { background: none; border: none; font-size: 2rem; color: #888; cursor: pointer; line-height: 1; }

.cart-items { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px; overflow-x: hidden; }
.cart-empty { text-align: center; color: #888; padding: 40px 10px; }

/* Ligne d'article (desktop) */
.cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f0f0f0; align-items: center; }
.cart-item img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; background: #eef6f0; flex-shrink: 0; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info strong { display: block; font-size: .88rem; color: #1a1a2e; line-height: 1.35; word-break: break-word; }
.cart-item-format { display: block; font-size: .78rem; color: #888; margin-top: 2px; }
.cart-item-price { display: block; font-size: .85rem; font-weight: 700; color: #0b6e4f; margin-top: 4px; }

.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-qty button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #ddd; background: #fff; cursor: pointer; font-weight: 700; font-size: 1rem; }
.cart-item-qty button:disabled { opacity: .35; }
.cart-item-qty-val { font-weight: 700; min-width: 26px; text-align: center; }
.cart-item-remove { background: none; border: none; color: #e63946; font-size: 1.3rem; cursor: pointer; padding: 4px; }

.cart-footer { padding: 20px; border-top: 1px solid #eee; background: #fff; }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; margin-bottom: 8px; }
.cart-pay-note { font-size: .8rem; color: #888; margin-bottom: 12px; text-align: center; }
.btn-clear { width: 100%; background: none; border: 1px solid #e63946; color: #e63946; border-radius: 30px;
  padding: 10px; margin-top: 10px; cursor: pointer; font-weight: 600; transition: .3s; }
.btn-clear:hover { background: #e63946; color: #fff; }

/* ============ TOAST ============ */
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%) translateY(80px); background: #0b6e4f;
  color: #fff; padding: 14px 26px; border-radius: 30px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 3000;
  opacity: 0; transition: .35s; font-weight: 600; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: #e63946; }

/* ═══════════════════════════════════════════════════════════
   SECTION CRÈMES À L'IVERMECTINE (page ivermectine uniquement)
   ═══════════════════════════════════════════════════════════ */
#cremes {
    background: linear-gradient(180deg, #FFFBF5 0%, #FBF4E9 100%);
    padding: 80px 0;
    scroll-margin-top: 80px;
}

#cremes .section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: #4A3728;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

#cremes .section-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #C89B6D, #A9743F);
    margin: 14px auto 0;
}

#cremes .section-subtitle {
    text-align: center;
    color: #8A7360;
    font-size: 1rem;
    max-width: 640px;
    margin: 0 auto 50px;
    line-height: 1.6;
}

#cremes .products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: stretch;
}

#cremes .product-card {
    background: #FFFFFF;
    border: 1px solid #F0E2D0;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 14px rgba(122, 84, 40, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#cremes .product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(122, 84, 40, 0.16);
    border-color: #D9B78C;
}

#cremes .product-img {
    position: relative;
    height: 210px;
    background: #FBF4E9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px;
}

#cremes .product-img img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

#cremes .product-card:hover .product-img img { transform: scale(1.05); }

#cremes .min-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(74, 55, 40, 0.85);
    color: #FFF6EA;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    z-index: 2;
}

#cremes .product-body {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

#cremes .product-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #4A3728;
    margin: 0 0 4px;
    line-height: 1.3;
}

#cremes .product-format {
    font-size: 0.8rem;
    font-weight: 600;
    color: #C89B6D;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 10px;
}

#cremes .product-desc {
    font-size: 0.9rem;
    color: #6B5B4B;
    line-height: 1.6;
    text-align: left;
    margin: 0 0 14px;
    flex: 1;
    min-height: 0;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
    -webkit-hyphens: auto;
}

#cremes .product-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: #A9743F;
    margin-bottom: 14px;
}

#cremes .price-unit {
    font-size: 0.75rem;
    font-weight: 500;
    color: #B39A80;
}

#cremes .qty-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #E4D3BC;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    width: fit-content;
}

#cremes .qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: #FFF6EA;
    color: #4A3728;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

#cremes .qty-btn:hover { background: #C89B6D; color: #FFF; }

#cremes .qty-input {
    width: 48px;
    height: 38px;
    border: none;
    border-left: 1px solid #E4D3BC;
    border-right: 1px solid #E4D3BC;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #4A3728;
    background: #FFFFFF;
    -moz-appearance: textfield;
    appearance: textfield;
}

#cremes .qty-input::-webkit-outer-spin-button,
#cremes .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#cremes .product-error {
    font-size: 0.78rem;
    color: #C0392B;
    min-height: 16px;
    margin: 0 0 8px;
    display: none;
}

#cremes .product-error.show { display: block; }

#cremes .add-btn {
    margin-top: auto;
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #C89B6D, #A9743F);
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

#cremes .add-btn:hover { opacity: 0.9; transform: translateY(-1px); }
#cremes .add-btn:active { transform: translateY(0); }

@media (max-width: 1024px) {
    #cremes .products-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}

@media (max-width: 640px) {
    #cremes .products-grid { grid-template-columns: 1fr; gap: 18px; }
    #cremes .section-title { font-size: 1.6rem; }
    #cremes { padding: 50px 0; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE GLOBAL
   ═══════════════════════════════════════════════════════════ */

/* --- Tablette / petit PC (≤ 992 px) --- */
@media (max-width: 992px) {
    .menu-toggle { display: block; }
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 8px 16px rgba(0,0,0,.12);
        padding: 10px 0;
        z-index: 999;
    }
    .nav.open, .nav.active { display: block; }
    .nav ul { flex-direction: column; gap: 0; }
    .nav li { border-bottom: 1px solid #f0f0f0; }
    .nav a { display: block; padding: 14px 20px; }

    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .section { padding: 55px 0; }
}

/* --- Mobile (≤ 640 px) : 1 colonne partout --- */
@media (max-width: 640px) {
    .container { width: 94%; }
    .section { padding: 40px 0; }
    .section-title { font-size: 1.5rem; }
    .section-subtitle { margin-bottom: 25px; }

    .products-grid,
    .pay-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }

    .hero { height: 70vh; min-height: 420px; }
    .hero-badge { font-size: .8rem; padding: 6px 14px; }
    .hero-content { padding: 16px; }

    .logo-name { font-size: 1rem; letter-spacing: 1px; }
    .logo img { width: 42px; height: 42px; }
    .lang-select { max-width: 90px; font-size: .8rem; padding: 6px 8px; }
    .cart-btn { width: 40px; height: 40px; font-size: 1.1rem; }
    .header-actions { gap: 8px; }

    .product-img { height: 210px; }
    .qty-btn { min-width: 44px; min-height: 44px; }
    .qty-input { min-width: 48px; }
    .add-btn, .btn-block { padding: 14px; }

    .toast { width: calc(100% - 32px); max-width: 340px; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════
   PANIER MOBILE — BOTTOM SHEET (≤ 640 px)
   Le tiroir devient un panneau qui monte depuis le bas.
   Le JS reste identique (classes .open / .active).
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

    .cart-drawer {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100vw;
        height: 88vh;
        height: 88dvh;
        max-height: 88vh;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -8px 30px rgba(0,0,0,.2);
        transform: translateY(105%);           /* caché sous l'écran */
        transition: transform .35s ease;
    }
    .cart-drawer.open { transform: translateY(0); }  /* visible */

    /* poignée de glissement */
    .cart-drawer::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 44px;
        height: 5px;
        border-radius: 3px;
        background: #d5dde0;
        z-index: 2;
    }
    .cart-header { padding: 26px 16px 14px; }
    .cart-items { padding: 8px 16px 12px; }

    /* Article : image + infos sur la 1re ligne, quantité en dessous */
    .cart-item {
        display: grid;
        grid-template-columns: 56px 1fr;
        grid-template-areas:
            "img info"
            "qty qty";
        gap: 4px 12px;
        align-items: start;
        position: relative;
        padding: 12px 34px 12px 0;
    }
    .cart-item img { grid-area: img; width: 56px; height: 56px; }
    .cart-item-info { grid-area: info; min-width: 0; }
    .cart-item-qty { grid-area: qty; margin-top: 6px; }
    .cart-item-qty button { width: 32px; height: 32px; min-width: 32px; }

    /* Bouton supprimer : en haut à droite de chaque ligne */
    .cart-item-remove {
        position: absolute;
        top: 10px;
        right: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
    }

    /* Pied du panier : marge basse sécurisée (iPhone home bar) */
    .cart-footer {
        padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    }
    .cart-total { font-size: 1rem; }
}

/* --- Très petits écrans (≤ 400 px) --- */
@media (max-width: 400px) {
    .logo-slogan { display: none; }
    .logo-name { font-size: .9rem; }
    .cart-drawer { height: 92vh; height: 92dvh; max-height: 92vh; }
}