/* ========================================
   LOU GARŪ : panier (refonte du 2026-10-19, maquette validée par Élie)
   Classes lg-pn-* (woocommerce/cart/cart.php, panier rempli). Les anciennes règles
   de lg-cart.css restent pour le panier vide, les suggestions et l'aperçu de coupe.
   ======================================== */

.lg-pn {
  --pn-fonce: #7a6a58;
  --pn-brun: #5f5142;
  --pn-encre: #1f1f1f;
  --pn-gris: #6b6b6b;
  --pn-ligne: #ebe7e2;
  --pn-doux: #f7f4f1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px 16px 24px;
  box-sizing: border-box;
  font-family: var(--font-primary);
  color: var(--pn-encre);
}
.lg-pn *, .lg-pn *::before, .lg-pn *::after { box-sizing: border-box; }

/* ---------- en-tête et bannière promo ---------- */
.lg-pn-entete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lg-pn-titre-page { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; color: var(--pn-encre); }
.lg-pn-compte { font-size: 13px; color: var(--pn-gris); white-space: nowrap; }
.lg-pn-economie {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 12px;
  border-radius: 10px; background: var(--pn-doux); color: var(--pn-brun); font-size: 13.5px; line-height: 1.35;
}
.lg-pn-economie svg { flex-shrink: 0; }
.lg-pn-economie strong, .lg-pn-economie .amount { font-weight: 600; }

