/* Product page (reference look, main branch: css/00-base.css tokens, 09-newly-added card, 05 pill).
   Breadcrumb, gallery left, info right (name, From price, personaliser, accent WhatsApp button),
   delivery rows, description accordion, "You may also like", sticky WhatsApp bar on phones. Logic: js/shop.js. */

.pdp-page {
  --p-accent: var(--accent, #dd2745); --p-heading: var(--heading, #2e2d42); --p-body: var(--body, #333);
  --p-muted: var(--muted, #757575); --p-line: var(--border-card, #cbd5e1); --p-row: var(--drawer-row, #e2e8f0);
  --p-pink: var(--pink-band, #fbf3f3); --p-tint: #fdeff1; --p-img: #f4f1f1;
  background: var(--page-bg, #fff); color: var(--p-body); font-family: var(--font, "Public Sans", system-ui, sans-serif);
  font-size: 14px; line-height: 20px;
}
.pdp-page .container { max-width: calc(var(--container, 1344px) + 2 * var(--gutter, 48px)); padding-inline: var(--gutter, 48px); }

/* Breadcrumb (same rules as css/category.css) */
.pdp-page .crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 16px; color: var(--p-muted); }
.pdp-page .crumbs li { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pdp-page .crumbs li + li::before { content: "/"; color: var(--p-line); }
.pdp-page .crumbs a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; text-decoration: none; color: inherit; }
.pdp-page .crumbs a:hover { color: var(--p-accent); }
.pdp-page .crumbs [aria-current] { color: var(--p-heading); overflow-wrap: anywhere; }

/* Layout */
.pdp { display: grid; gap: 24px; padding: 4px 0 40px; }
@media (min-width: 900px) {
  .pdp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; padding-bottom: 56px; }
  .pdp__gallery { position: sticky; top: calc(var(--header-h, 56px) + 16px); }
}
@media (min-width: 1280px) { .pdp { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; } }

/* Gallery: card image (16 radius, card border, #f4f1f1 tile) */
.pdp__main { aspect-ratio: 1; overflow: hidden; border: 1px solid var(--p-line); border-radius: var(--r-card, 16px); background: var(--p-img); }
.pdp__main img { width: 100%; height: 100%; object-fit: cover; background: var(--p-img); }
.pdp__thumbs { display: flex; gap: 8px; margin-top: 12px; }
.pdp__thumb {
  width: 72px; height: 72px; padding: 0; overflow: hidden; border: 1px solid var(--p-line); border-radius: var(--r-md, 8px);
  background: var(--p-img); cursor: pointer; transition: border-color .2s ease;
}
.pdp__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp__thumb:hover { border-color: var(--p-heading); }
.pdp__thumb[aria-pressed="true"] { border: 2px solid var(--p-accent); }

/* Info */
.pdp__info { display: grid; gap: 12px; align-content: start; min-width: 0; }
.pdp__cat { margin: 0; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--p-muted); }
.pdp__cat a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -14px; text-decoration: none; color: inherit; }
.pdp__cat a:hover { color: var(--p-accent); }
.pdp__title { margin: 0; font-family: inherit; font-weight: 700; font-size: 24px; line-height: 32px; letter-spacing: -.4px; color: var(--p-heading); }
@media (min-width: 900px) { .pdp__title { font-size: 28px; line-height: 36px; } }
.pdp__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; }
.pdp__from { font-size: 14px; color: var(--p-muted); }
.pdp__price .price { font-weight: 700; font-size: 24px; line-height: 32px; color: var(--text-strong, #121212); }
.pdp__badge {
  align-self: center; display: inline-flex; align-items: center; padding: 3px 8px; border-radius: var(--r-xs, 2px);
  background: var(--p-pink); font-size: 10px; line-height: 12px; font-weight: 600; text-transform: uppercase; color: var(--badge-brown, #85571b);
}
.pdp__desc { margin: 0; font-size: 16px; line-height: 24px; color: var(--p-body); max-width: 38rem; }

/* Personaliser: one card in the card style */
.pz { display: grid; gap: 20px; margin-top: 8px; padding: 20px 16px; border: 1px solid var(--p-line); border-radius: var(--r-card, 16px); background: #fff; }
@media (min-width: 768px) { .pz { padding: 24px; } }
.pz__title { margin: 0; font-family: inherit; font-weight: 700; font-size: 18px; line-height: 24px; color: var(--p-heading); }
.pz-group { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pz-label { padding: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--p-heading); }
.pz-hint { margin: 0; font-size: 12px; line-height: 16px; color: var(--p-muted); }
.pz-error { margin: 0; font-size: 14px; font-weight: 600; color: #b0162f; }
.pz-error:empty { display: none; }
.pz-name__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pz-counter { font-size: 12px; color: var(--p-muted); font-variant-numeric: tabular-nums; }
.pz-input {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--border-search, #afafaf); border-radius: var(--r-md, 8px);
  background: #fff; font: 400 16px/24px var(--font, "Public Sans", sans-serif); color: var(--text-strong, #121212);
}
.pz-input::placeholder { color: var(--muted-2, #878787); }
.pz-input:focus-visible { outline: 2px solid var(--p-heading); outline-offset: 1px; }
.pz-input[aria-invalid="true"] { border-color: #b0162f; }

/* Options: pills (40 radius). Selected = accent border on the pink tint. */
.pz-options { display: flex; flex-wrap: wrap; gap: 8px; }
.pz-opt { position: relative; display: inline-flex; }
.pz-opt input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.pz-opt__face {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--p-line); border-radius: var(--r-pill, 40px); background: #fff; font-size: 14px; color: var(--p-heading);
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.pz-opt:hover .pz-opt__face { border-color: var(--p-accent); }
.pz-opt input:checked + .pz-opt__face { border-color: var(--p-accent); background: var(--p-tint); color: #b81c37; font-weight: 600; }
.pz-opt input:focus-visible + .pz-opt__face { outline: 2px solid var(--p-heading); outline-offset: 2px; }
.pz-dot { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1px solid rgba(46, 45, 66, .35); }

/* Preview */
.pz-show { display: grid; gap: 8px; margin: 0; }
.pz-show__svg { width: 100%; height: auto; border-radius: var(--r-lg, 12px); }
.pz-show__svg text { transition: fill .2s ease; }

/* Buttons */
.pdp-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--p-line); border-radius: var(--r-md, 8px); background: #fff; cursor: pointer;
  font: 600 14px/20px var(--font, "Public Sans", sans-serif); color: var(--p-heading); transition: border-color .2s ease, color .2s ease;
}
.pdp-line:hover { border-color: var(--p-accent); color: var(--p-accent); }
.pdp-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px;
  border-radius: var(--r-md, 8px); background: var(--p-accent); color: #fff; text-decoration: none;
  font: 700 16px/20px var(--font, "Public Sans", sans-serif); transition: background-color .2s ease;
}
.pdp-wa:hover { background: #c41f3b; }
.pdp-wa:focus-visible { outline: 2px solid var(--p-heading); outline-offset: 3px; }
.pdp-wa svg { width: 22px; height: 22px; flex: none; }

/* Logo */
.pz-logo__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pz-file { position: relative; }
.pz-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pz-file:focus-within { outline: 2px solid var(--p-heading); outline-offset: 3px; }
.pz-logo__thumb { display: inline-block; flex: none; width: 56px; height: 56px; border: 1px solid var(--p-line); border-radius: var(--r-md, 8px); background: var(--p-img) center / contain no-repeat; }

/* Quantity + order */
.pz-buy { grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 12px; }
.qty { display: grid; gap: 8px; }
.qty__ctrl { display: inline-flex; align-items: center; border: 1px solid var(--border-search, #afafaf); border-radius: var(--r-md, 8px); background: #fff; }
.qty__btn { width: 44px; height: 50px; border: 0; border-radius: var(--r-md, 8px); background: transparent; font-size: 20px; line-height: 1; color: var(--p-heading); cursor: pointer; }
.qty__btn:hover { background: var(--menu-active, #f8fafc); color: var(--p-accent); }
.qty__input { width: 40px; height: 50px; border: 0; background: transparent; text-align: center; font-weight: 600; font-size: 16px; color: var(--text-strong, #121212); -moz-appearance: textfield; appearance: textfield; }
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdp__cta { width: 100%; }
@media (max-width: 359px) { .pz-buy { grid-template-columns: 1fr; } }

/* Delivery + returns rows */
.pdp-info { display: grid; margin: 8px 0 0; padding: 0 16px; list-style: none; border: 1px solid var(--p-line); border-radius: var(--r-lg, 12px); }
.pdp-info__row { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--p-row); }
.pdp-info__row:first-child { border-top: 0; }
.pdp-info__ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--p-tint); color: var(--p-accent); }
.pdp-info__ic svg { width: 22px; height: 22px; }
.pdp-info__t { margin: 0; font-weight: 600; font-size: 14px; line-height: 20px; color: var(--p-heading); }
.pdp-info__s { margin: 2px 0 0; font-size: 12px; line-height: 18px; color: var(--p-muted); }
.pdp-info__s a { display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; color: var(--link, #276ef1); font-weight: 600; }

/* Accordion (native details) */
.pdp-accs { margin-top: 8px; border-top: 1px solid var(--p-row); }
.pdp-acc { border-bottom: 1px solid var(--p-row); }
.pdp-acc summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 16px; line-height: 24px; color: var(--p-heading);
}
.pdp-acc summary::-webkit-details-marker { display: none; }
.pdp-acc summary svg { width: 20px; height: 20px; flex: none; transition: transform .2s ease; }
.pdp-acc[open] summary svg { transform: rotate(180deg); }
.pdp-acc summary:hover { color: var(--p-accent); }
.pdp-acc__body { padding: 0 0 16px; color: var(--p-body); font-size: 14px; line-height: 22px; }
.pdp-acc__body ul { margin: 0; padding-left: 1.1em; list-style: disc; }

/* You may also like */
.pdp-rel { padding: 32px 0 56px; border-top: 1px solid var(--p-row); }
.pdp-rel__title { margin: 0 0 20px; font-family: inherit; font-weight: 700; font-size: 24px; line-height: 32px; letter-spacing: -.4px; color: var(--p-heading); }
.pdp-page .pdp-rel__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 8px; }
@media (min-width: 768px) { .pdp-page .pdp-rel__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 12px; } }

/* Sticky WhatsApp bar, phones only (shop-app style). Body padding keeps it off the footer. */
.pdp-bar { display: none; }
@media (max-width: 767px) {
  .pdp-page .container { padding-inline: var(--gutter, 16px); }
  body.has-pdp-bar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .pdp-bar {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--p-line);
    font-family: var(--font, "Public Sans", system-ui, sans-serif);
    transition: transform .25s ease, visibility .25s;
  }
  .pdp-bar.is-hidden { transform: translateY(110%); visibility: hidden; }
  .pdp-bar__price { display: grid; margin: 0; line-height: 1.2; }
  .pdp-bar__label { font-size: 12px; color: var(--muted, #757575); }
  .pdp-bar .price { font-size: 18px; font-weight: 700; color: var(--text-strong, #121212); }
  .pdp-bar .pdp-wa { flex: 1; max-width: 16rem; min-height: 48px; }
}
