/* ==========================================================================
   PRODUCT DETAIL — composant fiche partagé (style MagMarket)
   Source unique : importé/symlinké par la vitrine (comme product-card.css).
   Tokenisé (var avec fallback) → portable et brandé à la couleur du marchand.
   ========================================================================== */

.product-page{max-width:1200px;margin:0 auto;padding:24px 0 56px}
.product-breadcrumb{display:flex;gap:.5rem;align-items:center;font-size:.85rem;color:var(--muted,#6b7280);margin-bottom:1.75rem;flex-wrap:wrap}
.product-breadcrumb a{color:var(--muted,#6b7280);text-decoration:none}
.product-breadcrumb a:hover{color:var(--primary,#193153)}
.product-breadcrumb .sep{color:#c9ccd2}
.product-breadcrumb .cur{color:var(--ink,#1d1d1f)}

.product-layout{display:grid;grid-template-columns:1fr 1fr;gap:3rem;margin-bottom:3rem;align-items:start}
.product-gallery{position:sticky;top:88px}
.product-gallery-main{position:relative;aspect-ratio:4/3;background:#fff;border:1px solid var(--line,#e5e7eb);border-radius:12px;display:flex;align-items:center;justify-content:center;overflow:hidden;cursor:zoom-in}
.product-gallery-main img{width:100%;height:100%;object-fit:contain;padding:1.5rem}
.product-no-image{color:#d1d5db}
.gallery-zoom-btn{position:absolute;bottom:.75rem;right:.75rem;width:38px;height:38px;border:1px solid var(--line,#e5e7eb);border-radius:50%;background:rgba(255,255,255,.92);color:var(--ink,#1d1d1f);display:flex;align-items:center;justify-content:center;cursor:zoom-in;opacity:0;transition:opacity .15s,background .15s,color .15s}
.product-gallery-main:hover .gallery-zoom-btn{opacity:1}
.gallery-zoom-btn:hover{background:var(--primary,#193153);color:#fff;border-color:var(--primary,#193153)}
.product-gallery-thumbs{display:flex;gap:.5rem;margin-top:.75rem;flex-wrap:wrap}
.product-thumb{width:64px;height:64px;object-fit:contain;border:1.5px solid var(--line,#e5e7eb);border-radius:8px;background:#fff;padding:4px;cursor:pointer;transition:border-color .15s}
.product-thumb:hover{border-color:#c9ccd2}
.product-thumb.active{border-color:var(--primary,#193153)}

.product-info{min-width:0}
.product-brand{font-size:.8rem;color:var(--primary,#193153);font-weight:700;text-transform:uppercase;letter-spacing:.3px}
.product-title{font-size:1.6rem;font-weight:700;margin:.4rem 0;line-height:1.25;color:var(--ink,#111827)}

/* État (condition / disponibilité) — décret 2022-190 */
.product-state{display:flex;gap:.5rem;flex-wrap:wrap;margin:.35rem 0 .75rem}
/* Badge état/condition — exact MagMarket (badges.css) */
.product-page .badge{display:inline-flex;align-items:center;gap:.25rem;padding:.25rem .5rem;font-size:.8125rem;font-weight:500;border-radius:.25rem;letter-spacing:.025em}
.product-page .badge-success{background:#d1fae5;color:#065f46}
.product-page .badge-warning{background:#fef3c7;color:#92400e}

.product-price-block{display:flex;align-items:baseline;gap:.75rem;margin:1rem 0;flex-wrap:wrap}
.product-price{font-size:1.75rem;font-weight:700;color:var(--ink,#111827)}
.product-price-na{font-size:1.25rem;color:var(--muted,#6b7280);font-weight:600}

.product-buyform{margin:1.25rem 0}
.pa-qty{display:block;font-size:.8rem;font-weight:600;color:var(--muted,#6b7280);margin-bottom:.6rem}
.pa-qty input{display:block;width:92px;margin-top:.35rem;padding:10px;border:1px solid var(--line,#e5e7eb);border-radius:8px;font-size:15px;background:#fff;font-family:inherit}
/* Boutons fiche — exact MagMarket (buttons.css), brandés à la couleur du marchand */
.product-page .btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;line-height:1;padding:.75rem 1rem;font-size:.875rem;font-weight:500;border:1px solid transparent;border-radius:.5rem;cursor:pointer;transition:all .2s ease;white-space:nowrap;text-decoration:none;font-family:inherit}
.product-page .btn-lg{padding:1rem 1.5rem;font-size:1rem}
.product-page .btn-primary{background:var(--primary,#193153);color:#fff}
.product-page .btn-primary:hover{filter:brightness(.93)}
.product-page .btn-secondary{background:#fff;color:var(--ink,#1f2937);border-color:var(--line,#e5e7eb)}
.product-page .btn-secondary:hover{background:var(--soft,#f6f6f8)}
.product-actions{display:flex;gap:.75rem;margin:1.5rem 0;flex-wrap:wrap}
.product-actions .btn{flex:1;min-width:180px}
.product-actions .btn svg{width:18px;height:18px}

.product-reassurance{display:flex;flex-direction:column;margin:1.5rem 0;border:1px solid var(--line,#e5e7eb);border-radius:10px;overflow:hidden}
.reassurance-item{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;border-bottom:1px solid var(--line,#f0f0f0)}
.reassurance-item:last-child{border-bottom:none}
.reassurance-item svg{flex-shrink:0;color:var(--primary,#193153)}
.reassurance-item div{display:flex;flex-direction:column}
.reassurance-item strong{font-size:.8125rem;font-weight:600;color:var(--ink,#1f2937)}
.reassurance-item span{font-size:.75rem;color:var(--muted,#6b7280)}

.product-section{margin-bottom:2.5rem}
.product-section h2{font-size:1.2rem;font-weight:600;margin-bottom:1rem;padding-bottom:.5rem;border-bottom:1px solid var(--line,#e5e7eb);color:var(--ink,#111827)}
.product-description{color:#33343a;line-height:1.7;font-size:15px}
.product-description :is(h2,h3){font-size:18px;margin:18px 0 6px;color:var(--ink,#111827)}
.product-specs-table{width:100%;border-collapse:collapse;font-size:14px}
.product-specs-table td{padding:.55rem .5rem;border-bottom:1px solid var(--line,#e5e7eb);vertical-align:top;word-break:break-word}
.product-specs-table td.spec-key{font-weight:500;color:var(--muted,#6b7280);width:40%}

.lightbox{position:fixed;inset:0;background:rgba(15,17,21,.92);display:flex;align-items:center;justify-content:center;z-index:1000;cursor:zoom-out;padding:28px}
.lightbox[hidden]{display:none}
.lightbox img{max-width:92vw;max-height:88vh;width:auto;height:auto;object-fit:contain;background:#fff;border-radius:8px;padding:1rem}

@media(max-width:760px){
  .product-layout{grid-template-columns:1fr;gap:1.5rem}
  .product-gallery{position:static}
  .product-actions{flex-direction:column}
  .product-actions .btn{min-width:0;width:100%}
}

/* ============================================================
   Mise en page BOUTIQUE (vitrine) : contenu à gauche + carte d'achat sticky à droite.
   Classes .pdp-* nouvelles → sans effet sur la fiche MagMarket (qui utilise .product-layout).
   Seul .product-description (max-width) est partagé = gain de lisibilité pour les deux.
   ============================================================ */
.pdp-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;grid-template-areas:"media buy" "details buy";gap:2.5rem;align-items:start;margin-bottom:2.5rem}
.pdp-media{grid-area:media;min-width:0}
.pdp-details{grid-area:details;min-width:0}
.pdp-details .product-section:first-child{margin-top:0}
.pdp-media .product-gallery{position:static}
.pdp-aside{grid-area:buy;position:sticky;top:88px;align-self:start}
.pdp-buy{background:#fff;border:1px solid var(--line,#e5e7eb);border-radius:14px;padding:1.5rem}
.pdp-details .product-section{margin-top:2.5rem;margin-bottom:0}
.product-description{max-width:72ch}

/* Caractéristiques en 2 colonnes */
.product-specs{display:grid;grid-template-columns:1fr 1fr;gap:0 2.5rem}
.product-specs .spec{display:flex;justify-content:space-between;gap:1rem;padding:.6rem 0;border-bottom:1px solid var(--line,#e5e7eb);font-size:14px}
.product-specs .spec-k{color:var(--muted,#6b7280)}
.product-specs .spec-v{font-weight:500;text-align:right}

/* Produits similaires */
.product-related{margin-top:.5rem}
.product-related h2{font-size:1.2rem;font-weight:600;margin-bottom:1.25rem;padding-bottom:.5rem;border-bottom:1px solid var(--line,#e5e7eb);color:var(--ink,#111827)}

/* Barre d'achat mobile (fixe en bas) */
.buybar{display:none}
@media(max-width:1024px){
  .pdp-layout{display:flex;flex-direction:column;gap:1.5rem;align-items:stretch}
  .pdp-media{order:1}
  .pdp-aside{order:2;position:static;align-self:stretch;width:100%}
  .pdp-details{order:3}
  .pdp-buy{background:transparent;border:none;padding:0;border-radius:0}
  .pdp-details .product-section{margin-top:1.5rem}
  .pdp-details .product-section:first-child{margin-top:1.5rem}
  .product-specs{grid-template-columns:1fr;gap:0}
}

/* Lightbox galerie : navigation préc/suivant (flèches, fermeture, compteur) */
.lightbox img { cursor: default; }
.lb-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s; }
.lb-arrow:hover { background: rgba(255,255,255,.28); }
.lb-arrow svg { width: 24px; height: 24px; }
.lb-prev { left: 1.25rem; }
.lb-next { right: 1.25rem; }
.lb-close { position: absolute; top: 1rem; right: 1.25rem; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.lb-close:hover { background: rgba(255,255,255,.28); }
.lb-counter { position: absolute; bottom: 1.25rem; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.75); font-size: .85rem; pointer-events: none; }
@media (max-width: 600px) { .lb-arrow { width: 40px; height: 40px; } .lb-arrow svg { width: 20px; height: 20px; } .lb-prev { left: .5rem; } .lb-next { right: .5rem; } }
