/* ========================================================================
   FICHE PRODUIT (PDP) — ON FACTORY
   Ouverture au clic sur un article : galerie + achat ergonomique.
   Thème sombre de la marque, optimisé mobile.
   ======================================================================== */

.pdp {
  position: fixed; inset: 0; z-index: 100050;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(4, 7, 11, .72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .32s var(--ease), visibility .32s var(--ease);
}
.pdp.open { opacity: 1; visibility: visible; }

.pdp__panel {
  position: relative; width: 100%; max-width: 1080px; max-height: 92vh; overflow: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6);
  transform: translateY(24px) scale(.985); transition: transform .38s var(--ease);
  -webkit-overflow-scrolling: touch;
}
.pdp.open .pdp__panel { transform: none; }

.pdp__close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(20, 27, 38, .82);
  color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.pdp__close:hover { background: var(--surface); transform: rotate(90deg); }
.pdp__close svg { width: 20px; height: 20px; }

.pdp__grid { display: grid; grid-template-columns: 1.05fr 1fr; }

/* ---- Galerie ---- */
.pdp__media {
  background: linear-gradient(160deg, var(--surface), var(--bg));
  padding: 34px; display: flex; flex-direction: column; gap: 16px;
  border-right: 1px solid var(--border);
}
.pdp__main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 320px; border-radius: 16px; overflow: hidden;
}
.pdp__main img { width: 100%; height: 100%; object-fit: contain; max-height: 460px; }
.pdp__thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.pdp__thumb {
  width: 62px; height: 62px; border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); padding: 0; flex: none;
  transition: border-color .2s var(--ease);
}
.pdp__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp__thumb.is-active { border-color: var(--accent); }

/* ---- Infos / achat ---- */
.pdp__info { padding: 40px 36px; display: flex; flex-direction: column; gap: 18px; }
.pdp__title {
  font-family: var(--font-display); font-size: clamp(34px, 4vw, 52px); line-height: .96;
  letter-spacing: .01em; color: var(--text); margin: 4px 0 0;
}
.pdp__sub { font-size: 14px; color: var(--text-muted); margin: -8px 0 0; line-height: 1.5; }

.pdp__price { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pdp__now { font-size: 30px; font-weight: 700; color: var(--text); }
.pdp__was { font-size: 18px; color: var(--text-muted); text-decoration: line-through; }
.pdp__save {
  font-size: 12.5px; font-weight: 700; color: #fff;
  background: #e5484d; padding: 6px 12px; border-radius: 999px; letter-spacing: .01em;
}

.pdp__urgency {
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: 14px; padding: 12px 15px; display: grid; gap: 6px;
}
.pdp__urgency p { margin: 0; font-size: 13.5px; color: var(--text); display: flex; align-items: center; gap: 9px; line-height: 1.35; }
.pdp__urgency b { font-weight: 700; }
.pdp__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.pdp__dot--live { background: #f0554f; box-shadow: 0 0 0 4px rgba(240, 85, 79, .18); animation: pdpPulse 1.6s ease-in-out infinite; }
@keyframes pdpPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.pdp__stock {
  display: inline-flex; align-items: center; gap: 9px; align-self: flex-start;
  font-size: 13.5px; font-weight: 600; padding: 9px 14px; border-radius: 999px;
  border: 1px solid rgba(240, 100, 100, .45); background: rgba(240, 100, 100, .12); color: #f37070;
}
.pdp__stock--ok { border-color: rgba(120, 200, 140, .4); background: rgba(120, 200, 140, .1); color: #7fd39a; }
.pdp__stock--out { border-color: rgba(240, 120, 120, .45); background: rgba(240, 120, 120, .12); color: #f08a8a; }
.pdp__stock .pdp__dot { background: currentColor; box-shadow: none; }

.pdp__field { display: flex; flex-direction: column; gap: 9px; }
.pdp__label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.pdp__guide { font-size: 12px; color: var(--accent); background: none; border: none; cursor: pointer; text-transform: none; letter-spacing: 0; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.pdp__select {
  appearance: none; -webkit-appearance: none;
  width: 100%; padding: 14px 44px 14px 16px; font-family: var(--font-body); font-size: 15px; font-weight: 600;
  color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23929aa8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
  transition: border-color .2s var(--ease);
}
.pdp__select:focus { outline: none; border-color: var(--accent); }

.pdp__qty { display: inline-flex; align-items: center; gap: 4px; }
.pdp__qbtn {
  width: 42px; height: 42px; border-radius: 11px; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.pdp__qbtn:hover:not(:disabled) { border-color: var(--accent); }
.pdp__qbtn:disabled { opacity: .35; cursor: not-allowed; }
.pdp__qval { min-width: 48px; text-align: center; font-size: 17px; font-weight: 700; color: var(--text); }

.pdp__add {
  width: 100%; padding: 17px 24px; border: none; border-radius: 14px; cursor: pointer; margin-top: 2px;
  font-family: var(--font-body); font-weight: 700; font-size: 15px; letter-spacing: .04em; color: #0a0a0a;
  background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #fff));
  box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), filter .2s var(--ease);
}
.pdp__add:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 42px color-mix(in srgb, var(--accent) 40%, transparent); filter: brightness(1.05); }
.pdp__add:active:not(:disabled) { transform: translateY(0); }
.pdp__add--notify { background: linear-gradient(100deg, #f0a07a, #f7c2a6); box-shadow: 0 12px 34px rgba(240, 160, 122, .28); }
.pdp__add:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Timeline livraison ---- */
.pdp__timeline { margin-top: 6px; }
.pdp__track { position: relative; display: flex; justify-content: space-between; }
.pdp__track::before {
  content: ""; position: absolute; top: 22px; left: 12%; right: 12%; height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(143, 192, 240, .25));
}
.pdp__step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; flex: 1; }
.pdp__step-ic {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1.5px solid var(--accent); color: var(--accent);
}
.pdp__step-ic svg { width: 21px; height: 21px; }
.pdp__step-date { font-size: 13px; font-weight: 700; color: var(--text); }
.pdp__step-lbl { font-size: 11px; color: var(--text-muted); letter-spacing: .03em; }

/* ---- Mobile ---- */
@media (max-width: 820px) {
  .pdp { padding: 0; }
  .pdp__panel { max-width: 100%; max-height: 100vh; height: 100%; border-radius: 0; border: none; }
  .pdp__grid { grid-template-columns: 1fr; }
  .pdp__media { border-right: none; border-bottom: 1px solid var(--border); padding: 20px 22px 14px; }
  .pdp__main { min-height: 170px; }
  .pdp__main img { max-height: 30vh; }
  .pdp__info { padding: 22px 22px 36px; gap: 14px; }
  .pdp__close { top: 12px; right: 12px; background: rgba(20, 27, 38, .92); }
  .pdp__now { font-size: 26px; }
  .pdp__step-ic { width: 40px; height: 40px; }
  .pdp__step-lbl { font-size: 10px; }
}
@media (max-width: 380px) {
  .pdp__track::before { left: 14%; right: 14%; }
  .pdp__step-date { font-size: 12px; }
}
