/* ============================================================
   PDP — Product Detail Page
   Terminal re-skin: transparent shell on the themed body, follows
   the blue/dark theme variables. Photos stay on neutral light tiles.
   ============================================================ */

/* ---------- layout shell ---------- */
.pdp {
  padding: 22px;
  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
}

/* Give the PDP room to breathe: widen the shared shop container while a
   product page is open (reverts to the tight column on the shell). */
body.pdp-open .container.shop {
  max-width: 1200px;
}

/* ---------- back button ---------- */
.pdp .pdp-back {
  background: none;
  border: none;
  font: inherit;
  font-size: 12px;
  color: var(--text-color);
  cursor: pointer;
  padding: 0;
  margin-bottom: 18px;
  letter-spacing: .06em;
  display: inline-block;
}
.pdp .pdp-back:hover { opacity: .7; }

/* ---------- two-column layout: media (2/3) + info (1/3) ---------- */
.pdp .pdp-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  align-items: start;
}

/* sticky info column scrolls with the page until it runs out */
.pdp .info {
  position: sticky;
  top: 24px;
  align-self: start;
  min-width: 0;            /* let the size table scroll instead of stretching */
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- media: single column of tappable square images ---------- */
.pdp .media {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.pdp .media-cell {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 0;
  padding: 0;
  margin: 0;
  background: #f3f3f4;
  cursor: zoom-in;
}

.pdp .media-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* carousel dots — mobile-only (shown in the ≤750px block below) */
.pdp .media-dots {
  display: none;
}

/* ---------- breadcrumb ---------- */
.pdp .crumb {
  font-size: 11px;
  color: color-mix(in srgb, var(--accent-color) 55%, transparent);
  letter-spacing: .06em;
  margin: 18px 0 14px;
}

/* title */
.pdp .title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-transform: uppercase;
  line-height: .98;
}

/* divider rule under the price */
.pdp .rule {
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--accent-color) 22%, transparent);
  margin: 0;
}

/* option group label */
.pdp .lab {
  font-size: 12px;
  color: color-mix(in srgb, var(--accent-color) 75%, transparent);
  margin-bottom: 9px;
}

/* option groups row (spacing handled by the .info column gap) */
.pdp .optgroup {
  margin-bottom: 0;
}

/* size pill buttons */
.pdp .sizes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pdp .opts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pdp .sz {
  min-width: 52px;
  text-align: center;
  padding: 11px 0;
  border: 1px solid color-mix(in srgb, var(--accent-color) 28%, transparent);
  border-radius: 0;
  font-size: 13px;
  cursor: pointer;
  background: none;
  font-family: inherit;
  color: inherit;
  transition: background .1s, color .1s, border-color .1s;
}

.pdp .sz.sel {
  background: var(--accent-color);
  color: var(--bg-color);
  border-color: var(--accent-color);
}

.pdp .sz.out {
  color: color-mix(in srgb, var(--text-color) 45%, transparent);
  border-color: color-mix(in srgb, var(--accent-color) 14%, transparent);
  text-decoration: line-through;
  cursor: default;
}

.pdp .sz:hover:not(.sel):not(.out) {
  border-color: color-mix(in srgb, var(--accent-color) 70%, transparent);
}

/* ---------- price (sits just under the title) ---------- */
.pdp .price {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* ---------- buy row: qty stepper + Add to cart on one line ---------- */
.pdp .buyrow {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

/* quantity stepper — outlined, squared */
.pdp .qty {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  border: 1px solid color-mix(in srgb, var(--accent-color) 28%, transparent);
  border-radius: 0;
  padding: 0 16px;
}

.pdp .qty b {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  user-select: none;
  line-height: 1;
  color: var(--text-color);
}

/* native "Buy with Shop" Shop Pay button — full width, squared to match.
   The component's brand-purple internals live in a shadow root out of CSS
   reach, so it's recolored with a composited filter tuned per theme
   (--shoppay-filter). The height prop isn't honored by the component, so the
   host is a flex container that stretches the inner button to ADD TO CART's
   rendered height. */
.pdp .shoppay {
  display: flex;
  align-items: stretch;
  height: 52px;
  width: 100%;
  --shop-pay-button-width: 100%;
  --shop-pay-button-border-radius: 0;
  filter: var(--shoppay-filter);
}

.pdp .btn {
  flex: 1;
  padding: 17px;
  border-radius: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  background: none;
  color: inherit;
  transition: opacity .1s;
}

.pdp .btn:disabled {
  opacity: .4;
  cursor: default;
}

.pdp .btn.add {
  background: var(--accent-color);
  color: var(--bg-color);
  border: 1.5px solid var(--accent-color);
}

.pdp .btn.add:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-color) 85%, var(--bg-color));
  border-color: color-mix(in srgb, var(--accent-color) 85%, var(--bg-color));
}

