:root {
  --bg: #f7f7f4;
  --ink: #20221f;
  --muted: #777a72;
  --line: #e4e5de;
  --accent: #2563eb;
  --accent-contrast: #fff;
  --white: #fff;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
.topbar { height: 76px; padding: 0 clamp(20px, 6vw, 88px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { font-size: 25px; letter-spacing: -1.5px; font-weight: 800; }
.brand span { color: #829a28; }
.cart-button { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 10px 15px; cursor: pointer; display: flex; align-items: center; gap: 9px; }
.cart-count { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-size: 12px; font-weight: 700; }

.eyebrow { font-size: 10px; font-weight: 800; letter-spacing: 1.8px; color: var(--muted); margin: 0 0 18px; }





.catalogue { padding: 24px clamp(16px, 5vw, 72px) 70px; min-height: calc(100vh - 76px); background: #fff; }
.section-heading { max-width: 1240px; margin: 0 auto 20px; display: flex; align-items: center; justify-content: space-between; }

h2 { margin: 0; font-size: 30px; letter-spacing: -1px; }
.product-total { color: var(--muted); font-size: 12px; }
.products { max-width: 1240px; margin: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; }
.product-card { min-width: 0; }
.product-image { width: 100%; aspect-ratio: 4 / 4.6; background: #f0f0eb; border-radius: 5px; overflow-x: auto; overflow-y: hidden; position: relative; display: flex; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x; }
.product-image::-webkit-scrollbar { display: none; }
.product-image img { flex: 0 0 100%; width: 100%; scroll-snap-align: start; }
.image-count { position: absolute; z-index: 2; right: 10px; bottom: 10px; background: rgba(32,34,31,.78); color: #fff; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 700; pointer-events: none; }
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.product-card { cursor: pointer; }
.product-card:hover .product-image img { transform: scale(1.015); }

.product-info { padding: 11px 0 0; }
.product-name { font-size: 14px; font-weight: 650; margin: 0 0 12px; }

.product-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.price { font-weight: 750; font-size: 14px; white-space: nowrap; }
.add-button { border: 0; background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 12px; cursor: pointer; font-size: 12px; font-weight: 700; line-height: 1; display: flex; align-items: center; gap: 7px; white-space: nowrap; transition: background .2s, color .2s; }
.add-button:hover { background: var(--accent); color: var(--accent-contrast); }
footer { padding: 18px 20px; display: flex; align-items: center; justify-content: center; text-align: center; }
.saas-footer a, .drawer-saas-promo { color: var(--muted); font-size: 11px; text-decoration: none; }
.saas-footer a:hover, .drawer-saas-promo:hover { text-decoration: underline; color: var(--text); }
.drawer-saas-promo { display: block; text-align: center; margin-top: 9px; font-size: 10px; }
.overlay { position: fixed; inset: 0; background: rgba(20,22,18,.35); z-index: 10; }
.cart-panel { position: fixed; z-index: 11; top: 0; right: 0; height: 100dvh; width: min(440px, 100%); background: var(--bg); padding: 28px; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .25s ease; }
.cart-panel.open { transform: translateX(0); }
.cart-header { display: flex; align-items: start; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.cart-header .eyebrow { margin-bottom: 8px; }
.close-button { background: transparent; border: 1px solid var(--line); border-radius: 50%; width: 36px; height: 36px; font-size: 24px; cursor: pointer; }
.cart-items { overflow-y: auto; flex: 1; padding: 12px 0; }
.empty-cart { color: var(--muted); text-align: center; padding: 45px 0; font-size: 14px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 64px; height: 72px; object-fit: cover; border-radius: 4px; }
.cart-item-name { font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.cart-item-price { color: var(--muted); font-size: 12px; }
.quantity { display: flex; align-items: center; gap: 9px; margin-top: 8px; font-size: 12px; }
.quantity button { width: 23px; height: 23px; border: 1px solid var(--line); background: transparent; border-radius: 50%; cursor: pointer; }
.remove-item { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px; }
.cart-bottom { border-top: 1px solid var(--line); padding-top: 20px; }
.total-line { display: flex; justify-content: space-between; margin-bottom: 18px; font-size: 15px; }
.checkout-button { width: 100%; display: flex; justify-content: space-between; padding: 16px 18px; border: 0; background: var(--accent); color: var(--accent-contrast); font-weight: 750; cursor: pointer; border-radius: 3px; }
.cart-note { font-size: 10px; line-height: 1.5; color: var(--muted); text-align: center; margin: 12px 0 0; }
@media (max-width: 900px) { .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; } .hero { padding-bottom: 75px; } h1 { letter-spacing: -3px; } h1 em { letter-spacing: -2px; } }
@media (max-width: 420px) { .product-description { min-height: 52px; } .catalogue { padding-top: 38px; } .cart-panel { padding: 22px; } }

.header-actions { display: flex; align-items: center; gap: 10px; }
.search-form { width: 0; opacity: 0; overflow: hidden; transition: width .2s ease, opacity .2s ease; }
.search-form.open { width: min(270px, 45vw); opacity: 1; }
.search-form input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; outline: none; }
.icon-button { border: 1px solid var(--line); background: transparent; border-radius: 50%; width: 40px; height: 40px; font-size: 25px; cursor: pointer; }
.product-drawer { position: fixed; z-index: 12; left: 50%; bottom: 0; width: min(680px, 100%); height: min(92dvh, 900px); background: var(--bg); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; transform: translate(-50%, 110%); transition: transform .25s ease; box-shadow: 0 -12px 45px rgba(0,0,0,.12); overflow: hidden; }
.product-drawer.open { transform: translate(-50%, 0); }
.drawer-grab-area { flex: 0 0 auto; padding: 9px 20px 16px; border-bottom: 1px solid var(--line); cursor: grab; touch-action: pan-y; background: var(--bg); }
.drawer-grab { width: 42px; height: 4px; border-radius: 4px; background: #c7c9c0; margin: 0 auto 13px; }
.drawer-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.drawer-titlebar h2 { font-size: 19px; line-height: 1.25; }
.drawer-content { overflow-y: auto; flex: 1; padding: 18px 20px 24px; overscroll-behavior: contain; }
.drawer-gallery { display: flex; overflow-x: auto; gap: 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.drawer-gallery::-webkit-scrollbar { display: none; }
.drawer-gallery img { width: 100%; min-width: 100%; height: min(48vh, 390px); object-fit: cover; border-radius: 7px; scroll-snap-align: start; }
.drawer-price { font-size: 19px; font-weight: 800; margin: 18px 0 12px; }
.drawer-description { font-size: 14px; line-height: 1.7; color: var(--muted); white-space: pre-line; margin: 0; }
.drawer-bottom { flex: 0 0 auto; padding: 13px 20px calc(13px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.drawer-bottom .checkout-button { font-size: 14px; }
body.drawer-open { overflow: hidden; }
@media (max-width: 900px) {
  .products { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .catalogue { padding: 18px 14px 55px; }
  .product-image { aspect-ratio: 1 / 1.05; }
  .product-info { padding-top: 10px; }
  .product-name { margin-bottom: 10px; }
}
@media (min-width: 901px) {
  .product-drawer { height: min(88dvh, 900px); border-radius: 18px 18px 0 0; }
}
@media (max-width: 420px) {
  .topbar { padding: 0 14px; height: 66px; }
  .brand { font-size: 23px; }
  .cart-button { padding: 8px 10px; gap: 6px; font-size: 12px; }
  .icon-button { width: 36px; height: 36px; }
  .header-actions { gap: 6px; }
  .search-form.open { width: min(185px, 45vw); }
}


/* Corrections ciblées : chargement progressif des images et recherche plein écran */
.image-slide { position: relative; flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; background: #f0f0eb; overflow: hidden; }
.product-image .image-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-loader { position: absolute; z-index: 1; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 3px solid rgba(32,34,31,.15); border-top-color: #829a28; border-radius: 50%; animation: image-loading .75s linear infinite; }
.image-slide.image-loaded .image-loader { display: none; }
@keyframes image-loading { to { transform: rotate(360deg); } }
.search-form { position: relative; }
.search-form.open { overflow: visible; }
.search-form input { padding-right: 42px; }
.search-close { display: none; position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; }
.search-form.open .search-close { display: block; }
.topbar.search-active { justify-content: stretch; }
.topbar.search-active .brand,
.topbar.search-active #cartButton { display: none; }
.topbar.search-active #searchToggle { display: block; flex: 0 0 40px; }
.topbar.search-active .header-actions { flex: 1; width: 100%; }
.topbar.search-active .search-form,
.topbar.search-active .search-form.open { width: 100%; flex: 1; opacity: 1; }
.topbar.search-active .search-form input { width: 100%; }
.drawer-gallery { display: none !important; }
@media (max-width: 900px) {
  .product-image { touch-action: pan-x pan-y; }
}

/* Galerie : badge fixe dans le cadre, indépendant du défilement horizontal */
.product-image-frame { position: relative; width: 100%; aspect-ratio: 4 / 4.6; overflow: hidden; border-radius: 5px; background: #f0f0eb; }
.product-image-frame .product-image { height: 100%; aspect-ratio: auto; border-radius: 0; }
.product-image-frame .image-count { position: absolute; right: 10px; bottom: 10px; z-index: 3; }
.product-image-frame .product-image-tag { position:absolute; left:10px; top:10px; z-index:3; margin:0; max-width:calc(100% - 72px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; box-shadow:0 1px 4px rgba(0,0,0,.08); }
@media (max-width: 900px) {
  .product-image-frame { aspect-ratio: 1 / 1.05; }
}


/* Chargement progressif du catalogue */
.products-loader { display:flex; align-items:center; justify-content:center; gap:9px; min-height:54px; color:var(--muted); font-size:12px; }
.products-loader[hidden] { display:none; }
.loading-spinner { width:17px; height:17px; border:2px solid var(--line); border-top-color:var(--ink); border-radius:50%; animation:product-spin .7s linear infinite; }
@keyframes product-spin { to { transform:rotate(360deg); } }
.contact-modal-backdrop { position:fixed; inset:0; z-index:30; background:rgba(20,22,18,.52); display:grid; place-items:center; padding:18px; }
.contact-modal { position:relative; width:min(440px,100%); max-height:90dvh; overflow:auto; padding:28px; background:var(--bg); border-radius:12px; box-shadow:0 18px 60px rgba(0,0,0,.2); }
.contact-modal h2 { font-size:25px; line-height:1.15; margin:0 30px 12px 0; }
.contact-modal > p:not(.eyebrow) { color:var(--muted); font-size:13px; line-height:1.6; }
.contact-modal-close { position:absolute; top:18px; right:18px; }
.contact-options { display:flex; align-items:center; justify-content:center; gap:14px; margin:20px 0; }
.contact-option { display:grid; place-items:center; width:54px; height:54px; padding:12px; border:1px solid var(--line); border-radius:10px; background:#fff; transition:transform .15s,border-color .15s; }
.contact-option-messenger { color:#0084FF; background:#EFF6FF; border-color:#B9D9FF; }
.contact-option-whatsapp { color:#25D366; background:#EDFFF4; border-color:#B8F0CD; }
.contact-option-phone { color:#16A34A; background:#F0FDF4; border-color:#BBF7D0; }
.contact-option svg { display:block; width:28px; height:28px; }
.contact-option:hover { border-color:var(--ink); transform:translateY(-2px); }
.contact-empty { color:var(--muted); font-size:12px; line-height:1.5; }


/* Classement du catalogue, tags et prix promotionnels */
.catalogue-controls { max-width:1240px; margin:0 auto 22px; display:flex; flex-direction:column; gap:10px; }
.catalogue-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:36px; }
.filter-toggle[hidden] { display:none !important; }
.filter-toggle { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:36px; padding:8px 12px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:#fff; font:inherit; font-size:13px; font-weight:650; cursor:pointer; }
.filter-toggle svg { width:18px; height:18px; }
.filter-toggle[aria-expanded="true"] { border-color:var(--ink); background:#f1f5f9; }
.catalogue-filter-panel { display:flex; flex-direction:column; gap:8px; }
.catalogue-filter-panel[hidden] { display:none; }
.catalogue-filter-panel.searching .type-chips { display:none; }
.type-chips { display:flex; align-items:center; gap:8px; width:100%; overflow-x:auto; overflow-y:hidden; padding:2px 1px 7px; scrollbar-width:thin; -webkit-overflow-scrolling:touch; }
.type-chip { flex:0 0 auto; border:1px solid var(--line); border-radius:999px; padding:9px 14px; background:#fff; color:var(--ink); font:inherit; font-size:12px; white-space:nowrap; cursor:pointer; }
.type-chip.is-active { border-color:var(--ink); background:var(--ink); color:#fff; }
.visually-hidden { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.catalogue-tools { display:flex; align-items:center; justify-content:flex-end; gap:12px; min-height:32px; }
.sort-icon-control { position:relative; display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:34px; padding:0 10px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:#fff; cursor:pointer; font:inherit; font-size:13px; }
.sort-icon-control svg { width:20px; height:20px; pointer-events:none; }
.sort-icon-control select { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.product-total { color:var(--muted); font-size:12px; white-space:nowrap; }
.product-tag { display:inline-flex; align-items:center; width:max-content; max-width:100%; margin:0 0 7px; padding:5px 8px; border-radius:5px; background:#e8eefc; color:#2347a5; font-size:10px; line-height:1.2; font-weight:750; }
.tag-nouveau { background:#dcfce7 !important; color:#166534 !important; }
.tag-promotion { background:#ffedd5 !important; color:#9a3412 !important; }
.tag-populaire { background:#ede9fe !important; color:#5b21b6 !important; }
.tag-rupture { background:#e5e7eb !important; color:#374151 !important; }
.tag-default { background:#dbeafe !important; color:#1d4ed8 !important; }
.price { display:flex; flex-direction:row; align-items:baseline; gap:6px; white-space:nowrap; }
.price-current { font-weight:800; color:var(--ink); white-space:nowrap; }
.price-old { color:var(--muted); font-size:11px; font-weight:500; text-decoration:line-through; white-space:nowrap; }
.drawer-price { display:flex; flex-direction:row; align-items:baseline; flex-wrap:wrap; gap:8px; }
.drawer-price .price-current { font-size:19px; color:#b42318; }
.drawer-price .price-old { font-size:14px; }
.drawer-tag { display:inline-flex; width:max-content; margin-top:16px; padding:6px 9px; border-radius:5px; background:#dbeafe; color:#1d4ed8; font-size:11px; font-weight:750; }
.drawer-tag[hidden] { display:none; }
@media (max-width:420px) { .catalogue-controls { gap:8px; } .type-chip { padding:8px 12px; } .product-bottom { align-items:flex-start; } .add-button { padding:9px 10px; } }

/* Ajustements ciblés : ordre du compteur/filtre et centrage visuel WhatsApp */
.catalogue-toolbar { justify-content: flex-end; }
.contact-option-whatsapp svg { margin: auto; }
