/* Product page (woocommerce/single-product.php). Same visual language as the configurator: cream
   stage, segmented sizes, grouped topping chips. Every selector sits under .product-page. */

.product-page {
  --line: rgb(11 29 79 / 0.12);
  min-height: 100svh;
  padding: calc(var(--header-h) + 18px) 0 clamp(56px, 9vw, 110px);
  color: var(--ink);
}
.product-page .eyebrow { color: rgb(11 29 79 / 0.6); }
.product-page .pp { display: grid; gap: 14px; }
.product-page .pp__crumbs { font-size: 0.85rem; color: rgb(11 29 79 / 0.6); }
.product-page .pp__crumbs a { color: var(--ink); font-weight: 600; }

.product-page .pp__grid { display: grid; gap: clamp(22px, 4vw, 40px); }
@media (min-width: 960px) {
  .product-page .pp__grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr); gap: clamp(36px, 5vw, 80px); align-items: start; }
  .product-page .pp__media { position: sticky; top: calc(var(--header-h) + 24px); }
}

/* ---------- photo ---------- */
.product-page .pp__media {
  --pad: clamp(14px, 3vw, 28px);
  margin: 0;
  aspect-ratio: 4 / 3;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr); /* the cell is the tile: tall photos (bottles, glasses) shrink instead of being cut */
  place-items: center;
  padding: var(--pad);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 50px rgb(60 30 10 / 0.12);
  overflow: hidden;
}
.product-page .pp__img { width: 100%; height: 100%; object-fit: contain; }
.product-page .pp__media:has(.pp__photo-note) { position: relative; padding-bottom: calc(var(--pad) + 1.1rem); }
.product-page .pp__photo-note { position: absolute; inset-inline: 12px; bottom: 10px; text-align: center; font-size: 0.72rem; color: rgb(11 29 79 / 0.45); }
.product-page .pp__ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 100%; }
.product-page .pp__ph-mark { width: 28%; max-width: 140px; }
.product-page .pp__ph-mark svg { display: block; width: 100%; height: auto; }
.product-page .pp__ph-note { color: rgb(11 29 79 / 0.55); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; }

/* ---------- buy panel ---------- */
.product-page .pp__buy { display: grid; gap: 20px; align-content: start; }
.product-page .pp__name { color: var(--ink); font-size: clamp(2.4rem, 7vw, 4.4rem); }
.product-page .pp__desc { max-width: 52ch; font-size: 1.05rem; line-height: 1.5; color: rgb(11 29 79 / 0.75); }
.product-page .pp__out { font-weight: 700; color: var(--red-600); }
.product-page fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 10px; min-width: 0; }
.product-page legend { padding: 0; margin-bottom: 10px; }

