:root {
  --bg: #f3f1ec;
  --paper: #fff;
  --ink: #171717;
  --muted: #716c65;
  --line: #ded9d1;
  --soft: #e9e5dd;
  --dark: #171717;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html {
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

img { display: block; max-width: 100%; }
a, button { -webkit-tap-highlight-color: transparent; }

.product-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: rgba(243, 241, 236, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.product-header-in {
  width: 100%;
  max-width: 720px;
  height: 58px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.product-back {
  min-width: 0;
  padding: 10px 4px;
  color: #292725;
  font-size: 14px;
  text-decoration: none;
}

.product-brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  margin-right: -4px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
  text-decoration: none;
}

.product-main {
  width: 100%;
  max-width: 720px;
  min-width: 0;
  margin: 0 auto;
  padding: 10px 14px calc(126px + var(--safe-bottom));
}

.product-gallery {
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
}

.gallery-track {
  width: 100%;
  min-width: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

.gallery-track::-webkit-scrollbar,
.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-panel {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  scroll-margin-top: 68px;
}

.gallery-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 24px;
  background: #1c1b19;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .13);
}

.gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #1c1b19;
}

.gallery-counter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(15, 15, 15, .76);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gallery-hint {
  min-height: 40px;
  padding: 8px 2px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #88827a;
  font-size: 11px;
}

.gallery-arrows { display: flex; gap: 8px; }

.gallery-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #625d56;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
}

.gallery-arrow.is-disabled {
  opacity: .25;
  pointer-events: none;
}

