/* =====================================================================
   TeraVision Shop — styles des pages internes
   (boutique, fiche produit, 404). Complète main.css.
   ===================================================================== */

/* ------------------------------ Fil d'Ariane ------------------------ */
.crumbs { background: var(--white); border-bottom: 1px solid var(--line); }
.crumbs__in { display: flex; align-items: center; gap: 8px; padding: 12px 0; font-size: 13px; color: var(--muted); overflow-x: auto; scrollbar-width: none; }
.crumbs__in::-webkit-scrollbar { display: none; }
.crumbs a { white-space: nowrap; transition: color .2s; }
.crumbs a:hover { color: var(--green); }
.crumbs span[aria-current] { color: var(--ink); font-weight: 600; white-space: nowrap; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; }
.crumbs__sep { width: 14px; height: 14px; flex: none; opacity: .5; }

/* ------------------------------ En-tête de page --------------------- */
.page-head { background: linear-gradient(150deg, var(--green-soft), var(--cream) 65%); border-bottom: 1px solid var(--line); overflow: hidden; }
.page-head__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 34px 0; }
.page-head__title { font-size: clamp(26px, 4.4vw, 42px); font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.page-head__sub { margin-top: 10px; color: var(--muted); font-size: 14.5px; }
.page-head__art { width: 150px; flex: none; animation: bob 6s ease-in-out infinite; }
@media (max-width: 720px) { .page-head__art { display: none; } .page-head__in { padding: 24px 0; } }

/* ------------------------------ Boutique : mise en page ------------- */
.shop { display: grid; grid-template-columns: 286px 1fr; gap: 30px; align-items: start; }
@media (max-width: 1040px) { .shop { grid-template-columns: 1fr; } }
.shop__main { min-width: 0; }

/* Panneau de filtres */
.filters { position: sticky; top: 168px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 22px; }
.filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.filters__head h2 { display: flex; align-items: center; gap: 9px; font-size: 17px; }
.filters__head h2 .ico { width: 19px; height: 19px; color: var(--green); }
.filters__head .drawer__close { display: none; }

.fgroup { padding: 18px 0; border-bottom: 1px solid var(--line); }
.fgroup:last-of-type { border-bottom: 0; }
.fgroup h3 { font-size: 13.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin-bottom: 12px; }

.fopts { display: grid; gap: 3px; }
.fopts--scroll { max-height: 216px; overflow-y: auto; padding-right: 4px; }
.fopts--scroll::-webkit-scrollbar { width: 5px; }
.fopts--scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }

.fopt { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-xs); cursor: pointer; transition: background .2s; }
.fopt:hover { background: var(--green-soft); }
.fopt input { position: absolute; opacity: 0; width: 0; height: 0; }
.fopt__box { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 2px solid var(--line); display: grid; place-items: center; background: #fff; transition: .22s var(--ease-back); }
.fopt__box--round { border-radius: 50%; }
.fopt__box .ico { width: 13px; height: 13px; color: #fff; opacity: 0; transform: scale(.4); transition: .22s var(--ease-back); }
.fopt input:checked + .fopt__box { background: var(--green); border-color: var(--green); }
.fopt input:checked + .fopt__box .ico { opacity: 1; transform: none; }
.fopt input:checked + .fopt__box--round { box-shadow: inset 0 0 0 4px #fff; }
.fopt input:focus-visible + .fopt__box { outline: 3px solid var(--green-400); outline-offset: 2px; }
.fopt__label { flex: 1; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.fopt__label .stars .star { width: 13px; height: 13px; }
.fopt__n { font-size: 12px; color: var(--muted); background: var(--cream); padding: 1px 8px; border-radius: var(--r-pill); }

.frange { display: flex; align-items: center; gap: 8px; }
.frange label { flex: 1; min-width: 0; }
.frange input { width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--r-sm); font-size: 14px; background: var(--cream); transition: border-color .2s; }
.frange input:focus { border-color: var(--green); background: #fff; outline: none; }
.frange__sep { color: var(--muted); }

.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fchip { font-size: 12px; padding: 6px 11px; border-radius: var(--r-pill); background: var(--cream); color: var(--ink-2); transition: .2s; }
.fchip:hover { background: var(--green); color: #fff; }

.fswitch { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 0; cursor: pointer; font-size: 14px; }
.fswitch input { position: absolute; opacity: 0; width: 0; height: 0; }
.fswitch__track { width: 42px; height: 24px; border-radius: 99px; background: var(--line); flex: none; padding: 3px; transition: background .28s; }
.fswitch__dot { display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .28s var(--ease-back); }
.fswitch input:checked + .fswitch__track { background: var(--green); }
.fswitch input:checked + .fswitch__track .fswitch__dot { transform: translateX(18px); }
.fswitch input:focus-visible + .fswitch__track { outline: 3px solid var(--green-400); outline-offset: 2px; }

.filters__actions { padding-top: 18px; border-top: 1px solid var(--line); }
.filters__promo { margin-top: 18px; padding: 16px; border-radius: var(--r-md); background: linear-gradient(150deg, var(--yellow-soft), #FFF); border: 1px dashed var(--yellow-600); }
.filters__promo p { font-size: 13.5px; margin: 10px 0 8px; }

/* Filtres en tiroir sur mobile */
@media (max-width: 1040px) {
  .filters {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; width: min(90vw, 360px);
    border-radius: 0; overflow-y: auto; transform: translateX(-105%);
    transition: transform .45s var(--ease); box-shadow: var(--sh-3); padding: 0 22px 22px;
  }
  .filters.is-open { transform: none; }
  .filters__head { position: sticky; top: 0; z-index: 2; background: #fff; margin: 0 -22px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
  .filters__head .drawer__close { display: grid; }
}

/* Barre d'outils */
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; background: #fff; border-radius: var(--r-md); box-shadow: var(--sh-1); margin-bottom: 18px; }
.toolbar__count { font-size: 13.5px; color: var(--muted); }
.toolbar__count b { color: var(--ink); font-family: var(--ff-title); }
.toolbar__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.toolbar__filter { display: none; }
@media (max-width: 1040px) { .toolbar__filter { display: inline-flex; } }
@media (max-width: 560px) { .toolbar { gap: 10px; padding: 12px; } .toolbar__count { width: 100%; order: 3; } }

.sortbox { position: relative; display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: var(--r-pill); background: var(--cream); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .25s; }
.sortbox .ico { width: 16px; height: 16px; color: var(--green); }
.sortbox select { border: 0; background: none; font-size: 13.5px; font-weight: 600; cursor: pointer; appearance: none; padding-right: 2px; max-width: 150px; }
.sortbox:hover { background: var(--green-soft); }

.viewtoggle { display: flex; gap: 3px; padding: 3px; background: var(--cream); border-radius: var(--r-pill); }
.viewtoggle button { width: 36px; height: 32px; border-radius: var(--r-pill); display: grid; place-items: center; color: var(--muted); transition: .25s; }
.viewtoggle button .ico { width: 17px; height: 17px; }
.viewtoggle button.is-active { background: var(--green); color: #fff; }
@media (max-width: 700px) { .viewtoggle { display: none; } }

/* Puces de filtres actifs */
.activechips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.activechip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: var(--r-pill); background: var(--green-soft); color: var(--green); font-size: 13px; font-weight: 600; transition: .25s; }
.activechip .ico { width: 14px; height: 14px; }
.activechip:hover { background: var(--green); color: #fff; }
.activechip--reset { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }
.activechip--reset:hover { background: var(--danger); color: #fff; box-shadow: none; }

/* Grille boutique */
.grid-products--shop { grid-template-columns: repeat(3, 1fr); }
/* Deux colonnes jusqu'aux plus petits écrans (voir la compaction dans main.css) */
@media (max-width: 900px) { .grid-products--shop { grid-template-columns: repeat(2, 1fr); } }

/* Vue liste */
.grid-products.is-list { grid-template-columns: 1fr; gap: 14px; }
.grid-products.is-list .card { flex-direction: row; }
.grid-products.is-list .card__media { width: 230px; flex: none; display: grid; place-items: center; }
.grid-products.is-list .card__body { padding: 20px 24px; }
.grid-products.is-list .card__short { -webkit-line-clamp: 3; }
@media (max-width: 700px) { .grid-products.is-list .card { flex-direction: column; } .grid-products.is-list .card__media { width: auto; } }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 42px; flex-wrap: wrap; }
.pager__num, .pager__btn {
  display: inline-flex; align-items: center; gap: 6px; min-width: 42px; height: 42px; padding: 0 14px;
  justify-content: center; border-radius: var(--r-sm); background: #fff; box-shadow: var(--sh-1);
  font-family: var(--ff-title); font-weight: 600; font-size: 14px; transition: .28s var(--ease);
}
.pager__num:hover, .pager__btn:hover { background: var(--green); color: #fff; transform: translateY(-2px); box-shadow: var(--sh-2); }
.pager__num.is-active { background: var(--green); color: #fff; box-shadow: var(--sh-green); }
.pager__btn .ico { width: 16px; height: 16px; }
@media (max-width: 480px) { .pager__btn span { display: none; } .pager__btn { padding: 0; } }

/* État vide */
.empty { text-align: center; padding: 56px 20px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.empty--404 { background: none; box-shadow: none; padding-top: 20px; }
.empty__art { width: 168px; margin: 0 auto 18px; opacity: .9; animation: bob 6s ease-in-out infinite; }
.empty h2 { font-size: 22px; }
.empty p { color: var(--muted); margin-top: 8px; }

/* ------------------------------ Fiche produit ----------------------- */
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: start; }
@media (max-width: 940px) { .pdp { grid-template-columns: minmax(0, 1fr); gap: 26px; } }
.pdp__gallery, .pdp__info { min-width: 0; }
/* Les libellés longs doivent pouvoir passer a la ligne dans un bouton pleine largeur */
.btn--block { white-space: normal; text-align: center; line-height: 1.3; }

.pdp__gallery { position: sticky; top: 168px; }
@media (max-width: 940px) { .pdp__gallery { position: static; } }
.pdp__stage {
  position: relative; border-radius: var(--r-xl); background: linear-gradient(160deg, var(--cream), #EDF3EC);
  display: grid; place-items: center; padding: 40px; overflow: hidden; box-shadow: var(--sh-1);
}
.pdp__stage::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 115%, rgba(10,107,45,.14), transparent 62%); pointer-events: none; }
.pdp__stage .product-art { max-width: 380px; animation: bob 6s ease-in-out infinite; }
.pdp__off { position: absolute; top: 18px; left: 18px; z-index: 2; }
.pdp__eco { position: absolute; top: 18px; right: 18px; z-index: 2; }

.pdp__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.pdp__thumb { border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-1); padding: 8px; transition: .3s var(--ease); }
.pdp__thumb:hover { transform: translateY(-3px); }
.pdp__thumb.is-active { box-shadow: inset 0 0 0 2.5px var(--green), var(--sh-1); }

.pdp__cat { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green); background: var(--green-soft); padding: 5px 12px; border-radius: var(--r-pill); transition: .25s; }
.pdp__cat:hover { background: var(--green); color: #fff; }
.pdp__title { font-size: clamp(24px, 3.4vw, 36px); font-weight: 800; letter-spacing: -.02em; margin: 14px 0 12px; }

.pdp__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pdp__rate { display: inline-flex; align-items: center; gap: 7px; }
.pdp__rate b { color: var(--ink); font-family: var(--ff-title); }
.pdp__rate a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.pdp__sep { width: 1px; height: 14px; background: var(--line); }
.pdp__short { margin-top: 16px; font-size: 16px; color: var(--ink-2); }

.pdp__pricebox { margin: 22px 0; padding: 20px; border-radius: var(--r-lg); background: var(--green-soft); border: 1px solid #D6E8DC; }
.pdp__price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pdp__price b { font-family: var(--ff-title); font-size: clamp(28px, 4vw, 36px); font-weight: 800; color: var(--green); }
.pdp__price s { color: var(--muted); font-size: 17px; }
.pdp__save { font-size: 12.5px; font-weight: 700; font-family: var(--ff-title); color: #fff; background: var(--danger); padding: 4px 11px; border-radius: var(--r-pill); }
.pdp__unit { font-size: 12.8px; color: var(--muted); margin-top: 7px; }

.pdp__benefits { display: grid; gap: 9px; margin-bottom: 20px; }
.pdp__benefits li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.pdp__benefits .ico { width: 18px; height: 18px; flex: none; color: var(--green); margin-top: 3px; }

.pdp__stock { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.pdp__stock.is-low { color: var(--danger); font-weight: 700; }
.pdp__stock .bar { flex: 1; max-width: 200px; }

.pdp__buy { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pdp__add { flex: 1; min-width: 200px; white-space: normal; line-height: 1.3; }

/* Petit écran : quantité et favori sur une ligne, ajout au panier en pleine
   largeur en dessous — sinon le libellé du bouton est rogné. */
@media (max-width: 520px) {
  .pdp__buy { gap: 10px; }
  .pdp__add { order: 3; flex: 1 0 100%; min-width: 0; padding: 16px 20px; font-size: 15.5px; }
  .tool--lg { margin-left: auto; }
}
.qty--lg { padding: 5px; box-shadow: inset 0 0 0 2px var(--line); background: #fff; margin-top: 0; }
.qty--lg button { width: 38px; height: 38px; }
.qty--lg .ico { width: 16px; height: 16px; }
.qty--lg b { min-width: 34px; font-size: 16px; }
.tool--lg { position: relative; width: 52px; height: 52px; box-shadow: inset 0 0 0 2px var(--line); opacity: 1; transform: none; }
.tool--lg .ico { width: 22px; height: 22px; }

.pdp__ship { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
@media (max-width: 520px) { .pdp__ship { grid-template-columns: 1fr; } }
.pdp__ship li { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border-radius: var(--r-md); background: #fff; box-shadow: var(--sh-1); font-size: 12.8px; color: var(--muted); }
.pdp__ship i { width: 34px; height: 34px; flex: none; border-radius: 11px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.pdp__ship .ico { width: 18px; height: 18px; }
.pdp__ship b { color: var(--ink); font-family: var(--ff-title); font-size: 13.5px; }

/* Onglets détaillés */
.pdp__tabs { margin-top: 60px; }
.pdp__tabs .tabs { margin-bottom: 26px; }
.prose { max-width: 760px; font-size: 15.5px; color: var(--ink-2); }
.prose h3 { font-size: 18px; margin: 24px 0 10px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin-bottom: 12px; }
.prose ul { display: grid; gap: 8px; }
.prose ul li { display: flex; gap: 10px; }
.prose ul li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); flex: none; margin-top: 9px; }
.prose__note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--yellow-soft); font-size: 14px; margin-top: 18px; }
.prose__note .ico { width: 18px; height: 18px; flex: none; color: var(--yellow-600); margin-top: 2px; }

.spec { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.spec th, .spec td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.spec th { width: 40%; color: var(--muted); font-weight: 600; }
.spec td { color: var(--ink); font-weight: 600; font-family: var(--ff-title); }
.spec tr:nth-child(odd) { background: var(--cream); }

/* Bloc avis */
.reviews__summary { display: grid; grid-template-columns: 200px 1fr; gap: 30px; align-items: center; padding: 24px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-1); margin-bottom: 24px; }
@media (max-width: 640px) { .reviews__summary { grid-template-columns: 1fr; gap: 18px; text-align: center; } }
.reviews__score b { display: block; font-family: var(--ff-title); font-size: 48px; font-weight: 800; color: var(--green); line-height: 1; }
.reviews__score { text-align: center; }
.reviews__score .stars { margin: 8px 0 4px; justify-content: center; }
.reviews__score > span { display: block; font-size: 12.5px; color: var(--muted); }
.reviews__bars { display: grid; gap: 7px; }
.rbar { display: grid; grid-template-columns: 38px 1fr 44px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.rbar .bar i { background: linear-gradient(90deg, var(--yellow), var(--yellow-600)); }
.reviews__list { display: grid; gap: 14px; }
.review--flat { box-shadow: var(--sh-1); padding: 20px 22px; }
.review--flat .review__who { margin-bottom: 10px; }
.review__verified { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--green); background: var(--green-soft); padding: 4px 10px; border-radius: var(--r-pill); }
.review__verified .ico { width: 13px; height: 13px; }
@media (max-width: 520px) { .review__verified { display: none; } }

/* Barre d'achat mobile */
.buybar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 84; display: none;
  align-items: center; gap: 12px; padding: 12px 16px; background: #fff;
  box-shadow: 0 -6px 26px rgba(16, 35, 26, .14);
  transform: translateY(140%); transition: transform .4s var(--ease);
}
.buybar.is-show { transform: none; }
@media (max-width: 940px) { .buybar { display: flex; } }
.buybar__price { display: flex; flex-direction: column; line-height: 1.2; }
.buybar__price b { font-family: var(--ff-title); font-size: 18px; font-weight: 800; color: var(--ink); }
.buybar__price s { font-size: 12px; color: var(--muted); }
.buybar__add { flex: 1; }

/* ------------------------------ Champs de formulaire ---------------- */
/* Partages par le tunnel de commande, le contact et le suivi de commande. */
/* Champs */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .fields { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field__l { font-family: var(--ff-title); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field__l i { color: var(--danger); font-style: normal; }
.field__opt { color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border: 2px solid var(--line); border-radius: var(--r-sm);
  font-size: 15px; background: var(--cream); transition: border-color .2s, background .2s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); background: #fff; outline: none; }
.field__hint { font-size: 12.2px; color: var(--muted); }
.field__err { font-size: 12.4px; color: var(--danger); font-weight: 600; min-height: 0; }
.field.has-error input, .field.has-error select { border-color: var(--danger); background: #FFF5F4; }

/* ------------------------------ Message après envoi -----------------
   Nommé « notice » et non « flash » : la page d'accueil a une section
   « ventes flash », et .flash__in { display: flex } écrasait ici le
   display: grid de la section — la grille se repliait en une ligne et
   le carrousel se retrouvait écrasé à quelques pixels sur mobile. */
.notice { border-bottom: 1px solid transparent; animation: fadeUp .4s var(--ease) both; }
.notice--success { background: var(--green-soft); border-bottom-color: #CBE4D5; }
.notice--error   { background: #FFF1F0; border-bottom-color: #F6D4D1; }
.notice__in { display: flex; align-items: center; gap: 11px; padding: 14px 0; font-size: 14.5px; }
.notice--success .notice__in { color: #0A5C29; }
.notice--error .notice__in { color: #9B2018; }
.notice__in > .ico { width: 20px; height: 20px; flex: none; }
.notice__in span { flex: 1; }
.notice__close { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; opacity: .6; transition: .25s; }
.notice__close:hover { opacity: 1; background: rgba(0, 0, 0, .07); }
.notice__close .ico { width: 16px; height: 16px; }

/* ------------------------------ Champ telephone --------------------- */
/* intl-tel-input remplace l input par un conteneur : il doit occuper
   toute la largeur de la cellule de formulaire. */
.iti { width: 100%; display: block; }
.field--tel .iti input[type=tel] { width: 100%; }
.iti__country-list { z-index: 120; font-family: var(--ff-body); font-size: 14px; }
.iti--separate-dial-code .iti__selected-flag { background: transparent; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.iti--separate-dial-code .iti__selected-dial-code { font-family: var(--ff-title); font-weight: 600; font-size: 14px; }
.field--tel .iti__selected-flag:focus-visible { outline: 3px solid var(--green-400); outline-offset: -2px; }
.iti__country.iti__highlight { background: var(--green-soft); }
.iti__divider { border-bottom-color: var(--line); }
