.product-detail-page {
  min-height: 100vh;
  background: var(--bg);
}

.product-detail-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.product-detail-nav {
  width: min(calc(100% - 40px), 980px);
  height: 78px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.product-detail-back,
.product-theme-toggle {
  min-height: 40px;
  width: fit-content;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .7rem;
  font-weight: 700;
  transition: .2s ease;
}

.product-detail-back:hover,
.product-theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.product-detail-brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .14em;
}

.product-detail-brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  background: #000;
}

.product-theme-toggle {
  justify-self: end;
  cursor: pointer;
}

.theme-switch {
  width: 36px;
  height: 20px;
  padding: 2px;
  border-radius: 99px;
  background: var(--solid);
  display: flex;
  align-items: center;
}

.theme-switch i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--solid-text);
  transform: translateX(16px);
  transition: transform .22s ease;
}

html[data-theme="light"] .theme-switch i {
  transform: translateX(0);
}

.product-detail-main {
  width: min(calc(100% - 40px), 980px);
  margin: 0 auto;
  padding: 46px 0 100px;
}

.product-gallery {
  position: relative;
}

.product-gallery-viewport {
  position: relative;
  height: clamp(320px, 54vw, 560px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #050505;
  box-shadow: var(--shadow);
  touch-action: pan-y;
  user-select: none;
}

.product-gallery-track {
  height: 100%;
  display: flex;
  transform: translate3d(0, 0, 0);
  transition: transform .36s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}

.product-gallery-track.is-dragging {
  transition: none;
}

.product-gallery-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.055), transparent 54%),
    #050505;
}

.product-gallery-slide > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  -webkit-user-drag: none;
}

.product-gallery-slide:first-child > img {
  object-fit: cover;
  filter: grayscale(.72) contrast(1.04) brightness(.72);
  transform: scale(1.02);
  transition: transform 5s ease, filter .35s ease;
}

.product-gallery-viewport:hover .product-gallery-slide:first-child.is-active > img {
  transform: scale(1.07);
  filter: grayscale(.48) contrast(1.04) brightness(.78);
}

.product-detail-thumb-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.88), rgba(0,0,0,.18) 68%),
    linear-gradient(0deg, rgba(0,0,0,.62), transparent 58%);
  pointer-events: none;
}

.product-detail-thumb-copy {
  position: absolute;
  left: clamp(24px, 6vw, 64px);
  bottom: clamp(28px, 6vw, 58px);
  z-index: 2;
  display: grid;
  gap: 7px;
  color: #fff;
  pointer-events: none;
}

.product-detail-thumb-copy span,
.product-detail-kicker {
  font-family: "JetBrains Mono", monospace;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .14em;
}

.product-detail-thumb-copy span { color: #c9c9c9; }

.product-detail-thumb-copy strong {
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: .96;
  letter-spacing: -.055em;
}

.product-detail-thumb-copy small {
  color: #c2c2c2;
  font-size: .74rem;
}

.product-gallery-button {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: rgba(8,8,8,.72);
  color: #fff;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}

.product-gallery-button:hover {
  background: rgba(24,24,24,.88);
  border-color: rgba(255,255,255,.34);
}

.product-gallery-button:active {
  transform: translateY(-50%) scale(.94);
}

.product-gallery-button:focus-visible,
.product-gallery-dots button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.product-gallery-prev { left: 18px; }
.product-gallery-next { right: 18px; }

.product-gallery-counter {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  min-width: 54px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(8,8,8,.72);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: .62rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.product-gallery-dots {
  min-height: 42px;
  padding: 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.product-gallery-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: pointer;
  transition: width .2s ease, background .2s ease, opacity .2s ease;
}

.product-gallery-dots button.is-active {
  width: 28px;
  background: var(--text);
}

.product-intro {
  padding: 50px 0 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 44px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.product-detail-kicker { color: var(--muted); }

.product-intro h1 {
  margin: 12px 0 16px;
  font-size: clamp(2.25rem, 6vw, 4.8rem);
  line-height: .98;
  letter-spacing: -.055em;
}

.product-intro p {
  max-width: 710px;
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.85;
}

.product-price-box {
  min-width: 190px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  display: grid;
  gap: 5px;
  text-align: right;
}

.product-price-box small { color: var(--muted-2); font-size: .63rem; }
.product-price-box strong { font-size: 1.65rem; letter-spacing: -.03em; }
.product-price-box span { color: var(--muted); font-size: .66rem; }

.product-info-grid {
  padding: 42px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-info-card {
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.product-info-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.product-info-heading i {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: .8rem;
}

.product-info-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.product-feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 11px;
}

.product-feature-list li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.55;
}

.product-feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--text);
  font-weight: 800;
}

.order-panel {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.order-panel-heading {
  padding: 32px 32px 26px;
  border-bottom: 1px solid var(--line);
}

.order-panel-heading h2 {
  margin: 9px 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -.045em;
}

.order-panel-heading p {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.7;
}

.order-form {
  padding: 30px 32px 32px;
  display: grid;
  gap: 21px;
}

.order-field {
  display: grid;
  gap: 9px;
}

.order-field > span {
  font-size: .78rem;
  font-weight: 700;
}

.order-field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--bg-soft);
  color: var(--text);
  font-size: .8rem;
  transition: border-color .2s, box-shadow .2s;
}

.order-field input::placeholder { color: var(--muted-2); }

.order-field input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(127,127,127,.08);
}

.order-field input.is-invalid {
  border-color: #d94a5a;
}

.order-summary {
  margin-top: 4px;
  padding: 21px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
}

.order-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: .78rem;
}

.order-summary strong {
  color: var(--text);
  font-size: .88rem;
}

