/* CLUBB Route Layer V2
   One DOM, one history, persistent app shell. */

:root {
  --clubb-route-top: 72px;
  --clubb-route-rail: clamp(80px, 6.2vw, 96px);
}

.clubb-route-layer {
  position: fixed;
  inset: 0;
  z-index: 2200;
  visibility: hidden;
  pointer-events: none;
}

.clubb-route-layer[aria-hidden="false"] {
  visibility: visible;
  pointer-events: auto;
}

.clubb-route-layer__backdrop {
  position: absolute;
  inset: var(--clubb-route-top) 0 0 0;
  border: 0;
  padding: 0;
  background: rgba(18,14,11,.18);
  opacity: 0;
  transition: opacity .28s ease;
  cursor: default;
}

.clubb-route-layer__panel {
  position: absolute;
  top: var(--clubb-route-top);
  right: 0;
  bottom: 0;
  width: calc(100vw - var(--clubb-route-rail));
  max-width: 1720px;
  overflow: hidden;
  border-radius: 24px 0 0 0;
  background: #f8f3eb;
  box-shadow: -28px 0 84px rgba(42,33,28,.18);
  transform: translate3d(101.5%,0,0);
  transition: transform .38s cubic-bezier(.22,.78,.24,1);
  will-change: transform;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
}

body.clubb-theme-heritage .clubb-route-layer__panel {
  background: #100d0b;
  box-shadow: -30px 0 90px rgba(0,0,0,.42);
}

.clubb-route-layer.is-open .clubb-route-layer__backdrop { opacity: 1; }
.clubb-route-layer.is-open .clubb-route-layer__panel { transform: translate3d(0,0,0); }

