/* SHOTBYADDICT — product.css (product.html, /shop/<slug>)
   Gallery on the left (thumbnail strip + big square picture), details on the right. Black, plain, one red button.
   Chevrons are drawn with borders: a box with a right + bottom border; rotate(45deg) points down, 225 up, 135 left, -45 right. */

.section.pp-top { padding-top: calc(var(--header-h) + clamp(1rem, 3vw, 2rem)); padding-bottom: calc(var(--section-y) * 0.7); }
.pp-back { gap: 0.5rem; margin-bottom: 0.5rem; text-decoration-color: var(--line-strong); }
.pp-back::before { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(135deg); margin-right: 0.15rem; }
.pp-back:hover { text-decoration-color: var(--red); }
.pp-top .shop-note { margin-block: 0.5rem 1rem; }

.pp { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: minmax(0, 1fr); align-items: start; margin-top: 0.5rem; }
@media (min-width: 60em) {
  .pp { grid-template-columns: minmax(0, min(46.25rem, 60%)) minmax(0, 1fr); gap: clamp(2rem, 4.5vw, 5rem); }
}

/* phone held sideways: picture on the left, about as tall as the screen; title, price and Buy now beside it */
@media (orientation: landscape) and (max-height: 31.25em) and (min-width: 34em) and (max-width: 59.99em) {
  /* the whole square fits under the header and the Back to shop row (it ran ~37px below the screen at 844x390) */
  .pp { grid-template-columns: minmax(0, calc(100svh - var(--header-h) - 5.75rem)) minmax(0, 1fr); gap: 1.5rem; }
  .pp__gallery { max-width: calc(100svh - var(--header-h) - 5.75rem); }
  .pp__title { font-size: clamp(1.375rem, 1rem + 1.5vw, 1.75rem); }
  .pp__buy { margin-block: 1rem 1.25rem; }
}

/* ---- chevron ---- */
.pp__chev, .pp-acc__sum::after, .pp__scroll::before {
  content: "";
  display: block;
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}
.pp__chev { transform: rotate(135deg) translate(-1px, -1px); }
.pp__arrow--next .pp__chev { transform: rotate(-45deg) translate(-1px, -1px); }

/* ---- gallery ----
   The main picture is always a 40rem (640px) square at most. [data-multi] (more than one picture) is set by the Function in the
   served HTML and kept up to date by product.js, so the thumbnail column/row is reserved before the pictures load: no layout shift. */
.pp__gallery { display: grid; gap: 0.75rem; grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 40rem; }
.pp__stage { position: relative; width: 100%; aspect-ratio: 1; background: var(--black); overflow: hidden; }
.pp__stage.skeleton { background: var(--ink-2); }
.pp__stage--slate { display: grid; place-items: center; padding: 2rem; text-align: center; background: repeating-linear-gradient(135deg, var(--ink-2) 0 14px, var(--ink) 14px 28px); container-type: inline-size; }
.pp__slate { font-weight: 700; font-size: clamp(1.5rem, 9cqi, 2.75rem); line-height: 1.1; color: var(--muted); overflow-wrap: anywhere; }
.pp__zoom { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: zoom-in; background: var(--black); }
/* the focus ring is drawn on a layer above the picture (an inset shadow on the button itself would be hidden under the <img>) */
.pp__zoom:focus-visible { outline: none; box-shadow: none; }
.pp__zoom:focus-visible::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px var(--white), inset 0 0 0 6px var(--red); }
.pp__img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.pp__gallery--single .pp__zoom { cursor: zoom-in; }
.pp__stage { touch-action: pan-y; }

.pp__arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 2.75rem;
  height: 2.75rem;
  margin-top: -1.375rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.78);
  color: var(--white);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
  transition: background-color var(--t-fast) linear, box-shadow var(--t-fast) linear;
  -webkit-tap-highlight-color: transparent;
}
.pp__arrow:hover { background: #000; box-shadow: 0 0 0 2px var(--white); }
.pp__arrow:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; box-shadow: 0 0 0 6px var(--red); }
.pp__arrow--prev { left: 0.75rem; }
.pp__arrow--next { right: 0.75rem; }
.pp__arrow[hidden] { display: none; }

