/* ---------------------------------------------------------------------------
   Product page (/product/<id>)
   ---------------------------------------------------------------------------
   Laid out like a spec sheet rather than a shop listing: the material on the
   left, the numbers a buyer has to justify on the right. Built on the existing
   theme tokens so it follows the light/dark toggle like every other page.
   --------------------------------------------------------------------------- */

/* ---------- loading skeleton ---------- */
.pdp-loading{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:34px;
  padding-top:48px;
  padding-bottom:60px;
}

.pdp-skeleton-media,
.pdp-skeleton-lines span{
  background:linear-gradient(90deg,
    rgba(255,255,255,.06) 25%,
    rgba(255,255,255,.13) 37%,
    rgba(255,255,255,.06) 63%);
  background-size:400% 100%;
  animation:pdpShimmer 1.4s ease infinite;
  border-radius:14px;
}

.pdp-skeleton-media{ aspect-ratio:4/3; }
.pdp-skeleton-lines{ display:flex; flex-direction:column; gap:16px; padding-top:12px; }
.pdp-skeleton-lines span{ height:26px; }
.pdp-skeleton-lines span:nth-child(2){ width:72%; }
.pdp-skeleton-lines span:nth-child(3){ width:45%; height:52px; }

@keyframes pdpShimmer{ 0%{background-position:100% 0;} 100%{background-position:0 0;} }

/* ---------- breadcrumbs ---------- */
.pdp-crumbs{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding-top:26px;
  font-size:.86rem;
  color:var(--text-muted);
}
.pdp-crumbs a{ color:var(--text-muted); }
.pdp-crumbs a:hover{ color:var(--primary-2); }
.pdp-crumbs i{ font-size:.62rem; opacity:.6; }
.pdp-crumbs span[aria-current]{ color:var(--text); font-weight:700; }

/* ---------- the fold ---------- */
.pdp{
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);
  gap:clamp(24px,4vw,52px);
  align-items:start;
  padding:28px 0 10px;
}

/* Left column: the photo with its facts panel tucked directly beneath it,
   whatever height the calculator on the right happens to be. */
.pdp-left{
  display:flex;
  flex-direction:column;
  gap:16px;
  min-width:0;
}

.pdp-media{
  position:relative;
  overflow:hidden;
  border-radius:20px;
  border:1px solid var(--line);
  background:#eef2f7;
  box-shadow:var(--shadow);
}

.pdp-media img{
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  display:block;
}

.pdp-media-blank{
  display:grid;
  place-items:center;
  aspect-ratio:4/3;
  color:#94a3b8;
  font-size:2.4rem;
}

.pdp-availability{
  position:absolute;
  left:16px;
  top:16px;
  /* .availability sets bottom:12px for the catalogue card. Leaving both top and
     bottom set makes an absolutely-positioned box stretch the full height, which
     turned this badge into a tall pill down the side of the photo. */
  bottom:auto;
  z-index:2;
}

.pdp-main h1{
  font-family:'Manrope',sans-serif;
  font-size:clamp(1.8rem,3.4vw,2.7rem);
  line-height:1.15;
  margin-bottom:12px;
}

.pdp-lead{
  color:var(--text-muted);
  font-size:1.03rem;
  margin-bottom:20px;
  max-width:56ch;
}

.pdp-price{
  display:flex;
  align-items:baseline;
  gap:10px;
  flex-wrap:wrap;
  padding-bottom:22px;
  margin-bottom:22px;
  border-bottom:1px solid var(--line);
}

.pdp-price strong{
  font-family:'Manrope',sans-serif;
  font-size:clamp(1.7rem,3vw,2.2rem);
  line-height:1;
  color:var(--text);
}

.pdp-price span{ color:var(--text-muted); font-weight:700; }

/* ---------- the calculator ---------- */
.pdp-calc{
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--bg-card);
  padding:20px;
  margin-bottom:20px;
}

.pdp-calc.is-disabled{ opacity:.55; pointer-events:none; }

.pdp-calc-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.pdp-calc-head label{
  font-weight:800;
  font-size:.95rem;
}

.pdp-presets{ display:flex; gap:6px; flex-wrap:wrap; }

.pdp-chip{
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:transparent;
  color:var(--text-muted);
  font:inherit;
  font-size:.82rem;
  font-weight:800;
  cursor:pointer;
  transition:border-color .2s ease, color .2s ease, background .2s ease;
}