/* ---------- sold out notice ---------- */
.pdp .soldout {
  font-size: 12px;
  color: var(--error-color);
  font-weight: 600;
  margin: 8px 0 0;
  letter-spacing: .04em;
}

/* ---------- product description / size-guide table ---------- */
.pdp .details {
  border-top: 1px solid color-mix(in srgb, var(--accent-color) 22%, transparent);
  margin-top: 18px;
  padding-top: 14px;
  font-size: 12px;
  color: color-mix(in srgb, var(--text-color) 75%, transparent);
  overflow-x: auto;   /* lets a wide inline table scroll instead of blowing layout */
  -webkit-overflow-scrolling: touch;
}

.pdp .details table {
  max-width: 100%;
  width: 100% !important;   /* override inline width:1024px */
  border-collapse: collapse;
  font-size: 12px;
}

/* !important: Shopify description HTML ships inline border/background on
   every cell (#e2e2e2 / #F8F8F8 zebra) — illegible on the themed bg. */
.pdp .details table td,
.pdp .details table th {
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--accent-color) 22%, transparent) !important;
  background: transparent !important;
  text-align: left;
  vertical-align: top;
}

.pdp .details table th {
  background: color-mix(in srgb, var(--accent-color) 14%, transparent) !important;
  font-weight: 600;
  color: var(--text-color);
}

.pdp .details p,
.pdp .details ul,
.pdp .details ol {
  margin: 0 0 8px;
}

/* ---------- mobile ---------- */
@media (max-width: 750px) {
  .pdp {
    padding: 14px;
  }

  /* single column: media stacked above the info */
  .pdp .pdp-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* swipeable carousel: one full-width image per swipe */
  .pdp .media {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .pdp .media::-webkit-scrollbar {
    display: none;
  }

  .pdp .media-cell {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }

  /* info no longer sticky once it sits below the images */
  .pdp .info {
    position: static;
  }

  .pdp .title {
    font-size: 28px;
  }

  /* carousel dots track the swipeable media position */
  .pdp .media-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
  }

  .pdp .mdot {
    width: 7px;
    height: 7px;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: color-mix(in srgb, var(--accent-color) 30%, transparent);
  }

  .pdp .mdot.on {
    background: var(--accent-color);
  }
}

/* ============================================================
   Fullscreen image viewer (built by gallery.js)
   ============================================================ */
html.pv-lock { overflow: hidden; }

.pdp-viewer {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
}

.pdp-viewer::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

/* vertical scroll list of full-size images */
.pdp-viewer .pv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.pdp-viewer .pv-item {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  padding: 24px;
  box-sizing: border-box;
}

.pdp-viewer .pv-item img {
  max-width: 100%;
  max-height: calc(100vh - 48px);
  object-fit: contain;
  display: block;
}

/* thumbnail rail, fixed on the right edge */
.pdp-viewer .pv-rail {
  position: fixed;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: none;
}
.pdp-viewer .pv-rail::-webkit-scrollbar { display: none; }

.pdp-viewer .pv-thumb {
  width: 64px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  background: #f3f3f4;
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s, border-color .15s;
}

.pdp-viewer .pv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdp-viewer .pv-thumb[aria-selected="true"] {
  opacity: 1;
  border-color: var(--accent-color);
}