/* thumbnails: a column on the left on wide screens, a row under the picture on phones */
.pp__thumbs { display: flex; flex-direction: column; min-width: 0; }
/* reserved (invisible) while the pictures load, so nothing below moves when the strip appears */
.pp__gallery[data-multi] .pp__thumbs[hidden] { display: flex !important; visibility: hidden; }
.pp__gallery[data-multi] .pp__thumbs { min-height: 4.25rem; }
.pp__strip { display: flex; flex-direction: row; gap: 0.5rem; margin: 0; padding: 0; list-style: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pp__strip::-webkit-scrollbar { display: none; }
.pp__thumb-item { flex: none; width: 4.25rem; }
.pp__thumb { display: block; width: 100%; aspect-ratio: 1; background: var(--ink-2); overflow: hidden; opacity: 0.62; transition: opacity var(--t-fast) linear; }
.pp__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pp__thumb:hover { opacity: 1; }
.pp__thumb[aria-current="true"] { opacity: 1; outline: 2px solid var(--white); outline-offset: -2px; }
.pp__thumb:focus-visible { opacity: 1; outline: 3px solid var(--red); outline-offset: -3px; box-shadow: inset 0 0 0 5px var(--white); }
.pp__scroll { display: none; }

@media (min-width: 60em) {
  .pp__gallery[data-multi] { grid-template-columns: 5.25rem minmax(0, 1fr); gap: 1rem; max-width: 46.25rem; }
  .pp__gallery[data-multi] .pp__stage { grid-column: 2; grid-row: 1; }
  .pp__gallery[data-multi] .pp__thumbs { grid-column: 1; grid-row: 1; min-height: 0; }
  .pp__thumbs { contain: size; /* the strip is as tall as the picture and scrolls, it never makes the row taller */ }
  .pp__strip { flex: 1 1 0; min-height: 0; flex-direction: column; overflow-x: hidden; overflow-y: auto; }
  .pp__thumb-item { width: 100%; }
  .pp__scroll { display: grid; place-items: center; flex: none; height: 2.25rem; color: var(--white); }
  .pp__scroll[hidden] { display: none; }
  .pp__scroll:disabled { opacity: 0.3; cursor: default; }
  .pp__scroll:not(:disabled):hover { color: var(--c-soft-red); }
  .pp__scroll--up::before { transform: rotate(225deg) translate(-1px, -1px); }
  .pp__scroll--down::before { transform: rotate(45deg) translate(-1px, -1px); }
}

/* ---- info column ---- */
.pp__info { min-width: 0; display: grid; align-content: start; }
.pp__title {
  font-family: var(--font-text);
  font-weight: 800;
  font-size: clamp(1.625rem, 1.1rem + 1.9vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.pp__price { margin-top: 0.75rem; font-size: var(--fs-md); font-weight: 600; color: var(--white); font-variant-numeric: tabular-nums; }
.pp__buy { display: grid; gap: 0.75rem; max-width: 26rem; margin-block: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2.25rem); }
.pp__buy .btn { font-size: var(--fs-base); }
.pp__buy-now { gap: 0.9em; }
/* white on the red, like every red button; a lighter weight tells the price apart from the label */
.pp__buy-price { font-weight: 500; font-variant-numeric: tabular-nums; }
.pp__add .pp__check { margin-right: 0.5em; color: var(--ok); }
@media (hover: hover) { .pp__add.is-in-cart:hover { background: transparent; color: var(--white); } }
.pp__add.is-in-cart:hover .pp__check { color: var(--ok); }

/* share: a quiet text button under the buy buttons (Share on phones, Copy link elsewhere) */
.pp__share { display: grid; justify-items: start; gap: 0.5rem; max-width: 26rem; margin-top: calc(-1 * clamp(0.5rem, 1.5vw, 1rem)); margin-bottom: clamp(1rem, 2.5vw, 1.5rem); }
.pp__share[hidden], html:not(.js) .pp__share { display: none; }
.pp[data-state="loading"] .pp__share { visibility: hidden; }
.pp__share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding-right: 0.5rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.25em;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--t-fast) linear, text-decoration-color var(--t-fast) linear;
}
.pp__share-btn:hover { text-decoration-color: var(--red); }
.pp__share-icon { flex: none; width: 1.125rem; height: 1.125rem; }
.pp__share-btn.is-done { color: var(--c-soft-red); text-decoration-color: transparent; }
.pp__share-url { width: 100%; font-size: var(--fs-base); }
.pp__share-url[hidden] { display: none; }

/* accordions: native <details>, chevron on the right */
.pp__acc { max-width: 40rem; border-bottom: 1px solid var(--line); }
.pp-acc { border-top: 1px solid var(--line); }
.pp-acc__sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.5rem 0.75rem;
  margin-inline: -0.75rem; /* room for the focus ring; the text still lines up with the rest of the column */
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}
.pp-acc__sum::-webkit-details-marker { display: none; }
.pp-acc__sum::after { transform: rotate(45deg) translate(-2px, -2px); margin-right: 0.25rem; }
.pp-acc[open] > .pp-acc__sum::after { transform: rotate(225deg) translate(-2px, -2px); }
.pp-acc__sum:hover { color: var(--c-soft-red); }
.pp-acc__sum:focus-visible { outline: 2px solid var(--white); outline-offset: -2px; box-shadow: inset 0 0 0 5px var(--red); }
.pp-acc__body { padding-bottom: 1.25rem; color: var(--text); }
.pp__desc { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; }
.pp__list { display: grid; gap: 0.4rem; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.pp__list li { position: relative; padding-left: 1rem; }
.pp__list li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 0.35rem; height: 0.35rem; border-radius: 50%; background: var(--c-soft-red); }
.pp__fine { font-size: var(--fs-sm); color: var(--muted); }
.pp__fine .link { color: var(--white); }
@media (prefers-reduced-motion: no-preference) {
  .pp-acc__sum::after { transition: transform var(--t-fast) ease; }
  .pp__arrow, .pp__thumb { transition-duration: var(--t-fast); }
}