.pdp-chip:hover,
.pdp-chip.is-on{
  border-color:var(--primary-2);
  color:var(--text);
  background:rgba(0,212,255,.10);
}

.pdp-qty{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:18px;
}

.pdp-step{
  display:grid;
  place-items:center;
  width:44px;
  height:48px;
  flex-shrink:0;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-size:.9rem;
  cursor:pointer;
  transition:border-color .2s ease, background .2s ease;
}

.pdp-step:hover{ border-color:var(--primary-2); }

.pdp-qty input{
  flex:1;
  min-width:0;
  min-height:48px;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.08);
  color:var(--text);
  font:inherit;
  font-size:1.15rem;
  font-weight:900;
  text-align:center;
  outline:none;
  font-variant-numeric:tabular-nums;
}

.pdp-qty input:focus{
  border-color:#0ea5e9;
  box-shadow:0 0 0 4px rgba(14,165,233,.14);
}

body.light-theme .pdp-qty input,
body.light-theme .pdp-step{
  background:#fff;
  border-color:rgba(15,23,42,.12);
  color:#0f172a;
}

.pdp-qty-unit{
  flex-shrink:0;
  color:var(--text-muted);
  font-weight:800;
  font-size:.92rem;
}

.pdp-total{ margin:0; }

.pdp-total > div{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:14px;
  padding:7px 0;
}

.pdp-total dt{ color:var(--text-muted); font-size:.92rem; }
.pdp-total dd{ margin:0; font-weight:800; font-variant-numeric:tabular-nums; }

.pdp-total-grand{
  border-top:1px solid var(--line);
  margin-top:6px;
  padding-top:12px !important;
}

.pdp-total-grand dt{ color:var(--text); font-weight:800; font-size:1rem; }

.pdp-total-grand dd{
  font-family:'Manrope',sans-serif;
  font-size:1.35rem;
  color:var(--primary-2);
}

.pdp-note{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:14px 0 0;
  font-size:.84rem;
  color:var(--text-muted);
}

.pdp-note i{ margin-top:3px; }

/* ---------- actions ---------- */
.pdp-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.pdp-actions .btn{ flex:1 1 200px; justify-content:center; }

.pdp-add.is-in{
  background:linear-gradient(135deg,#16a34a,#22c55e);
  border-color:transparent;
  color:#04231a;
}

.pdp-quote-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--primary-2);
  font-weight:800;
  font-size:.92rem;
}

.pdp-quote-link i{ font-size:.78rem; }

/* ---------- detail ---------- */
.pdp-detail-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:clamp(24px,4vw,48px);
}

.pdp-detail h2{
  font-family:'Manrope',sans-serif;
  font-size:1.35rem;
  margin-bottom:16px;
}

.pdp-specs{
  width:100%;
  border-collapse:collapse;
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
}

.pdp-specs th,
.pdp-specs td{
  text-align:left;
  padding:13px 16px;
  border-bottom:1px solid var(--line);
  font-size:.95rem;
}

.pdp-specs th{
  width:45%;
  color:var(--text-muted);
  font-weight:700;
  background:rgba(255,255,255,.03);
}

.pdp-specs td{ color:var(--text); font-weight:700; }
.pdp-specs tr:last-child th,
.pdp-specs tr:last-child td{ border-bottom:none; }

.pdp-specs-empty{
  display:flex;
  gap:14px;
  padding:20px;
  border:1px dashed var(--line);
  border-radius:14px;
  background:var(--bg-card);
}

.pdp-specs-empty > i{ color:var(--primary-2); font-size:1.2rem; margin-top:2px; }
.pdp-specs-empty strong{ display:block; margin-bottom:4px; }
.pdp-specs-empty p{ color:var(--text-muted); font-size:.93rem; margin-bottom:10px; }

.pdp-inline-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#25D366;
  font-weight:800;
  font-size:.9rem;
}

.pdp-facts{ display:grid; gap:14px; }

.pdp-facts li{
  display:flex;
  gap:12px;
  align-items:flex-start;
  color:var(--text-muted);
  font-size:.96rem;
  line-height:1.6;
}

.pdp-facts i{
  color:var(--primary-2);
  margin-top:4px;
  flex-shrink:0;
  width:18px;
  text-align:center;
}

.pdp-facts a{ color:var(--primary-2); }

/* ---------- related ---------- */
.pdp-related .section-head{ margin-bottom:30px; }
.pdp-related-card{ display:block; color:inherit; }
.pdp-related-card .product-body h3{ min-height:0; margin-bottom:10px; }

