/* Shop / product page. Loads after styles.css (tokens, header, set options and
   notify form come from there). */

body.shop-page { min-height: 100vh; min-height: 100dvh; background: var(--bg); }

/* header: same look as the home page, but in normal page flow */
html body.shop-page .hdr { position: relative; top: 0; margin: calc(30px * var(--hs, 1)) auto 0; }
.hdr .nav-link[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* layout: photo left, choices right */
.product {
  /* Drawn at the 1440px design size, then scaled by the same factor as the home page
     and the header (--hs), so the whole page keeps the design's proportions and
     its edges line up with the header. */
  zoom: var(--hs, 1);
  box-sizing: border-box; max-width: 1440px; margin: 0 auto;
  padding: 104px 60px 80px;
  display: grid; grid-template-columns: minmax(0, 743fr) minmax(0, 520fr); gap: 44px;
  align-items: start;
}

/* gallery */
.gallery { position: relative; aspect-ratio: 743 / 713; background: #1a1a1a; overflow: hidden; }
.gallery-track {
  display: flex; height: 100%; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  outline: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.gallery-track.swap { animation: gallery-in .35s ease; }
@keyframes gallery-in { from { opacity: 0; } to { opacity: 1; } }
@media (hover: hover) { .gallery-track { cursor: pointer; } }
.gallery-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; }
.gallery-slide img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }

.gallery-dots {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: flex; gap: 0;
}
/* 20px tap target around an 8px dot */
.gallery-dots button {
  width: 20px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.gallery-dots button::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: rgba(215, 213, 212, .55); transition: background .2s ease;
}
.gallery-dots button:hover::after { background: rgba(215, 213, 212, .9); }
.gallery-dots button[aria-current="true"]::after { background: var(--accent); }
.gallery-dots button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 50%; }

/* right column (title, options and form reuse the popup's styles) */
.product-body { padding-top: 2px; }
.product-body .pricing-title { max-width: 440px; font-size: 40px; }
.product-body .pricing-options { margin-top: 46px; gap: 30px; }
.product-body .set-option { min-height: 106px; }

/* ---------- phones / portrait (html.m is set in the page head) ---------- */
html.m body.shop-page .hdr { margin: 16px auto 0; }
html.m .product {
  grid-template-columns: 1fr; gap: 24px;
  padding: 24px var(--pad) 48px;
}
html.m .gallery { aspect-ratio: 1 / 1; margin: 0 calc(-1 * var(--pad)); }
html.m .product-body .pricing-title { font-size: 28px; max-width: none; }
html.m .product-body .pricing-options { margin-top: 22px; gap: 12px; }
html.m .product-body .set-option { min-height: 0; }

/* tablet-ish widths that still get the two-column layout */
@media (max-width: 1100px) {
  html:not(.m) .product { padding-top: 64px; gap: 32px; }
  html:not(.m) .product-body .pricing-title { font-size: 32px; }
  html:not(.m) .set-option { grid-template-columns: 1fr 180px; }
}
