/* Panier de démonstration : l'icône de l'en-tête, le bouton « Ajouter » des produits, le panneau (voir js/cart.js).
   Même langage que le reste du site : noir, jaune, capitales grasses, boutons penchés. */

/* ---------- L'icône dans l'en-tête ---------- */

.cart-button { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); background: rgba(14, 13, 15, 0.5); color: var(--ink); cursor: pointer; transform: skewX(-8deg); transition: border-color 0.2s, color 0.2s; }
.cart-button:hover, .cart-button:focus-visible { border-color: var(--yellow); color: var(--yellow); }
.cart-button svg, .shop-add svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transform: skewX(8deg); }
.cart-count { position: absolute; right: -7px; top: -7px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; background: var(--yellow); color: var(--bg); font-size: 11px; font-weight: 900; font-style: normal; line-height: 1; font-variant-numeric: tabular-nums; }
.cart-count.is-bump { animation: cart-bump 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes cart-bump { 40% { transform: scale(1.5); } }

/* ---------- Le bouton « Ajouter » sous chaque produit ---------- */

/* Sur une même rangée, le prix et le bouton tombent à la même hauteur, même quand un nom tient sur deux lignes :
   chaque produit est une colonne, et le prix est poussé vers le bas. */
.shop li { display: flex; flex-direction: column; }
.shop li .price { margin-top: auto; padding-top: 6px; }
.shop li .shop-add { align-self: flex-start; }
.shop-add { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; transform: skewX(-8deg); transition: background 0.18s, border-color 0.18s, color 0.18s; }
.shop-add span { transform: skewX(8deg); }
.shop-add svg { width: 16px; height: 16px; }
.shop-add:hover, .shop-add:focus-visible { border-color: var(--yellow); color: var(--yellow); }
.shop-add.is-done { background: var(--yellow); border-color: var(--yellow); color: var(--bg); }

/* ---------- Le panneau ---------- */

.cart-scrim { position: fixed; inset: 0; z-index: 32; background: rgba(8, 8, 9, 0.6); opacity: 0; transition: opacity 0.3s; }
/* Le bord gauche du panneau est en biais, comme les boutons du site : le haut est rentré de --slant, le bas ne l'est pas.
   Le panneau est découpé selon ce biais, et un liseré jaune le souligne (dessiné dans le fond, il ne défile pas). */
.cart {
  --slant: 64px;
  position: fixed; inset: 0 0 0 auto; z-index: 33; display: flex; flex-direction: column;
  width: min(calc(480px + var(--slant)), 100%);
  padding: clamp(56px, 9vh, 90px) clamp(20px, 3vw, 36px) 26px calc(var(--slant) + clamp(16px, 2vw, 28px));
  overflow-y: auto;
  /* Le liseré est un trait vectoriel (lissé par le navigateur) : un dégradé à bord dur y faisait des marches d'escalier. */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 100 100'%3E%3Cline x1='0' y1='100' x2='100' y2='0' stroke='%23ffed00' stroke-width='2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") 2px 0 / var(--slant) 100% no-repeat,
    var(--bg);
  clip-path: polygon(var(--slant) 0, 100% 0, 100% 100%, 0 100%);
  transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cart-open .cart { transform: none; }
.cart-open .cart-scrim { opacity: 1; }
.cart .display { font-size: clamp(30px, 3vw, 44px); }

.cart-lines { display: grid; gap: 0; margin: 26px 0 0; padding: 0; list-style: none; }
.cart-lines li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img body sum" "img qty sum"; column-gap: 14px; row-gap: 8px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.cart-lines li:last-child { border-bottom: 1px solid var(--line); }
.cart-lines img { grid-area: img; width: 64px; height: 64px; object-fit: contain; background: radial-gradient(circle at 50% 36%, #4a494e 0%, #2c2b2f 55%, #1c1b1e 100%); }
.cart-lines li > div:first-of-type { grid-area: body; }
.cart-lines b { display: block; font-weight: 900; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.cart-lines span { font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.cart-lines strong { grid-area: sum; align-self: start; font-weight: 900; font-style: italic; font-size: 17px; color: var(--yellow); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-qty { grid-area: qty; display: inline-flex; align-items: center; justify-self: start; border: 1px solid var(--line); }
.cart-qty button { width: 32px; height: 30px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; }
.cart-qty button:hover, .cart-qty button:focus-visible { background: var(--yellow); color: var(--bg); }
.cart-qty output { min-width: 28px; text-align: center; font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums; }

.cart-empty { display: none; margin: 30px 0 0; color: var(--mute); }
.cart.is-empty .cart-empty { display: block; }
.cart.is-empty .cart-lines, .cart.is-empty .cart-foot { display: none; }

.cart-foot { margin-top: auto; padding-top: 26px; }
.cart-ship { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cart-ship button { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); background: none; color: var(--ink); font: inherit; font-size: 11px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; text-align: left; cursor: pointer; transition: border-color 0.2s; }
.cart-ship small { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--mute); }
.cart-ship button:hover, .cart-ship button:focus-visible { border-color: rgba(255, 255, 255, 0.5); }
.cart-ship button.is-on { border-color: var(--yellow); box-shadow: inset 3px 0 0 var(--yellow); }
.cart-sums { display: grid; gap: 8px; margin: 22px 0 0; }
.cart-sums div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.cart-sums dt { color: var(--mute); }
.cart-sums dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-sums .cart-total { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); align-items: baseline; }
.cart-total dt { font-weight: 900; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); }
.cart-total dd { font-weight: 900; font-style: italic; font-size: 28px; color: var(--yellow); }
.cart-pay { width: calc(100% - 12px); margin: 22px 6px 0; text-align: center; } /* marge : le bouton penché ne dépasse pas du panneau */
.cart-note { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--mute); }

@media (max-width: 900px) {
  .cart-button { width: 38px; height: 38px; }
  .cart { --slant: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .cart, .cart-scrim { transition: none; }
  .cart-count.is-bump { animation: none; }
}

/* ---------- Menu pour téléphone et tablette (voir js/mobilemenu.js) ---------- */

/* Le bouton à trois traits : caché sur grand écran, où le menu tient dans l'en-tête. */
.menu-button { display: none; position: relative; z-index: 26; width: 44px; height: 44px; border: 1px solid var(--line); background: rgba(14, 13, 15, 0.5); cursor: pointer; transform: skewX(-8deg); }
.menu-button span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); transition: transform 0.25s, opacity 0.2s, top 0.25s; }
.menu-button span:nth-child(1) { top: 14px; }
.menu-button span:nth-child(2) { top: 21px; }
.menu-button span:nth-child(3) { top: 28px; }
.menu-open .menu-button { border-color: var(--yellow); }
.menu-open .menu-button span { background: var(--yellow); }
.menu-open .menu-button span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-open .menu-button span:nth-child(2) { opacity: 0; }
.menu-open .menu-button span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* Le panneau : plein écran, sous l'en-tête (qui reste visible avec le bouton pour refermer). */
.menu-panel { position: fixed; inset: 0; z-index: 19; display: flex; flex-direction: column; gap: clamp(18px, 3vh, 30px); padding: clamp(120px, 17vh, 150px) var(--gutter) max(28px, env(safe-area-inset-bottom)); overflow-y: auto; background: var(--bg); opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0s 0.3s; }
.menu-open .menu-panel { opacity: 1; visibility: visible; transition: opacity 0.3s; }
.menu-main { display: grid; gap: 2px; }
.menu-main a { padding: 8px 0; font-weight: 900; font-style: italic; font-size: clamp(28px, 7.8vw, 54px); line-height: 1.05; letter-spacing: -0.01em; text-transform: uppercase; text-decoration: none; color: var(--ink); opacity: 0; transform: translateX(-18px); transition: opacity 0.35s, transform 0.35s, color 0.2s; transition-delay: calc(var(--i, 0) * 40ms); }
.menu-open .menu-main a { opacity: 1; transform: none; }
.menu-main a[aria-current="page"], .menu-main a:active { color: var(--yellow); }
.menu-more { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-top: clamp(16px, 3vh, 26px); border-top: 1px solid var(--line); }
.menu-more a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 900; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; color: var(--mute); }
.menu-more a:active { color: var(--yellow); }
.menu-quote { margin-top: auto; align-self: flex-start; }

/* Téléphone, tablette, petit portable : les liens de l'en-tête laissent la place au bouton de menu. */
@media (max-width: 1100px) {
  .has-menu .menu-button { display: block; }
  .has-menu .top-nav, .has-menu .top-links { display: none; }
}
/* Téléphone : le bouton de devis passe dans le menu, l'en-tête garde le logo, le panier et le menu. */
@media (max-width: 600px) {
  .has-menu .top-actions > .btn { display: none; }
  .menu-button { width: 38px; height: 38px; }
  .menu-button span { left: 10px; right: 10px; }
  .menu-button span:nth-child(1) { top: 12px; }
  .menu-button span:nth-child(2) { top: 18px; }
  .menu-button span:nth-child(3) { top: 24px; }
  .menu-open .menu-button span:nth-child(1), .menu-open .menu-button span:nth-child(3) { top: 18px; }
}
html.menu-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .menu-panel, .menu-main a, .menu-button span { transition: none; }
}