.clubb-route-layer__bar {
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(42,33,28,.08);
  background: color-mix(in srgb,#f8f3eb 93%,transparent);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 6;
}

body.clubb-theme-heritage .clubb-route-layer__bar {
  border-color: rgba(255,255,255,.08);
  background: color-mix(in srgb,#100d0b 93%,transparent);
}

.clubb-route-layer__nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.clubb-route-layer__back,
.clubb-route-layer__dismiss {
  border: 0;
  background: transparent;
  color: #2a211c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

body.clubb-theme-heritage .clubb-route-layer__back,
body.clubb-theme-heritage .clubb-route-layer__dismiss {
  color: #f8f2ea;
}

.clubb-route-layer__back {
  gap: 8px;
  min-height: 40px;
  padding: 0 4px;
  font: 650 12px/1 var(--font-text,sans-serif);
}

.clubb-route-layer__dismiss {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 17px;
}

.clubb-route-layer__back:hover,
.clubb-route-layer__dismiss:hover {
  background: rgba(42,33,28,.06);
}

body.clubb-theme-heritage .clubb-route-layer__back:hover,
body.clubb-theme-heritage .clubb-route-layer__dismiss:hover {
  background: rgba(255,255,255,.07);
}

.clubb-route-layer__steps {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(42,33,28,.36);
  font: 600 11px/1 var(--font-text,sans-serif);
  letter-spacing: .025em;
  white-space: nowrap;
}

body.clubb-theme-heritage .clubb-route-layer__steps {
  color: rgba(248,242,234,.34);
}

.clubb-route-layer__steps span {
  transition: color .18s ease, opacity .18s ease;
}

.clubb-route-layer__steps span.is-active {
  color: #2a211c;
}

body.clubb-theme-heritage .clubb-route-layer__steps span.is-active {
  color: #f8f2ea;
}

.clubb-route-layer__viewport {
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.clubb-route-layer__content {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #f8f3eb;
  opacity: 0;
  transform: translate3d(24px,0,0);
  transition: opacity .2s ease, transform .25s cubic-bezier(.22,.78,.24,1);
}

body.clubb-theme-heritage .clubb-route-layer__content {
  background: #100d0b;
}

.clubb-route-layer__content.is-ready {
  opacity: 1;
  transform: translate3d(0,0,0);
}

.clubb-route-layer__content.is-leaving-forward {
  opacity: 0;
  transform: translate3d(-22px,0,0);
}

.clubb-route-layer__content.is-leaving-back {
  opacity: 0;
  transform: translate3d(22px,0,0);
}

.clubb-route-layer__loading {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: #f8f3eb;
  color: rgba(42,33,28,.56);
  font: 600 12px/1.3 var(--font-text,sans-serif);
  letter-spacing: .02em;
  transition: opacity .16s ease, visibility .16s ease;
}

body.clubb-theme-heritage .clubb-route-layer__loading {
  background: #100d0b;
  color: rgba(248,242,234,.58);
}

.clubb-route-layer__loading.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.clubb-route-layer__spinner {
  width: 26px;
  height: 26px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: clubbRouteLayerSpin .72s linear infinite;
}

@keyframes clubbRouteLayerSpin { to { transform: rotate(360deg); } }

html:has(body.clubb-route-layer-open) {
  overflow: hidden;
  scrollbar-gutter: stable;
}

body.clubb-route-layer-open .clubb-home-shell-content,
body.clubb-route-layer-open > .clubb-cadastur,
body.clubb-route-layer-open > footer {
  transform: none;
  transition: opacity .22s ease;
}

body.clubb-route-layer-open .clubb-home-shell-content,
body.clubb-route-layer-open > footer,
body.clubb-route-layer-open > .clubb-cadastur {
  opacity: .92;
}

/* PDP adaptation inside the native layer. */
.clubb-route-layer .clubb-route-fragment--product {
  min-height: 100%;
}

.clubb-route-layer .clubb-product-page {
  padding: 34px 0 72px;
}

.clubb-route-layer .clubb-product-page > .container {
  width: min(100% - 48px, 1320px);
  max-width: 1320px;
}

.clubb-route-layer .clubb-product-top__title {
  font-size: clamp(34px,3.8vw,58px);
}

.clubb-route-layer .clubb-pdp-heading {
  margin-top: 2px;
}

.clubb-route-layer .clubb-product-sidebar {
  top: 18px;
}

.clubb-route-layer .clubb-product-sticky-cta {
  bottom: 20px;
}

/* Generic route fragments. */
.clubb-route-fragment {
  min-height: 100%;
}

.clubb-route-fragment--cart,
.clubb-route-fragment--checkout {
  padding: 34px 24px 72px;
}

.clubb-route-fragment--cart > *,
.clubb-route-fragment--checkout > * {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 900px) {
  :root { --clubb-route-rail: 0px; }

  html:has(body.clubb-route-layer-open) { scrollbar-gutter: auto; }
  .clubb-route-layer__panel {
    width: 100%;
    border-radius: 0;
  }

  .clubb-route-layer__steps {
    display: none;
  }

  .clubb-route-layer__bar {
    padding: 0 12px;
  }

  .clubb-route-layer .clubb-product-page > .container {
    width: min(100% - 28px, 1320px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .clubb-route-layer__panel,
  .clubb-route-layer__backdrop,
  .clubb-route-layer__content,
  .clubb-route-layer__loading,
  body.clubb-route-layer-open .clubb-home-shell-content,
  body.clubb-route-layer-open > footer,
  body.clubb-route-layer-open > .clubb-cadastur {
    transition: none !important;
  }

  .clubb-route-layer__spinner {
    animation-duration: 1.4s;
  }
}

/* Recovery R5: Route Layer infrastructure only. */
body.clubb-route-layer-open{overflow:hidden;overscroll-behavior:none}
.clubb-route-layer.is-product-stage .clubb-route-layer__steps,.clubb-route-layer.is-account-stage .clubb-route-layer__steps,.clubb-route-layer.is-planner-stage .clubb-route-layer__steps{display:none}
.clubb-route-layer.is-account-stage .clubb-route-layer__bar,.clubb-route-layer.is-planner-stage .clubb-route-layer__bar{min-height:52px}

/* R4 close-motion guard */
.clubb-route-layer.is-closing{pointer-events:none}
.clubb-route-layer.is-closing .clubb-route-layer__backdrop{opacity:0}

/* R3 hardening: a hidden loader can never intercept interaction. */
.clubb-route-layer__loading.is-hidden {
  pointer-events: none !important;
}