.order-summary-total {
  margin-top: 4px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.order-summary-total span,
.order-summary-total strong {
  color: var(--text) !important;
  font-size: 1.25rem !important;
  font-weight: 800;
}

.order-ready {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.55;
}

.order-ready[hidden] { display: none; }
.order-ready i { margin-top: 2px; color: var(--text); }

.order-next-button {
  min-height: 56px;
  padding: 0 19px;
  border: 0;
  border-radius: 13px;
  background: var(--solid);
  color: var(--solid-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 800;
  transition: transform .2s ease, opacity .2s ease;
}

.order-next-button:hover { transform: translateY(-2px); }
.order-next-button:active { transform: translateY(0); }

.order-note {
  color: var(--muted-2);
  font-size: .61rem;
  line-height: 1.55;
  text-align: center;
}

.order-note i {
  margin-right: 6px;
}

.product-detail-footer {
  margin-top: auto;
  padding: 24px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: .58rem;
  text-align: center;
}

@media (max-width: 760px) {
  .product-detail-nav {
    width: min(calc(100% - 28px), 980px);
    grid-template-columns: auto 1fr auto;
  }

  .product-detail-brand { justify-self: center; }
  .product-detail-brand span { display: none; }

  .product-detail-back span,
  .theme-label { display: none; }

  .product-detail-back,
  .product-theme-toggle {
    width: 42px;
    min-height: 42px;
    padding: 0;
    justify-content: center;
  }

  .product-theme-toggle .theme-switch {
    width: 24px;
    height: 14px;
    padding: 2px;
  }

  .product-theme-toggle .theme-switch i {
    width: 10px;
    height: 10px;
    transform: translateX(10px);
  }

  html[data-theme="light"] .product-theme-toggle .theme-switch i {
    transform: translateX(0);
  }

  .product-detail-main {
    width: min(calc(100% - 28px), 980px);
    padding: 28px 0 74px;
  }

  .product-gallery-viewport {
    height: min(72vh, 560px);
    min-height: 380px;
    border-radius: 20px;
  }

  .product-detail-thumb-copy {
    left: 22px;
    right: 72px;
    bottom: 24px;
  }

  .product-detail-thumb-copy strong {
    font-size: 2.35rem;
  }

  .product-gallery-button {
    width: 40px;
    height: 40px;
  }

  .product-gallery-prev { left: 10px; }
  .product-gallery-next { right: 10px; }

  .product-gallery-counter {
    right: 12px;
    bottom: 12px;
  }

  .product-intro {
    padding: 34px 0;
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .product-price-box {
    min-width: 0;
    text-align: left;
  }

  .product-info-grid {
    grid-template-columns: 1fr;
    padding: 30px 0;
  }

  .product-info-card { padding: 23px; }
  .order-panel { border-radius: 20px; }
  .order-panel-heading { padding: 26px 22px 22px; }
  .order-form { padding: 24px 22px 26px; }
}

/* Gallery placement + fullscreen preview */
.product-gallery-heading {
  padding: 8px 0 22px;
}

.product-gallery-heading h2 {
  margin: 9px 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -.045em;
}

.product-gallery-heading p {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.7;
}

.product-gallery {
  margin-bottom: 28px;
}

.product-gallery-viewport {
  cursor: zoom-in;
}

.product-gallery-button {
  cursor: pointer;
}

body.gallery-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.product-gallery-modal[hidden] {
  display: none !important;
}

.product-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
}

.product-gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.product-gallery-modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.product-gallery-modal-stage {
  width: min(92vw, 1280px);
  height: min(88vh, 900px);
  display: grid;
  place-items: center;
  touch-action: pan-y;
  user-select: none;
  overflow: hidden;
}

.product-gallery-modal-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
  -webkit-user-drag: none;
  user-select: none;
}

.product-gallery-modal-close,
.product-gallery-modal-nav {
  position: absolute;
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(18,18,18,.76);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.product-gallery-modal-close:hover,
.product-gallery-modal-nav:hover {
  background: rgba(36,36,36,.92);
  border-color: rgba(255,255,255,.38);
}

.product-gallery-modal-close:active,
.product-gallery-modal-nav:active {
  transform: scale(.94);
}

.product-gallery-modal-close:focus-visible,
.product-gallery-modal-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.product-gallery-modal-close {
  top: 4px;
  right: 4px;
}

.product-gallery-modal-prev {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.product-gallery-modal-next {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.product-gallery-modal-prev:active,
.product-gallery-modal-next:active {
  transform: translateY(-50%) scale(.94);
}

.product-gallery-modal-counter {
  position: absolute;
  left: 50%;
  bottom: 4px;
  z-index: 3;
  transform: translateX(-50%);
  min-width: 64px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(8,8,8,.78);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: .65rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (max-width: 760px) {
  .product-gallery-heading {
    padding: 4px 0 18px;
  }

  .product-gallery {
    margin-bottom: 22px;
  }

  .product-gallery-modal {
    padding: 10px;
  }

  .product-gallery-modal-stage {
    width: 100%;
    height: calc(100dvh - 86px);
  }

  .product-gallery-modal-stage img {
    border-radius: 10px;
  }

  .product-gallery-modal-close,
  .product-gallery-modal-nav {
    width: 42px;
    height: 42px;
  }

  .product-gallery-modal-close {
    top: 2px;
    right: 2px;
  }

  .product-gallery-modal-prev { left: 2px; }
  .product-gallery-modal-next { right: 2px; }
  .product-gallery-modal-counter { bottom: 2px; }
}

/* Let clicks outside the preview reach the modal backdrop. */
.product-gallery-modal-content {
  pointer-events: none;
}

.product-gallery-modal-stage,
.product-gallery-modal-close,
.product-gallery-modal-nav {
  pointer-events: auto;
}