.product-page .pp__seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.product-page .pp__opt { position: relative; cursor: pointer; }
.product-page .pp__opt input { position: absolute; z-index: 1; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.product-page .pp__opt-body {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: rgb(255 255 255 / 0.55);
  transition: border-color 0.2s, background-color 0.2s, color 0.2s, transform 0.3s var(--ease-out);
}
.product-page .pp__opt-body strong { font-size: 1.15rem; }
.product-page .pp__opt-body em { font-style: normal; font-size: 0.92rem; font-weight: 600; }
.product-page .pp__opt input:checked + .pp__opt-body { background: var(--blue-700); border-color: var(--blue-700); color: var(--cream); }
.product-page .pp__opt input:focus-visible + .pp__opt-body { outline: 3px solid var(--blue-700); outline-offset: 3px; }
.product-page .pp__opt:active .pp__opt-body { transform: scale(0.98); }

/* ---------- topping groups ---------- */
.product-page .pp__tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.product-page .pp__tab {
  display: grid;
  justify-items: start;
  padding: 8px 14px 6px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.55);
  color: var(--ink);
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.product-page .pp__tab-name { font-size: 0.95rem; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.product-page .pp__tab-price { font-size: 0.74rem; font-weight: 600; line-height: 1.2; opacity: 0.7; }
.product-page .pp__tab[aria-selected="true"] { background: var(--blue-700); border-color: var(--blue-700); color: var(--cream); }
.product-page .pp__tab[aria-selected="true"] .pp__tab-price { opacity: 0.85; }
.product-page .pp__tab:focus-visible { outline: 3px solid var(--blue-700); outline-offset: 2px; }
html:not(.js) .product-page .pp__tabs { display: none; }

.product-page .pp__chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 10px;
  padding-top: 9px;
}
.product-page .pp__chips[hidden] { display: none; }
.product-page .pp__chip { position: relative; }
.product-page .pp__chip-add {
  width: 100%;
  height: 100%;
  min-height: 72px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  padding: 8px 4px 6px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.7);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s, border-color 0.2s, transform 0.25s var(--ease-spring);
}
.product-page .pp__chip-add:active { transform: scale(0.93); }
.product-page .pp__chip-add img { width: 36px; height: 36px; object-fit: contain; transition: transform 0.4s var(--ease-spring); }
.product-page .pp__chip-name { font-size: 0.82rem; font-weight: 700; line-height: 1.1; text-align: center; }
.product-page .pp__chip-count {
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--blue-700);
  color: var(--cream);
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgb(1 42 130 / 0.35);
}
.product-page .pp__chip:not([data-count="0"]) .pp__chip-add { background: rgb(1 42 130 / 0.1); border-color: var(--blue-700); }
.product-page .pp__chip:not([data-count="0"]) .pp__chip-add img { transform: scale(1.1) rotate(-8deg); }
.product-page .pp__chip:not([data-count="0"]) .pp__chip-count { display: flex; }
.product-page .pp__chip-add:disabled { opacity: 1; cursor: default; }
.product-page .pp__chip-add:disabled .pp__chip-name::after { content: " · max"; font-weight: 600; opacity: 0.6; }
.product-page .pp__chip-dec {
  position: absolute;
  top: -7px;
  left: -5px;
  width: 30px;
  height: 30px;
  display: none;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
  color: var(--red-600);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgb(11 29 79 / 0.25);
}
.product-page .pp__chip:not([data-count="0"]) .pp__chip-dec { display: grid; }
.product-page .pp__chip.bump .pp__chip-count { animation: pp-badge 0.45s var(--ease-spring); }
@keyframes pp-badge { 40% { transform: scale(1.45); } }

/* without JS: plain number fields instead of the tap chips */
.product-page .pp__num { display: none; }
html:not(.js) .product-page .pp__chip-add, html:not(.js) .product-page .pp__chip-dec { display: none; }
html:not(.js) .product-page .pp__num { display: grid; gap: 4px; font-size: 0.9rem; font-weight: 600; }
html:not(.js) .product-page .pp__num input { width: 4.5em; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }

/* ---------- summary ---------- */
.product-page .pp__summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 16px 20px;
  padding-top: 6px;
}
.product-page .pp__qty, .product-page .pp__total { display: grid; gap: 6px; }
.product-page .pp__total { justify-items: end; }
.product-page .pp__total strong { font-family: var(--font-display); font-size: clamp(2rem, 6vw, 2.6rem); line-height: 1; white-space: nowrap; }
.product-page .stepper input.val {
  width: 2.4em;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.product-page .stepper input.val::-webkit-outer-spin-button,
.product-page .stepper input.val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
html:not(.js) .product-page .stepper button { display: none; }
.product-page .pp__add { grid-column: 1 / -1; width: 100%; }
.product-page .pp__add.added { animation: pp-added 0.6s var(--ease-spring); }
.product-page .pp__add[aria-busy="true"] { opacity: 0.7; pointer-events: none; }
@keyframes pp-added { 40% { transform: scale(1.04) rotate(-1deg); } }
.product-page .pp__note { color: rgb(11 29 79 / 0.6); }
.product-page .pp__builder, .product-page .pp__back { justify-self: start; color: var(--ink); }
.product-page .pp__back { font-size: 0.92rem; opacity: 0.75; }

/* WooCommerce notices (no-JS add-to-cart confirmation) on the cream stage */
.product-page .woocommerce-notices-wrapper:empty { display: none; }
.product-page .woocommerce-message,
.product-page .woocommerce-error,
.product-page .woocommerce-info {
  margin: 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  list-style: none;
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(11 29 79 / 0.1);
}
.product-page .woocommerce-message .button { margin-left: 10px; color: var(--red-600); }
