/* Boutique publique : fond clair, couleur de l'entreprise via --accent-strong */
:root {
    --bg: #f6f6f7;
    --card: #ffffff;
    --text: #18181b;
    --muted: #71717a;
    --line: #e4e4e7;
    --accent: #8b5cf6;
    --accent-strong: #8b5cf6;
    --accent-hover: #7c3aed;
    --on-accent: #ffffff;
    --whatsapp: #25d366;
    --radius: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 15px/1.45 Inter, system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
}
button, a, input, textarea { touch-action: manipulation; font: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.ico {
    width: 20px; height: 20px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- En-tête ---------- */
.shop-header {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
    background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.shop-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.shop-brand h1 { margin: 0; font-size: 18px; line-height: 1.2; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.shop-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
img.shop-logo { padding: 5px; border-color: #d4d4d8; } /* le logo ne touche pas les bords */
.shop-logo-text {
    display: grid; place-items: center; background: var(--accent-strong); color: var(--on-accent);
    font-weight: 700; font-size: 20px; border: 0;
}
.icon-round {
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
    display: grid; place-items: center; color: var(--text); cursor: pointer; flex: none;
}

/* ---------- Recherche + grille ---------- */
.shop-main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.shop-search {
    display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line);
    border-radius: 12px; padding: 0 14px; margin-bottom: 16px; color: var(--muted);
}
.shop-search input { flex: 1; border: 0; outline: 0; padding: 12px 0; font-size: 16px; background: transparent; color: var(--text); }
.shop-search:focus-within { border-color: var(--accent-strong); }

.shop-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.p-card {
    background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer;
    border: 1px solid var(--line); display: flex; flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}
@media (hover: hover) { .p-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.07); } }
.p-card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; display: block; }
.p-card .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.p-card .name { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.p-card .price { font-weight: 700; color: var(--text); }
.p-card .price.ask { color: var(--muted); font-weight: 500; font-size: 13px; }
.add-btn {
    width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
    background: var(--accent-strong); color: var(--on-accent); display: grid; place-items: center;
}
.add-btn:active { transform: scale(.92); }
.in-cart { font-size: 12px; color: var(--accent-strong); font-weight: 600; }
.shop-empty { text-align: center; color: var(--muted); padding: 60px 0; }

.shop-footer { margin: 40px 0 10px; text-align: center; color: var(--muted); font-size: 13px; }
.shop-footer p { margin: 4px 0; }
.shop-footer a { color: inherit; }

/* ---------- Barre panier ---------- */
.cart-bar {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 6;
    width: min(520px, calc(100% - 28px));
    display: flex; align-items: center; gap: 12px; padding: 14px 18px;
    border: 0; border-radius: 16px; cursor: pointer;
    background: var(--accent-strong); color: var(--on-accent); font-weight: 600; font-size: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.cart-bar strong { margin-left: auto; }
.cart-count {
    min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; display: grid; place-items: center;
    background: rgba(255,255,255,.25); font-size: 13px;
}

/* ---------- Feuilles (fiche produit, panier) ---------- */
.sheet {
    width: min(560px, 100%); max-width: 100%; max-height: 92dvh; margin: auto auto 0; padding: 0;
    border: 0; border-radius: 22px 22px 0 0; background: #fff; color: var(--text);
    overflow: auto; overscroll-behavior: contain;
}
dialog:focus { outline: none; }
.sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet[open] { animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
@media (min-width: 700px) {
    .sheet { margin: auto; border-radius: 22px; }
}
.sheet-close {
    position: sticky; top: 12px; float: right; margin: 12px 12px -54px 0; z-index: 2;
    width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(0,0,0,.12); display: grid; place-items: center; color: var(--text);
}
.sheet-title { margin: 20px 20px 8px; font-size: 20px; }

.p-gallery {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #fff;
}
.p-gallery::-webkit-scrollbar { display: none; }
.p-gallery img { flex: 0 0 100%; width: 100%; aspect-ratio: 1; object-fit: contain; scroll-snap-align: center; }
.p-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0 0; min-height: 14px; }
.p-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.p-dots span.on { background: var(--accent-strong); }
.p-body { padding: 8px 20px 0; }
.p-body h2 { margin: 6px 0 4px; font-size: 21px; line-height: 1.25; }
.p-price { margin: 0; font-size: 22px; font-weight: 700; color: var(--accent-strong); }
.p-price.ask { font-size: 16px; color: var(--muted); font-weight: 500; }
.p-ref { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.p-ref:empty { display: none; }
.p-desc { margin: 12px 0 0; line-height: 1.55; color: #3f3f46; }
.p-actions {
    position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); background: #fff; margin-top: 12px;
}
.stepper {
    display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; flex: none;
}
.stepper button {
    width: 44px; height: 48px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--text);
}
.stepper span { min-width: 26px; text-align: center; font-weight: 600; }
.btn-primary, .btn-whatsapp {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 52px; padding: 12px 18px; border: 0; border-radius: 14px; cursor: pointer;
    font-weight: 600; font-size: 16px; text-decoration: none;
}
.btn-primary { background: var(--accent-strong); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; width: 100%; }
.btn-whatsapp:disabled { opacity: .5; }
.link {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px 0 18px;
}
.link .ico { width: 16px; height: 16px; }

/* Panier */
.cart-line { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.cart-line img { width: 58px; height: 58px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.cart-line .l-info { flex: 1; min-width: 0; }
.cart-line .l-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-line .l-price { color: var(--muted); font-size: 13px; }
.cart-line .stepper button { width: 36px; height: 38px; }
.cart-line .stepper .ico { width: 16px; height: 16px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 20px 4px; font-size: 18px; }
#cartNoPrice { padding: 0 20px; margin: 0; }
.order-form { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); }
.order-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.order-form input, .order-form textarea {
    border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 16px; font-weight: 400; resize: none;
}
.order-form input:focus, .order-form textarea:focus { outline: none; border-color: var(--accent-strong); }
.error { color: #dc2626; margin: 0; font-size: 14px; }

/* Confirmation */
.done { text-align: center; padding: 34px 24px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.done h2 { margin: 6px 0 0; font-size: 21px; }
.done p { margin: 0 0 8px; color: #3f3f46; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: #dcfce7; color: #16a34a; display: grid; place-items: center; }
.done-icon .ico { width: 32px; height: 32px; stroke-width: 2.5; }

.toast {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); z-index: 20;
    background: #18181b; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

@media (max-width: 560px) {
    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .shop-main { padding: 12px; }
    .p-card .info { padding: 8px 10px 10px; }
    .p-card .name { font-size: 13px; }
}

/* Mention en bas de page */
.site-credit { margin: 18px 0 0; font-size: 12px; color: var(--muted); }
.site-credit a { color: inherit; font-weight: 600; text-decoration: none; }
.site-credit .credit-heart { width: 13px; height: 13px; color: #ef4444; vertical-align: -2px; margin: 0 1px; }

/* Promotions + catégories */
.promo-banner { width: 100%; display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 14px 16px; border-radius: 14px; border: 0; cursor: pointer;
    background: linear-gradient(135deg, #ef4444, #f97316); color: #fff; font: inherit; font-size: 15px; text-align: left; }
.promo-banner .ico { width: 20px; height: 20px; flex: none; }
.promo-banner span { flex: 1; }
.promo-banner em { font-style: normal; font-weight: 700; background: rgba(255,255,255,.2); padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.promo-banner.active { background: linear-gradient(135deg, #b91c1c, #c2410c); }
.shop-cats { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 14px; scrollbar-width: none; }
.shop-cats::-webkit-scrollbar { display: none; }
.shop-cats:empty { display: none; }
.shop-cats button { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.shop-cats button.on { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.p-img { position: relative; }
.p-discount { position: absolute; top: 8px; left: 8px; background: #ef4444; color: #fff; font-weight: 700; font-size: 12px; padding: 3px 8px; border-radius: 8px; }
.p-discount.inline { position: static; vertical-align: middle; }
.prices { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price.promo { color: #ef4444; }
.prices .old, .p-price .old { color: var(--muted); font-size: 13px; font-weight: 400; }

/* Panier dans l'en-tête (avant le partage) */
.shop-head-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.cart-head { position: relative; }
.cart-head-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
    background: var(--panel-2, #e5e7eb); color: var(--muted); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.cart-head.filled .cart-head-count { background: var(--accent-strong); color: #fff; }

/* Panier en 2 étapes */
.cart-steps { margin: 18px 20px 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.cart-steps strong { color: var(--text); }
.cart-steps + .sheet-title { margin-top: 4px; }
.cart-back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font: inherit; color: var(--accent-strong); cursor: pointer; }
.cart-back .ico { width: 15px; height: 15px; }
.cart-note { padding: 0 20px; margin: 4px 0 0; }
.cart-foot { padding: 16px 20px 20px; }
.cart-foot .btn-primary { width: 100%; }
.cart-foot .btn-primary .ico { width: 18px; height: 18px; }
.cart-foot .btn-primary:disabled { opacity: .5; }
.cart-recap { margin: 0 20px 4px; color: var(--muted); font-size: 14px; }

/* Infos de la boutique */
.info-tagline { margin: -2px 20px 6px; color: var(--muted); font-size: 14px; }
.info-list { list-style: none; margin: 8px 0 0; padding: 0 12px; }
.info-list a, .info-list .info-vat span { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 15px; }
.info-list a:hover { background: var(--panel-2, #f4f4f5); }
.info-list .ico { width: 20px; height: 20px; flex: none; color: var(--accent-strong); }
.info-list .info-vat span { color: var(--muted); font-size: 13px; padding-left: 40px; }
.info-how { margin: 12px 20px 24px; padding: 14px 16px; border-radius: 14px; background: var(--panel-2, #f4f4f5); font-size: 14px; line-height: 1.5; }
.info-how h3 { margin: 0 0 6px; font-size: 15px; }
.info-how ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.info-how p { margin: 0; }