/* ---------- lignes d'article ---------- */
.lg-pn-lignes { border-top: 1px solid var(--pn-ligne); }
.lg-pn-ligne { position: relative; display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--pn-ligne); transition: opacity 0.2s; }
.lg-pn-ligne.is-maj { opacity: 0.5; pointer-events: none; }
.lg-pn-visuel { display: block; flex-shrink: 0; width: 84px; height: 108px; border-radius: 8px; overflow: hidden; background: var(--pn-doux); }
.lg-pn-visuel img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lg-pn-infos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lg-pn-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lg-pn-noms { min-width: 0; }
.lg-pn-type { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pn-gris); }
.lg-pn-nom { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--pn-encre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-pn-nom a { color: inherit; text-decoration: none; }
.lg-pn-nom a:hover { color: var(--pn-brun); }
.lg-pn-suppr {
  flex-shrink: 0; width: 40px; height: 40px; margin: -8px -10px 0 0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--pn-gris); transition: background 0.2s, color 0.2s;
}
.lg-pn-suppr:hover, .lg-pn-suppr:focus-visible { color: #a3261b; background: #fbe4e2; }
.lg-pn-details { margin: 0; font-size: 13px; line-height: 1.4; color: var(--pn-gris); }
.lg-pn .lg-pn-apercu {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 2px 0;
  font-size: 13px; font-weight: 500; color: var(--pn-brun); text-decoration: none; white-space: nowrap;
}
.lg-pn .lg-pn-apercu:hover { color: var(--pn-brun); text-decoration: underline; }
.lg-pn-variante { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pn-gris); }
.lg-pn-variante select { min-width: 0; padding: 6px 10px; border: 1px solid #d9d2ca; border-radius: 8px; font-size: 13px; background: #fff; }

.lg-pn-pied { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 4px; }
.lg-pn-qte { display: inline-flex; align-items: center; height: 40px; border: 1px solid #e2dcd5; border-radius: 10px; overflow: hidden; background: #fff; }
.lg-pn-qte button { width: 40px; height: 38px; margin: 0; padding: 0; border: 0; background: transparent; font-size: 18px; line-height: 1; color: var(--pn-brun); cursor: pointer; }
.lg-pn-qte button:hover:not(:disabled) { background: var(--pn-doux); }
.lg-pn-qte button:disabled { color: #c4bdb6; cursor: default; }
.lg-pn .lg-pn-qte-champ {
  width: 30px; height: 38px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
  text-align: center; font: 600 15px var(--font-primary); color: var(--pn-encre);
  -moz-appearance: textfield; appearance: textfield;
}
.lg-pn .lg-pn-qte-champ::-webkit-outer-spin-button,
.lg-pn .lg-pn-qte-champ::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Prix au format B, groupé à droite ; le nom de l'offre est dans la bannière du haut */
.lg-pn-prix { text-align: right; }
.lg-pn-prix .lg-prix { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.lg-pn-prix .lg-prix-actuel, .lg-pn-prix > .amount { font-size: 16px; font-weight: 700; color: var(--pn-encre); white-space: nowrap; }
.lg-pn-prix .lg-prix-promo { display: flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.lg-pn-prix .lg-prix-promo s { color: #6f675f; }
.lg-pn-prix .lg-prix-pct { padding: 1px 7px; border-radius: 999px; background: #ece4dc; color: var(--pn-brun); font-weight: 700; }
.lg-pn-prix .lg-prix-nom { display: none; }

/* ---------- récapitulatif ---------- */
.lg-pn-recap { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.lg-pn-totaux { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 12px; background: var(--pn-doux); font-size: 14px; }
.lg-pn-total-ligne { display: flex; justify-content: space-between; gap: 12px; }
.lg-pn-total-ligne > span:first-child { color: var(--pn-gris); }
.lg-pn-total-remise, .lg-pn-total-remise > span:first-child { color: var(--pn-brun); }
.lg-pn-total-remise > span:last-child { font-weight: 600; }
.lg-pn-total-note { font-size: 13px; color: var(--pn-gris); text-align: right; }
.lg-pn-total-final { align-items: baseline; padding-top: 10px; border-top: 1px solid #e2dcd5; }
.lg-pn-total-final > span:first-child { font-size: 16px; font-weight: 600; color: var(--pn-encre); }
.lg-pn-total-final > span:last-child { font-size: 22px; font-weight: 700; }
.lg-pn-total-tva { margin-top: -6px; text-align: right; font-size: 12px; color: var(--pn-gris); }

.lg-pn-commander, .lg-pn-barre-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; padding: 0 22px;
  border-radius: 10px; background: var(--pn-fonce); color: #fff; font: 600 16px var(--font-primary);
  text-decoration: none; transition: background 0.2s;
}
.lg-pn-commander:hover, .lg-pn-barre-btn:hover, .lg-pn-commander:focus-visible, .lg-pn-barre-btn:focus-visible { background: var(--pn-brun); color: #fff; }
.lg-pn-4x { margin: 0; text-align: center; font-size: 13px; color: var(--pn-brun); }
.lg-pn-4x .amount { font-weight: 600; }
.lg-pn-logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lg-pn-logos img { width: auto; height: 26px; padding: 2px 6px; border: 1px solid var(--pn-ligne); border-radius: 5px; background: #fff; object-fit: contain; }

/* Engagements du site (lg_engagements_html) : style « commande » de css/lg-archive.css,
   identique à la page de commande. Seul l'espace au-dessus est réglé ici. */
.lg-pn .lg-engagements--panier { margin-top: 16px; }

.lg-pn-continuer { align-self: center; padding: 10px 0; font-size: 14px; font-weight: 500; color: var(--pn-brun); }
.lg-pn-continuer:hover { color: var(--pn-encre); }

/* ---------- barre « Commander » collée en bas (mobile) ---------- */
.lg-pn-barre { display: none; }
@media (max-width: 768px) {
  .lg-pn-barre {
    display: flex; align-items: center; gap: 14px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .lg-pn-barre.is-cachee { transform: translateY(100%); opacity: 0; pointer-events: none; }
  .lg-pn-barre-total { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .lg-pn-barre-total strong, .lg-pn-barre-total strong .amount { font-size: 20px; font-weight: 700; line-height: 1.15; color: var(--pn-encre); }
  /* > : la ligne grise seulement, pas le montant (lui aussi dans un <span>) */
  .lg-pn-barre-total > span { font-size: 12px; color: var(--pn-gris); }
  .lg-pn-barre-btn { flex-shrink: 0; height: 52px; }
  /* La barre ne masque jamais le bas de la page */
  body.woocommerce-cart { padding-bottom: 84px; }
  /* Le thème ajoutait 50 px au-dessus du titre, en plus de l'en-tête du site */
  body.woocommerce-cart .site-main { margin-top: 0; }
  body.woocommerce-cart .inside-article { padding-top: 0; }
}

/* ---------- tablette : une colonne centrée ---------- */
@media (min-width: 769px) {
  .lg-pn { max-width: 720px; padding: 32px 24px; }
}

/* ---------- ordinateur : articles à gauche, récapitulatif à droite ---------- */
@media (min-width: 1025px) {
  .lg-pn { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; max-width: 1160px; }
  .lg-pn-recap { position: sticky; top: 110px; margin-top: 52px; }
  .lg-pn-visuel { width: 110px; height: 140px; }
  .lg-pn-ligne { gap: 18px; padding: 18px 0; }
}

/* ---------- suggestions « Vous aimerez aussi » : bandeau horizontal sur mobile ---------- */
@media (max-width: 768px) {
  body.woocommerce-cart .lg-cart-upsells { padding: 22px 0 26px; background: #f7f4f1; }
  body.woocommerce-cart .lg-upsells-title { margin: 0 16px 14px; text-align: left; font-size: 18px; font-weight: 600; }
  body.woocommerce-cart .lg-upsells-grid {
    display: flex; gap: 12px; padding: 0 16px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  }
  body.woocommerce-cart .lg-upsell-card { flex: 0 0 150px; scroll-snap-align: start; border: 0; background: transparent; }
  body.woocommerce-cart .lg-upsell-card:hover { border: 0; box-shadow: none; transform: none; }
  body.woocommerce-cart .lg-upsell-image { border-radius: 8px; touch-action: auto; }
  body.woocommerce-cart .lg-upsell-image .lg-carousel-dots,
  body.woocommerce-cart .lg-upsell-actions { display: none; }
  body.woocommerce-cart .lg-upsell-details { padding: 8px 0 0; gap: 4px; }
  body.woocommerce-cart .lg-upsell-name { margin: 0; font-size: 14px; font-weight: 600; }
  body.woocommerce-cart .lg-upsell-price { font-size: 13px; }
  body.woocommerce-cart .lg-upsell-price .lg-prix-nom { display: none; }
}

/* ---------- « Voir mon aperçu » : calqué sur l'écran « Votre papier peint » du configurateur ---------- */
.lg-pn-ap {
  position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0, 0, 0, 0.55); font-family: var(--font-primary, sans-serif); color: #1f1f1f;
}
.lg-pn-ap[hidden] { display: none; }
.lg-pn-ap-boite {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "scene entete" "scene defile" "scene actions";
  width: min(1100px, 100%); height: min(760px, 100%); background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.lg-pn-ap-entete { grid-area: entete; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 16px 0 22px; }
.lg-pn-ap-entete h2 { margin: 0; font: 600 20px/1.3 var(--font-primary, sans-serif); color: #1f1f1f; }
.lg-pn-ap-entete h2 small { display: block; margin-top: 3px; font: 400 13px/1.4 var(--font-primary, sans-serif); color: #6b6b6b; }
.lg-pn-ap-croix {
  flex-shrink: 0; width: 40px; height: 40px; margin: -6px 0 0; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: #444; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
/* Plus précis que le style des boutons du thème (rond foncé) */
.lg-pn-ap button.lg-pn-ap-croix { background-color: transparent; color: #444; }
.lg-pn-ap button.lg-pn-ap-croix:hover, .lg-pn-ap button.lg-pn-ap-croix:focus-visible { background-color: #f7f4f1; color: #1f1f1f; }
.lg-pn-ap-scene {
  grid-area: scene; position: relative; min-height: 0; margin: 14px; padding: 28px; border-radius: 10px; background: #5f5f5f;
  display: flex; align-items: center; justify-content: center;
}
.lg-pn-ap-scene img {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
}
.lg-pn-ap-scene img:not([src]) { display: none; }
.lg-pn-ap-chargement, .lg-pn-ap-erreur { margin: 0; text-align: center; color: #fff; font: 500 15px/1.5 var(--font-primary, sans-serif); }
.lg-pn-ap-chargement { display: none; }
.lg-pn-ap.is-chargement .lg-pn-ap-chargement { display: block; }
.lg-pn-ap.is-chargement .lg-pn-ap-scene img { visibility: hidden; position: absolute; }
.lg-pn-ap-erreur[hidden] { display: none; }
.lg-pn-ap-defile { grid-area: defile; min-height: 0; overflow-y: auto; padding: 16px 22px 18px; display: flex; flex-direction: column; gap: 16px; }
.lg-pn-ap-defile > * { flex-shrink: 0; }
.lg-pn-ap-resume { margin: 0; border: 1px solid #ebe7e2; border-radius: 12px; }
.lg-pn-ap-resume > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 14px; font-size: 14px; }
.lg-pn-ap-resume > div + div { border-top: 1px solid #ebe7e2; }
.lg-pn-ap-resume > div[hidden] { display: none; }
.lg-pn-ap-resume dt { color: #6b6b6b; font-weight: 400; }
.lg-pn-ap-resume dd { margin: 0; font-weight: 600; text-align: right; color: #1f1f1f; }
.lg-pn-ap-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: #6b6b6b; }
.lg-pn-ap-actions {
  grid-area: actions; display: grid; grid-template-columns: auto 1fr; gap: 10px;
  padding: 14px 22px 18px; border-top: 1px solid #ebe7e2; background: #fff;
}
.lg-pn-ap-actions a, .lg-pn-ap-actions button {
  height: 52px; margin: 0; padding: 0 18px; border: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font: 600 15px var(--font-primary, sans-serif); text-decoration: none; cursor: pointer;
}
.lg-pn-ap-actions a { background: #f7f4f1; color: #444; }
.lg-pn-ap-actions a:hover { background: #efe9e3; color: #444; }
.lg-pn-ap-actions button { background: #a1907d; color: #fff; box-shadow: 0 4px 12px rgba(143, 125, 106, 0.35); }
.lg-pn-ap-actions button:hover { background: #7a6a58; color: #fff; }

/* Téléphone : plein écran, le mur en haut, le récapitulatif dessous */
@media (max-width: 768px) {
  .lg-pn-ap { padding: 0; background: #fff; }
  .lg-pn-ap-boite {
    width: 100%; height: 100%; border-radius: 0; box-shadow: none;
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "entete" "scene" "defile" "actions";
  }
  .lg-pn-ap-entete { padding: 12px 8px 0 16px; }
  .lg-pn-ap-entete h2 { font-size: 18px; }
  .lg-pn-ap-scene { height: 52vh; height: 52dvh; margin: 10px 8px 0; padding: 12px; }
  .lg-pn-ap-defile { padding: 14px 16px; gap: 12px; overscroll-behavior: contain; }
  .lg-pn-ap-actions { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.06); }
  .lg-pn-ap-actions a, .lg-pn-ap-actions button { height: 50px; padding: 0 14px; }
}

/* ---------- Apple Pay / Google Pay sous « Commander » (WooPayments) ----------
   « ou » au-dessus des boutons, réservés d'emblée (voir plus bas). Classe lg-express-vide
   (js/lg-commande.js) : aucun bouton, tout se referme. */
.lg-pn-express { display: flex; flex-direction: column; }
.lg-pn-express .wcpay-express-checkout-wrapper { margin: 0; }
/* Jamais d'overflow: hidden sur #wcpay-express-checkout-element : Stripe y pose d'abord un cadre
   de 8 px (marges négatives) ; masqué, il ne dessine jamais les boutons (constaté le 2026-10-19). */
.lg-pn-express #wcpay-express-checkout-button-separator { display: none !important; }
.lg-pn-express-ou { display: none; order: -1; align-items: center; gap: 12px; margin: 12px 0; font-size: 13px; color: #6b6b6b; }
.lg-pn-express .wcpay-express-checkout-wrapper:not(.lg-express-vide) ~ .lg-pn-express-ou { display: flex; }
/* Emplacement réservé DÈS LE PREMIER AFFICHAGE (en CSS, sans attendre le script) : même
   taille et même arrondi que le bouton, reflet qui passe. Le bouton prend sa place sans
   faire sauter la page. js/lg-commande.js pose ensuite lg-a-des-boutons (bouton arrivé)
   ou lg-express-vide (aucun bouton au bout de 12 s : tout se referme). */
@keyframes lgExpressAttente { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.wcpay-express-checkout-wrapper:not(.lg-a-des-boutons):not(.lg-express-vide) #wcpay-express-checkout-element {
  min-height: 48px; border-radius: 10px; opacity: 1 !important;
  background: linear-gradient(90deg, #efebe6 25%, #f8f5f1 50%, #efebe6 75%); background-size: 200% 100%;
  animation: lgExpressAttente 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .wcpay-express-checkout-wrapper:not(.lg-a-des-boutons):not(.lg-express-vide) #wcpay-express-checkout-element { animation: none; }
}

.lg-pn-express-ou::before, .lg-pn-express-ou::after { content: ''; flex: 1; height: 1px; background: #ebe7e2; }