/* circular close button, top-right (inverts against the image behind it) */
.pdp-viewer .pv-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  mix-blend-mode: difference;
  cursor: pointer;
  z-index: 2;
}
.pdp-viewer .pv-close:hover { opacity: .8; }

@media (max-width: 750px) {
  .pdp-viewer .pv-rail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pdp-viewer .pv-list { scroll-behavior: auto; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .pdp .sz,
  .pdp .btn {
    transition: none;
  }
}

/* ===== Cart drawer (terminal panel) ===== */

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity .3s ease;
  z-index: 90;
}

.cart-backdrop.open {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .cart-backdrop { transition: none; }
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(26rem, 92vw);
  background: var(--bg-color);
  color: var(--text-color);
  border-left: 1px solid color-mix(in srgb, var(--accent-color) 45%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent-color) 10%, transparent);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.16, 1, .3, 1),
              background-color var(--transition-duration) ease,
              color var(--transition-duration) ease;
  z-index: 100;
  overflow-y: auto;
}

.cart-drawer.open {
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .cart-drawer { transition: none; }
}

@media (max-width: 640px) {
  .cart-drawer { width: 100%; }
}

/* head */
.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .04em;
}

.cart-close {
  background: none;
  border: none;
  padding: 4px 6px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-color);
}

.cart-close:hover {
  opacity: .7;
}

.cart-close:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* lines */
.cart-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.cart-line {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 12px;
}

.cl-img {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 4px;
  overflow: hidden;
  background: #f3f3f4;
  flex-shrink: 0;
}

.cl-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cl-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cl-title {
  font-weight: 600;
  font-size: .875rem;
  line-height: 1.3;
}

.cl-var {
  font-size: .75rem;
  color: color-mix(in srgb, var(--accent-color) 75%, transparent);
}

.cl-ctl {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  margin-top: 4px;
  flex-wrap: wrap;
}

/* inline qty stepper (uses <b> tags from renderCart) */
.cl-ctl .qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
}

.cl-ctl .qty b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--accent-color) 28%, transparent);
  border-radius: 0;
  cursor: pointer;
  font-weight: 400;
  font-size: .85rem;
  user-select: none;
  background: none;
  color: var(--text-color);
  line-height: 1;
}

.cl-ctl .qty b:hover {
  border-color: color-mix(in srgb, var(--accent-color) 70%, transparent);
}

.cl-ctl .qty b:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 1px;
}

.cl-rm {
  background: none;
  border: none;
  padding: 0;
  font-size: .8rem;
  color: color-mix(in srgb, var(--text-color) 70%, transparent);
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.cl-rm:hover {
  color: var(--text-color);
}

.cl-rm:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.cl-price {
  margin-left: auto;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
}

/* foot */
.cart-foot {
  border-top: 1px solid color-mix(in srgb, var(--accent-color) 22%, transparent);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-sub {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: .9rem;
}

.cart-checkout {
  width: 100%;
  padding: 15px;
  background: var(--accent-color);
  color: var(--bg-color);
  border: none;
  border-radius: 0;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.cart-checkout:hover {
  background: color-mix(in srgb, var(--accent-color) 85%, var(--bg-color));
}

.cart-checkout:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}

.cart-empty {
  color: color-mix(in srgb, var(--text-color) 70%, transparent);
  font-size: .9rem;
  padding: 8px 0;
}

/* ===== shared focus idiom (terminal accent outline) ===== */
.pdp .pdp-back:focus-visible,
.pdp .media-cell:focus-visible,
.pdp .sz:focus-visible,
.pdp .btn:focus-visible,
.pdp .qty b:focus-visible,
.pdp .mdot:focus-visible,
.pdp-viewer .pv-thumb:focus-visible,
.pdp-viewer .pv-close:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* ===== themed scrollbars (mirrors .listwrap in shop.css) ===== */
.cart-drawer::-webkit-scrollbar,
.pdp .details::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.cart-drawer::-webkit-scrollbar-thumb,
.pdp .details::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent-color) 30%, transparent);
  border-radius: 3px;
}