/* loading / not found / error */
.pp[data-state="loading"] .pp__price, .pp[data-state="loading"] .pp__buy { visibility: hidden; }
.pp[data-state="missing"], .pp[data-state="error"] { grid-template-columns: minmax(0, 1fr); }
.pp[data-state="missing"] .pp__gallery, .pp[data-state="error"] .pp__gallery,
.pp[data-state="missing"] .pp__info > :not(.pp__state), .pp[data-state="error"] .pp__info > :not(.pp__state) { display: none; }
.pp__state { display: grid; justify-items: start; gap: var(--s-4); padding-block: clamp(1.5rem, 4vw, 3rem); }
.pp__state[hidden] { display: none; }
.pp__state-title { font-size: var(--fs-xl); font-weight: 700; color: var(--white); }
.pp__state-text { max-width: 34rem; color: var(--muted); }
.pp-top .shop-fine { margin-top: var(--s-7); }

/* ---- phone Buy bar: same material as the site's book bar (base.css .book-bar); only while the real Buy now is off screen ---- */
.pp-bar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--z-bookbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: var(--bookbar-h);
  padding: 0.6rem max(var(--gutter), env(safe-area-inset-right)) calc(0.6rem + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: var(--black);
  box-shadow: 0 -1px 0 var(--line);
  transition: transform var(--t-med) var(--ease-out), visibility 0s linear 0s;
}
.pp-bar[hidden] { display: none; }
.pp-bar:not(.is-visible), .menu-open .pp-bar { transform: translateY(110%); visibility: hidden; transition: transform var(--t-med) var(--ease-out), visibility 0s linear var(--t-med); }
.pp-bar__text { display: grid; min-width: 0; line-height: 1.2; }
.pp-bar__text b { font-size: var(--fs-sm); font-weight: 700; color: var(--white); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-bar__text span { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.pp-bar__buy { flex: none; }
/* room for the bar under the footer and the toasts (phones only; the bar is not used from 60em or on short landscape screens) */
@media (max-width: 59.99em) {
  body.has-ppbar .site-footer { padding-bottom: calc(var(--bookbar-h) + 2rem + env(safe-area-inset-bottom)); }
  body.has-ppbar .toast-region { bottom: calc(var(--bookbar-h) + 1rem + env(safe-area-inset-bottom)); }
}
@media (min-width: 60em), (orientation: landscape) and (max-height: 31.25em) { .pp-bar { display: none; } }
@media (orientation: landscape) and (max-height: 31.25em) {
  body.has-ppbar .site-footer { padding-bottom: calc(1.75rem + env(safe-area-inset-bottom)); }
  body.has-ppbar .toast-region { bottom: calc(1rem + env(safe-area-inset-bottom)); }
}

/* ---- large view ---- */
.modal.pp-view {
  width: 100vw; max-width: none;
  height: 100vh; height: 100dvh; max-height: none;
  margin: 0; border: 0;
  background: rgba(0, 0, 0, 0.97);
  overflow: hidden;
}
.pp-view[open] { display: grid; place-items: center; }
.pp-view__fig { width: 100%; height: 100%; display: grid; place-items: center; padding: 3.75rem 4.5rem; }
.pp-view__img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.pp-view__close { position: absolute; top: 0.75rem; right: 0.75rem; z-index: 2; background: rgba(0, 0, 0, 0.78); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28); }
.pp-view__count { position: absolute; left: 0; right: 0; bottom: 1rem; text-align: center; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.pp-view .pp__arrow--prev { left: 1rem; }
.pp-view .pp__arrow--next { right: 1rem; }
@media (max-width: 40em) { .pp-view__fig { padding: 3.5rem 0.5rem; } .pp-view .pp__arrow--prev { left: 0.5rem; } .pp-view .pp__arrow--next { right: 0.5rem; } }

@media (forced-colors: active) {
  .pp__thumb[aria-current="true"] { outline: 3px solid Highlight; }
  .pp__arrow { border: 1px solid ButtonText; }
  .pp__buy .btn { border: 2px solid ButtonText; }
  .pp__zoom:focus-visible::after { outline: 3px solid Highlight; outline-offset: -3px; }
}
