/* Single product page (products/detail.php). Built on main.css tokens. */
.pd { position: relative; padding: 22px 0 90px; overflow-x: clip; }
.pd-wrap { position: relative; max-width: 1120px; }
/* Soft green/turquoise light behind the product card. */
.pd-glow { position: absolute; inset: -120px 0 auto; height: 640px; background: radial-gradient(40% 60% at 78% 30%, rgba(131,223,56,.22), transparent 70%), radial-gradient(36% 55% at 18% 10%, rgba(67,196,232,.16), transparent 70%); pointer-events: none; }
[data-theme="dark"] .pd-glow { opacity: .55; }

.pd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 18px; color: var(--muted); font: 700 12.5px var(--font-display); }
.pd-crumbs a { transition: color .2s ease; }
.pd-crumbs a:hover { color: var(--green-700); }
.pd-crumbs [aria-current] { color: var(--ink); }

/* ---------------------------------------------------------------- main card */
.pd-main { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 38px; align-items: start; padding: 20px; border: 1px solid rgba(255,255,255,.7); border-radius: 30px; background: rgba(255,255,255,.78); box-shadow: 0 30px 70px rgba(7,59,40,.1), inset 0 1px 0 #fff; backdrop-filter: blur(16px); }
[data-theme="dark"] .pd-main { border-color: rgba(113,216,239,.1); background: rgba(13,36,26,.82); box-shadow: 0 30px 70px rgba(0,0,0,.3); }

.pd-media { position: sticky; top: calc(var(--site-header-height, 110px) + 18px); margin: 0; overflow: hidden; border-radius: 22px; aspect-ratio: 1; background: #e8f2ea; isolation: isolate; }
.pd-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.pd-media:hover img { transform: scale(1.12); }
.pd-media::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, rgba(4,38,26,.45)); pointer-events: none; }
.pd-media__top { position: absolute; top: 14px; right: 14px; z-index: 1; display: flex; gap: 7px; }
.pd-media__rating { position: absolute; bottom: 14px; right: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; color: #fff; background: rgba(4,38,26,.55); font: 800 13px var(--font-display); backdrop-filter: blur(10px); }
.pd-media__rating svg { width: 16px; height: 16px; color: #ffc93c; fill: currentColor; stroke: none; }
.pd-media__rating span { color: rgba(255,255,255,.75); font-weight: 600; }

.pd-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font: 800 11.5px var(--font-display); }
.pd-chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.pd-chip--glass { color: var(--green-950); background: rgba(255,255,255,.88); backdrop-filter: blur(8px); }
.pd-chip--ok { color: #fff; background: rgba(19,122,80,.9); }
.pd-chip--warn { color: #fff; background: #b8560a; }

.pd-info { padding: 6px 4px 4px 0; }
.pd-cat { display: inline-block; padding: 4px 12px; border-radius: 999px; color: var(--green-900); background: var(--green-100); font: 800 12.5px var(--font-display); transition: background .2s ease; }
.pd-cat:hover { background: rgba(131,223,56,.35); }
[data-theme="dark"] .pd-cat { color: var(--lime); }
.pd-title { margin: 10px 0 6px; color: var(--ink); font: 900 clamp(24px, 2.6vw, 34px)/1.3 var(--font-display); letter-spacing: -.3px; }
.pd-rating { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.pd-rating b { color: var(--ink); font: 900 14px var(--font-display); }
.pd-rating:hover span { color: var(--green-700); text-decoration: underline; text-underline-offset: 3px; }

.pd-stars { display: inline-flex; gap: 1px; }
.pd-stars svg { width: 16px; height: 16px; fill: #dfe7e1; }
.pd-stars svg.is-on { fill: #ffbe2e; }
[data-theme="dark"] .pd-stars svg { fill: #24463a; }
[data-theme="dark"] .pd-stars svg.is-on { fill: #ffbe2e; }

/* Specs: icon tiles in a compact grid. */
.pd-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0 18px; padding: 0; list-style: none; }
.pd-facts li { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.pd-facts__icon { display: grid; flex: none; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: var(--green-700); background: linear-gradient(135deg, rgba(131,223,56,.25), rgba(67,196,232,.16)); }
.pd-facts__icon svg { width: 18px; height: 18px; }
[data-theme="dark"] .pd-facts__icon { color: var(--lime); }
.pd-facts li > span:last-child { display: grid; min-width: 0; }
.pd-facts small { color: var(--muted); font-size: 11.5px; }
.pd-facts b { overflow: hidden; color: var(--ink); font: 800 13px var(--font-display); text-overflow: ellipsis; white-space: nowrap; }

/* Buy box */
.pd-buy { padding: 16px; border-radius: 22px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #1b7a50, var(--green-950) 70%); box-shadow: 0 18px 40px rgba(7,59,40,.25); }
.pd-buy__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pd-buy__price { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 0 6px; }
.pd-buy__price small { grid-column: 1 / -1; color: rgba(255,255,255,.65); font-size: 12px; }
.pd-buy__price strong { font: 900 28px var(--font-display); letter-spacing: -.5px; }
.pd-buy__price span { color: rgba(255,255,255,.7); font-size: 13px; }
.pd-qty { display: inline-flex; align-items: center; padding: 4px; border-radius: 15px; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.pd-qty button { display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 11px; color: var(--green-950); background: var(--lime); cursor: pointer; transition: transform .15s ease, background .2s ease; }
.pd-qty button:hover { background: #a6ee66; }
.pd-qty button:active { transform: scale(.92); }
.pd-qty svg { width: 16px; height: 16px; stroke-width: 2.4; }
.pd-qty input { width: 86px; border: 0; color: #fff; background: transparent; font: 900 16px var(--font-display); text-align: center; outline: none; }
.pd-buy__total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(255,255,255,.2); color: rgba(255,255,255,.7); font-size: 13px; }
.pd-buy__total b { color: #fff; font: 900 17px var(--font-display); }
.pd-buy__actions { display: flex; gap: 8px; margin-top: 14px; }
.pd-buy__hint { margin: 10px 0 0; color: rgba(255,255,255,.55); font-size: 11.5px; text-align: center; }

.pd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; font: 800 14.5px var(--font-display); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease; }
.pd-btn svg { width: 18px; height: 18px; }
.pd-btn:hover { transform: translateY(-2px); }
.pd-btn--primary { flex: 1; color: var(--green-950); background: linear-gradient(135deg, #d4f9a8, var(--lime)); box-shadow: 0 10px 24px rgba(131,223,56,.35); }
.pd-btn--primary.is-added { color: #fff; background: var(--green-700); box-shadow: none; }
.pd-btn--ghost { color: #fff; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.pd-btn--ghost:hover { background: rgba(255,255,255,.18); }
.pd-btn--dark { width: 100%; color: #fff; background: var(--green-900); }
.pd-btn--dark:hover { background: var(--green-700); }

.pd-trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.pd-trust li { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; color: var(--ink); background: var(--page); font: 700 12px var(--font-display); text-align: center; }
.pd-trust span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: var(--green-700); background: var(--surface); }
.pd-trust svg { width: 17px; height: 17px; }
[data-theme="dark"] .pd-trust span { color: var(--lime); }

/* --------------------------------------------------------------- sections */
.pd-section { margin-top: 64px; }
.pd-section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.pd-kicker { margin: 0 0 2px; color: var(--green-700); font: 800 12.5px var(--font-display); }
[data-theme="dark"] .pd-kicker { color: var(--lime); }
.pd-section__head h2, .pd-all h2 { margin: 0; color: var(--ink); font: 900 clamp(21px, 2.2vw, 28px) var(--font-display); }

/* Reviews */
.pd-reviews__grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.pd-score { position: sticky; top: calc(var(--site-header-height, 110px) + 18px); display: grid; justify-items: center; gap: 6px; padding: 24px 20px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); text-align: center; }
.pd-score__num { color: var(--ink); font: 900 52px/1 var(--font-display); }
.pd-score .pd-stars svg { width: 20px; height: 20px; }
.pd-score p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.pd-score__bars { display: grid; gap: 6px; width: 100%; margin: 0 0 16px; padding: 0; list-style: none; }
.pd-score__bars li { display: grid; grid-template-columns: 14px 1fr 14px; align-items: center; gap: 8px; color: var(--muted); font: 700 12px var(--font-display); }
.pd-score__bars i { height: 7px; overflow: hidden; border-radius: 99px; background: var(--page); }
.pd-score__bars b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd56b, #ffbe2e); }

.pd-reviews__list { display: grid; gap: 12px; }
.pd-review { position: relative; padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease; }
.pd-review:hover { border-color: rgba(131,223,56,.45); box-shadow: 0 14px 30px rgba(7,59,40,.06); }
.pd-review header { display: flex; align-items: center; gap: 12px; }
.pd-review__avatar { display: grid; flex: none; width: 42px; height: 42px; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--green-700), var(--sky-deep)); font: 900 17px var(--font-display); }
.pd-review__who { display: grid; flex: 1; min-width: 0; }
.pd-review__who strong { color: var(--ink); font: 800 14.5px var(--font-display); }
.pd-review__who small { color: var(--muted); font-size: 12px; }
.pd-review p { margin: 12px 0 10px; color: var(--ink); font-size: 14.5px; line-height: 2; }
.pd-review__badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; color: var(--green-700); background: var(--green-100); font: 700 11.5px var(--font-display); }
.pd-review__badge svg { width: 13px; height: 13px; stroke-width: 2.6; }
[data-theme="dark"] .pd-review__badge { color: var(--lime); }

.pd-review-form { display: grid; gap: 10px; padding: 18px 20px; border: 1px solid rgba(131,223,56,.5); border-radius: 20px; background: var(--surface); box-shadow: 0 14px 30px rgba(7,59,40,.07); }
.pd-review-form__title { margin: 0; color: var(--ink); font: 800 14px var(--font-display); }
.pd-rate { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.pd-rate input { position: absolute; opacity: 0; pointer-events: none; }
.pd-rate label { cursor: pointer; }
.pd-rate svg { width: 28px; height: 28px; fill: #dfe7e1; transition: fill .15s ease, transform .15s ease; }
.pd-rate label:hover svg, .pd-rate label:hover ~ label svg, .pd-rate input:checked ~ label svg { fill: #ffbe2e; }
.pd-rate label:hover svg { transform: scale(1.12); }
.pd-rate input:focus-visible + label svg { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 6px; }
.pd-field { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--page); font: 500 14px var(--font-text); resize: vertical; transition: border-color .2s ease; }
.pd-field:focus { border-color: var(--green-700); outline: none; }
.pd-review-form__actions { display: flex; gap: 8px; }
.pd-review-form .pd-btn--ghost { color: var(--ink); background: var(--page); box-shadow: inset 0 0 0 1px var(--line); }
.pd-review-thanks { margin: 0; padding: 14px 18px; border-radius: 16px; color: var(--green-900); background: var(--green-100); font: 800 14px var(--font-display); }
[data-theme="dark"] .pd-review-thanks { color: var(--lime); }

/* Similar products slider */
.pd-similar__nav { display: flex; gap: 6px; }
.pd-similar__nav button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 13px; color: var(--green-900); background: var(--surface); cursor: pointer; transition: background .2s ease, color .2s ease; }
.pd-similar__nav button:hover { color: var(--green-950); background: var(--lime); border-color: transparent; }
.pd-similar__nav svg { width: 18px; height: 18px; }
[data-theme="dark"] .pd-similar__nav button { color: var(--lime); }
.pd-similar__track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 14px) / 4); gap: 14px; margin: 0; padding: 4px 2px 14px; overflow-x: auto; list-style: none; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.pd-similar__track::-webkit-scrollbar { display: none; }
.pd-similar__track li { scroll-snap-align: start; }
.pd-sim { display: block; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.pd-sim:hover { transform: translateY(-5px); border-color: rgba(131,223,56,.5); box-shadow: 0 20px 40px rgba(7,59,40,.12); }
.pd-sim__media { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; }
.pd-sim__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.pd-sim:hover .pd-sim__media img { transform: scale(1.07); }
.pd-sim__media .pd-chip { position: absolute; top: 10px; right: 10px; }
.pd-sim__body { display: grid; gap: 2px; padding: 12px 14px 14px; }
.pd-sim__body > strong { color: var(--ink); font: 900 15px var(--font-display); }
.pd-sim__body > small { color: var(--muted); font-size: 12px; }
.pd-sim__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.pd-sim__foot b { color: var(--green-900); font: 900 15px var(--font-display); }
.pd-sim__foot b small { color: var(--muted); font-size: 11.5px; font-weight: 700; }
[data-theme="dark"] .pd-sim__foot b { color: var(--lime); }
.pd-sim__foot i { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: #fff; background: var(--green-900); transition: background .2s ease, color .2s ease, transform .2s ease; }
.pd-sim__foot svg { width: 15px; height: 15px; }
.pd-sim:hover .pd-sim__foot i { color: var(--green-950); background: var(--lime); transform: translateX(-3px); }

/* All products band */
.pd-all { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 28px; align-items: center; margin-top: 64px; padding: 30px; border-radius: 30px; color: #fff; background: radial-gradient(90% 140% at 0% 100%, rgba(67,196,232,.25), transparent 60%), radial-gradient(120% 120% at 100% 0%, #1b7a50, var(--green-950) 70%); overflow: hidden; }
.pd-all .pd-kicker { color: var(--lime); }
.pd-all h2 { color: #fff; }
.pd-all__copy p:not(.pd-kicker) { margin: 8px 0 18px; color: rgba(255,255,255,.72); font-size: 14px; }
.pd-all__copy .pd-btn { flex: none; }
.pd-all__cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.pd-all__cats a { position: relative; display: block; overflow: hidden; border-radius: 16px; aspect-ratio: 1; }
.pd-all__cats img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.pd-all__cats a::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(4,38,26,.8)); }
.pd-all__cats span { position: absolute; right: 10px; bottom: 8px; left: 10px; z-index: 1; font: 800 13px var(--font-display); }
.pd-all__cats a:hover img { transform: scale(1.1); }

/* Phone buy bar */
.pd-sticky { display: none; }

@media (max-width: 1000px) {
  .pd-main { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 26px; }
  .pd-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-facts li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .pd-similar__track { grid-auto-columns: calc((100% - 2 * 14px) / 3); }
  .pd-all { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .pd { padding: 12px 0 110px; }
  .pd-main { grid-template-columns: 1fr; gap: 18px; padding: 12px; border-radius: 24px; }
  .pd-media { position: relative; top: auto; aspect-ratio: 16 / 11; }
  .pd-media:hover img { transform: none; }
  .pd-info { padding: 0 4px 4px; }
  .pd-reviews__grid { grid-template-columns: 1fr; }
  .pd-score { position: static; grid-template-columns: auto 1fr; justify-items: start; column-gap: 18px; text-align: right; }
  .pd-score__num { grid-row: span 3; align-self: center; }
  .pd-score__bars, .pd-score .pd-btn { grid-column: 1 / -1; }
  .pd-similar__track { grid-auto-columns: 62%; }
  .pd-all { padding: 22px 18px; border-radius: 24px; }
  .pd-all__cats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .pd-all__cats span { right: 6px; bottom: 5px; font-size: 11px; }
  .pd-section, .pd-all { margin-top: 44px; }

  .pd-sticky { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 20px; color: #fff; background: rgba(6,45,30,.94); box-shadow: 0 16px 40px rgba(0,0,0,.25); backdrop-filter: blur(14px); opacity: 0; pointer-events: none; transform: translateY(120%); transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s ease; }
  .pd-sticky.is-visible { opacity: 1; pointer-events: auto; transform: none; }
  .pd-sticky > span { display: grid; padding-right: 6px; }
  .pd-sticky small { color: rgba(255,255,255,.65); font-size: 11px; }
  .pd-sticky b { font: 900 15px var(--font-display); }
  .pd-sticky .pd-btn { flex: none; min-height: 44px; }
}
@media (max-width: 480px) {
  .pd-crumbs { font-size: 11.5px; }
  .pd-facts li { padding: 8px; gap: 8px; }
  .pd-facts__icon { width: 30px; height: 30px; }
  .pd-buy__head { flex-direction: column; align-items: stretch; }
  .pd-buy__price { justify-content: center; text-align: center; }
  .pd-qty { justify-content: space-between; }
  .pd-qty input { flex: 1; }
  .pd-trust li { font-size: 11px; }
  .pd-review { padding: 14px; }
  .pd-all__cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-all__cats li:nth-child(n+5) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-media img, .pd-sim, .pd-sim__media img, .pd-all__cats img, .pd-sticky { transition: none; }
}
