/* Keep panels and their backdrops above the navigation and device spacing. */
:root {
  --overlay-dim: rgb(0 0 0 / 42%);
  --overlay-fade: 220ms;
  --scroll-bottom-space: 40px;
  --bottom-surface: #fff;
  --bottom-shadow: 0 -4px 14px rgb(0 0 0 / 6%);
  --gnb-height: var(--service-nav-height);
  --gnb-top-space: var(--service-nav-tools-height);
  --bottom-action-inset: 6px;
  --panel-bottom-space: 30px;
  --gnb-bottom-space: var(--service-nav-bottom);
  --gnb-region-height: calc(var(--gnb-top-space) + var(--gnb-height) + var(--gnb-bottom-space));
}
.purchase-bar, #checkout .service-footer { padding-bottom: var(--bottom-action-inset); }
.gnb-region {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: var(--gnb-top-space) 0 var(--gnb-bottom-space);
  background: var(--bottom-surface);
}
.service-gnb {
  position: relative;
  isolation: isolate;
  z-index: 1;
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 16px;
  height: var(--gnb-height);
  box-sizing: border-box;
  padding: 3px 5px;
  border: 1px solid rgb(206 210 218 / 78%);
  border-radius: 999px;
  background: linear-gradient(155deg, rgb(255 255 255 / 88%), rgb(232 236 243 / 53%) 74%, rgb(255 255 255 / 75%));
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow: inset 0 1px 2px rgb(255 255 255 / 95%), 0 3px 12px rgb(38 46 61 / 10%);
}
.service-gnb a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  min-height: 42px;
  border-radius: 999px;
  color: #0d0d0d;
  font-size: 10px;
  line-height: 16px;
  text-decoration: none;
}
.service-gnb::before {
  content: "";
  position: absolute;
  inset: 3px auto 3px 5px;
  width: calc((100% - 10px) / 5);
  border-radius: 999px;
  background: linear-gradient(145deg, rgb(204 207 213 / 76%), rgb(233 235 239 / 82%));
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow: inset 0 1px 2px rgb(255 255 255 / 65%);
  transform: translateX(calc(var(--gnb-index, 1) * 100%)) scaleX(1.12);
  transition: transform 260ms cubic-bezier(.2, .8, .25, 1);
  pointer-events: none;
  z-index: -1;
}
.service-gnb [aria-current="page"] { font-weight: 600; }
.service-gnb a:not([aria-current="page"]) { color: #737378; }
@media (prefers-reduced-motion: reduce) {
  .service-gnb::before { transition: none; }
}
.service-gnb .gnb-selected-icon { display: none; fill: currentColor; stroke: none; }
.service-gnb [aria-current="page"] svg:not(.gnb-selected-icon) { display: none; }
.service-gnb [aria-current="page"] .gnb-selected-icon { display: block; }
.service-gnb .gnb-cutout { fill: none; stroke: #fff; stroke-width: 1.6; }
.service-gnb a:focus-visible { outline: 2px solid #222; outline-offset: 1px; }
.service-gnb svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3333;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 600px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  :root { --bottom-action-inset: 10px; }
  .service-gnb { margin-bottom: var(--gnb-bottom-space); }
}

.purchase-bar > .scroll-up, #checkout .service-footer > .scroll-up, .gnb-region > .scroll-up {
  position: absolute;
  right: 12px;
  bottom: calc(100% + 10px);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #222;
  color: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 14%);
  cursor: pointer;
}
.scroll-up svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.scroll-up[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

@media (max-width: 375px) {
  :root {
    --compact-item-gap: clamp(8px, calc(7.27vw - 15.27px), 12px);
    --compact-thumbnail: clamp(64px, calc(21.82vw - 5.82px), 76px);
  }
}

.bottom-sheet-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 24px; }

.preview-shell {
  --preview-screen-height: min(812px, calc(100vh - 46px));
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  justify-items: center;
  align-items: safe center;
  padding: 12px 0;
}
@supports (height: 100dvh) {
  .preview-shell { --preview-screen-height: min(812px, calc(100dvh - 46px)); }
}
@media (max-width: 600px), (hover: none) and (pointer: coarse) and (max-width: 1024px) {
  .preview-shell { display: block; padding: 0; }
}

/* Use the same solid header regardless of display mode or transparency preference. */
.preview-shell .service-header {
  position: relative;
  isolation: isolate;
  background: #fff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