.gallery-thumbs {
  width: 100%;
  max-width: 100%;
  padding: 2px 0 6px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gallery-thumb {
  flex: 0 0 61px;
  width: 61px;
  height: 76px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #dedbd5;
  opacity: .54;
  text-decoration: none;
  transition: opacity .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb.is-active {
  opacity: 1;
  border-color: #1d1b19;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}

.product-meta {
  padding: 22px 2px 10px;
  scroll-margin-top: 70px;
}

.product-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.product-title {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.03;
  letter-spacing: -.045em;
}

.product-lead {
  margin: 0 0 14px;
  color: #504b45;
  font-size: 15px;
  line-height: 1.48;
}

.product-price {
  margin: 0 0 14px;
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -.035em;
}

.product-change {
  padding: 14px 15px;
  border: 1px solid #d8d2c8;
  border-radius: 18px;
  background: var(--paper);
  color: #57514a;
  font-size: 13px;
  line-height: 1.45;
}

.product-change b {
  display: block;
  margin-bottom: 2px;
  color: #1d1b19;
}

.product-primary {
  min-height: 54px;
  margin: 12px 0 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 16px;
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.product-primary small,
.sticky-contact small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  opacity: .7;
}

.product-facts {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.product-fact {
  min-width: 0;
  padding: 11px 9px;
  border-radius: 14px;
  background: var(--soft);
}

.product-fact b {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.product-fact span {
  display: block;
  color: #655f58;
  font-size: 10px;
  line-height: 1.25;
}

.product-section { padding: 30px 2px 0; }

.product-section h2 {
  margin: 0 0 8px;
  font-size: 25px;
  line-height: 1.08;
  letter-spacing: -.03em;
}

.product-section > p {
  margin: 0 0 14px;
  color: #615b54;
  font-size: 13px;
  line-height: 1.5;
}

.product-context {
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .05);
}

.product-context img { width: 100%; height: auto; }

.product-context-copy { padding: 14px 15px 16px; }

.product-context-copy b {
  display: block;
  margin-bottom: 5px;
  font-size: 16px;
}

.product-context-copy span {
  display: block;
  color: #68615a;
  font-size: 12px;
  line-height: 1.45;
}

.product-options { display: grid; gap: 8px; }

.product-option {
  position: relative;
  padding: 13px 42px 13px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  color: #393530;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.product-option b {
  display: block;
  margin-bottom: 3px;
  color: #1d1b19;
}

.product-option::after {
  content: "↑";
  position: absolute;
  top: 50%;
  right: 15px;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: #514b44;
  font-size: 13px;
}

.product-final {
  margin: 30px 2px 4px;
  padding: 18px;
  border-radius: 20px;
  background: var(--soft);
}

.product-final h2 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -.02em;
}

.product-final p {
  margin: 0;
  color: #57514a;
  font-size: 13px;
  line-height: 1.48;
}

.sticky-contact {
  position: fixed;
  z-index: 70;
  left: 14px;
  right: 72px;
  bottom: calc(12px + var(--safe-bottom));
  max-width: 642px;
  min-height: 58px;
  margin: 0 auto;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 18px;
  background: var(--dark);
  color: #fff;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .24);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.to-top {
  position: fixed;
  z-index: 71;
  right: 14px;
  bottom: calc(12px + var(--safe-bottom));
  width: 48px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: #1b1b1b;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
  font-size: 19px;
  text-decoration: none;
}

.contact-choice {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(17, 15, 14, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.contact-choice.is-open,
.contact-choice:target {
  opacity: 1;
  pointer-events: auto;
}

.contact-sheet {
  width: min(620px, 100%);
  padding: 20px 16px calc(20px + var(--safe-bottom));
  border-radius: 28px 28px 0 0;
  background: #fff;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .22);
}

.contact-sheet h2 { margin: 4px 0 5px; font-size: 24px; }
.contact-sheet > p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.45; }

.messenger {
  margin-top: 9px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
}

.messenger > span { color: inherit; font-size: inherit; }
.messenger b { display: block; color: var(--ink); font-size: 14px; }
.messenger b + span { color: var(--muted); font-size: 12px; }

.sheet-close {
  display: block;
  margin-top: 12px;
  padding: 12px;
  color: #777;
  text-align: center;
  text-decoration: none;
}

/* Anchor fallback: thumbnail state still changes if JavaScript is unavailable. */
body:has(.gallery-panel:target) .gallery-thumb.is-active {
  opacity: .54;
  border-color: transparent;
  box-shadow: none;
}

body:has(#gerb-photo-1:target) .gallery-thumb[href="#gerb-photo-1"],
body:has(#gerb-photo-2:target) .gallery-thumb[href="#gerb-photo-2"],
body:has(#gerb-photo-3:target) .gallery-thumb[href="#gerb-photo-3"],
body:has(#gerb-photo-4:target) .gallery-thumb[href="#gerb-photo-4"],
body:has(#gerb-photo-5:target) .gallery-thumb[href="#gerb-photo-5"],
body:has(#gerb-photo-6:target) .gallery-thumb[href="#gerb-photo-6"],
body:has(#gerb-photo-7:target) .gallery-thumb[href="#gerb-photo-7"],
body:has(#gerb-photo-8:target) .gallery-thumb[href="#gerb-photo-8"],
body:has(#gerb-photo-9:target) .gallery-thumb[href="#gerb-photo-9"],
body:has(#personal-photo-1:target) .gallery-thumb[href="#personal-photo-1"],
body:has(#personal-photo-2:target) .gallery-thumb[href="#personal-photo-2"],
body:has(#personal-photo-3:target) .gallery-thumb[href="#personal-photo-3"],
body:has(#personal-photo-4:target) .gallery-thumb[href="#personal-photo-4"],
body:has(#personal-photo-5:target) .gallery-thumb[href="#personal-photo-5"],
body:has(#personal-photo-6:target) .gallery-thumb[href="#personal-photo-6"],
body:has(#personal-photo-7:target) .gallery-thumb[href="#personal-photo-7"],
body:has(#personal-photo-8:target) .gallery-thumb[href="#personal-photo-8"],
body:has(#personal-photo-9:target) .gallery-thumb[href="#personal-photo-9"],
body:has(#personal-photo-10:target) .gallery-thumb[href="#personal-photo-10"],
body:has(#personal-photo-11:target) .gallery-thumb[href="#personal-photo-11"] {
  opacity: 1;
  border-color: #1d1b19;
}

@media (min-width: 650px) {
  .product-title { font-size: 43px; }
  .product-main { padding-top: 14px; }
  .gallery-frame { aspect-ratio: 4 / 5; }
}

@media (max-width: 390px) {
  .product-main { padding-left: 12px; padding-right: 12px; }
  .product-header-in { padding-left: 12px; padding-right: 12px; }
  .gallery-frame { border-radius: 20px; }
  .product-title { font-size: 32px; }
  .gallery-thumb { flex-basis: 58px; width: 58px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html, .gallery-track, .gallery-thumbs { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