/* ---------- sticky mobile bar ---------- */
.pdp-sticky{ display:none; }

/* ---------- not found ---------- */
.pdp-missing{
  max-width:620px;
  margin:0 auto;
  text-align:center;
  padding:40px 0;
}

.pdp-missing-icon{
  display:grid;
  place-items:center;
  width:76px;
  height:76px;
  margin:0 auto 22px;
  border-radius:22px;
  background:var(--bg-card);
  border:1px solid var(--line);
  color:var(--primary-2);
  font-size:1.8rem;
}

.pdp-missing h1{
  font-family:'Manrope',sans-serif;
  font-size:clamp(1.5rem,3vw,2.1rem);
  margin-bottom:12px;
}

.pdp-missing p{ color:var(--text-muted); margin-bottom:26px; }

.pdp-missing-actions{
  display:flex;
  gap:12px;
  justify-content:center;
  flex-wrap:wrap;
}

/* ---------- responsive ---------- */
@media(max-width:900px){
  .pdp{ grid-template-columns:1fr; }
  .pdp-loading{ grid-template-columns:1fr; }
}

@media(max-width:680px){
  .pdp-calc-head{ flex-direction:column; align-items:flex-start; }

  /* Price and the add button stay reachable while reading the spec sheet. */
  .pdp-sticky{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:1180;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:12px 16px;
    background:rgba(8,17,32,0.97);
    border-top:1px solid rgba(255,255,255,0.14);
    box-shadow:0 -10px 30px rgba(0,0,0,.32);
  }

  .pdp-sticky[hidden]{ display:none; }

  body.light-theme .pdp-sticky{
    background:rgba(255,255,255,0.98);
    border-top-color:rgba(15,23,42,.12);
  }

  .pdp-sticky strong{
    display:block;
    font-family:'Manrope',sans-serif;
    font-size:1.1rem;
    line-height:1.2;
  }

  .pdp-sticky span{ font-size:.78rem; color:var(--text-muted); }
  .pdp-sticky .btn{ flex-shrink:0; }

  /* Keep the floating buttons clear of it. */
  body:has(.pdp-sticky:not([hidden])) .wa-fab{ bottom:calc(clamp(16px,3vw,32px) + 76px); }
}

@media(prefers-reduced-motion: reduce){
  .pdp-skeleton-media,
  .pdp-skeleton-lines span{ animation:none; }
}

/* ---------- at a glance (under the photo) ----------
   Fills the column beside the calculator with the facts a buyer checks, rather
   than leaving dead space: how it is sold, whether it is in, and the code to
   quote back to us. */
.pdp-glance{
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--bg-card);
  padding:18px 20px;
}

.pdp-glance dl{ margin:0; }

.pdp-glance dl > div{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  padding:9px 0;
  border-bottom:1px solid var(--line);
}

.pdp-glance dl > div:last-child{ border-bottom:none; }

.pdp-glance dt{
  color:var(--text-muted);
  font-size:.88rem;
}

.pdp-glance dd{
  margin:0;
  font-weight:800;
  font-size:.92rem;
  text-align:right;
}

.pdp-glance dd code{
  background:rgba(255,255,255,.07);
  padding:3px 8px;
  border-radius:6px;
  font-size:.82rem;
  color:var(--text-muted);
}

body.light-theme .pdp-glance dd code{ background:rgba(15,23,42,.06); }

.pdp-glance-state.state-available{ color:#22c55e; }
.pdp-glance-state.state-low-stock{ color:#f59e0b; }
.pdp-glance-state.state-on-order{ color:#0ea5e9; }
.pdp-glance-state.state-out-of-stock{ color:#ff8fa3; }
body.light-theme .pdp-glance-state.state-out-of-stock{ color:#9f1239; }

.pdp-tags{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.pdp-tags a{
  padding:5px 11px;
  border-radius:999px;
  border:1px solid var(--line);
  color:var(--text-muted);
  font-size:.78rem;
  font-weight:700;
  transition:border-color .2s ease, color .2s ease;
}

.pdp-tags a:hover{
  border-color:var(--primary-2);
  color:var(--text);
}

/* ---------- assurance row (right under the buy action) ---------- */
.pdp-assure{
  display:flex;
  flex-wrap:wrap;
  gap:8px 18px;
  margin:0 0 16px;
}

.pdp-assure li{
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--text-muted);
  font-size:.84rem;
}

.pdp-assure i{ color:#22c55e; font-size:.82rem; }
