/**
 * Craftguru storefront — unified responsive layout layer.
 * Loaded by guest-layout.js on all guest pages (after craftguru-theme.css tokens).
 * Scope: layout, overflow, touch targets — no branding changes.
 */

/* ── Global media & overflow hygiene ── */
body.guest-site img,
body.guest-site video {
  max-width: 100%;
  height: auto;
}

body.guest-site table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.guest-site .band-shop-inner,
body.guest-site .checkout-page,
body.guest-site .product-page,
body.guest-site .sub-main {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* FABs are position:fixed — avoid body padding-bottom (creates blank gap below footer). */
body.guest-site {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow-x: hidden;
  max-width: 100%;
}

/* Category sidebar rails — vertical scroll only on desktop / drawer panels */
@media (min-width: 901px) {
  body.guest-site .guest-page-category-rail,
  body.guest-site .home-category-rail,
  body.guest-site .rm-category-rail {
    overflow-x: hidden;
  }

  body.guest-site .guest-page-category-rail .category-grid--rail,
  body.guest-site .home-category-rail .category-grid--rail,
  body.guest-site .rm-category-rail .category-grid--rail {
    overflow-x: hidden;
  }
}

body.cg-rail-drawer-enabled .cg-rail-drawer-panel {
  overflow-x: hidden;
}

body.guest-site.page-home {
  scroll-padding-bottom: calc(
    var(--cg-float-edge-y, clamp(1rem, 3.5vw, 1.65rem)) +
      (var(--cg-float-fab, 3.75rem) * 2) +
      var(--cg-float-gap, 0.75rem) +
      env(safe-area-inset-bottom, 0px)
  );
}

/* Keep footer link columns clear of the stacked WA/IG FABs (non-home guest pages). */
body.guest-site:not(.page-home) .site-footer--craftguru {
  padding-right: calc(
    var(--cg-float-edge-x, clamp(1rem, 3.5vw, 1.65rem)) +
      var(--cg-float-fab, 3.75rem) +
      0.5rem
  );
}

body.guest-site:not(.page-home) {
  scroll-padding-bottom: calc(
    var(--cg-float-edge-y, clamp(1rem, 3.5vw, 1.65rem)) +
      (var(--cg-float-fab, 3.75rem) * 2) +
      var(--cg-float-gap, 0.75rem) +
      env(safe-area-inset-bottom, 0px)
  );
}

/* ── Header & navigation ── */
@media (max-width: 900px) {
  body.guest-site .site-top {
    padding-inline: clamp(0.75rem, 3vw, 1.25rem);
    gap: 0.5rem;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    align-items: center;
  }

  body.guest-site .guest-top-cluster {
    display: contents;
  }

  body.guest-site .guest-top-cluster > .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
  }

  body.guest-site .guest-header-search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: none;
    margin-top: 0.15rem;
    box-sizing: border-box;
    height: 2.5rem;
    align-items: center;
    padding: 0.1rem 0.18rem 0.1rem 0.12rem;
  }

  body.guest-site .guest-header-search__input {
    height: 2.1rem;
    padding: 0.42rem 0.85rem;
    font-size: 0.84rem;
    line-height: 1.2;
  }

  body.guest-site .guest-header-search__icon {
    width: 2.1rem;
    height: 2.1rem;
  }

  body.guest-site .site-top-end {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    gap: 0.28rem;
    max-width: min(58vw, calc(100vw - 7.5rem));
    flex-wrap: nowrap;
    min-width: 0;
  }

  body.guest-site .site-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    flex-shrink: 0;
  }

  body.guest-site .home-auth-bar {
    gap: 0.22rem;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
  }

  body.guest-site .home-auth-btn {
    padding: 0.42rem 0.52rem;
    font-size: 0.62rem;
    min-height: 2.35rem;
  }

  body.guest-site .home-header-wish {
    min-height: 2.35rem;
    padding-inline: 0.48rem;
    flex-shrink: 0;
  }

  body.guest-site .brand__logo-img {
    max-width: min(34vw, 8.5rem);
    height: auto;
    max-height: 2.5rem;
    width: auto;
    object-fit: contain;
    object-position: left center;
    border-radius: 50%;
  }

  body.guest-site .nav-dock {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding-inline: 0.15rem;
  }

  body.guest-site .nav-dock::-webkit-scrollbar {
    display: none;
  }

  body.guest-site .nav-dock-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.guest-site .site-top-end {
    gap: 0.35rem;
  }

  body.guest-site .site-top-end {
    gap: 0.35rem;
  }

  body.guest-site .btn-cart,
  body.guest-site .header-orders-link {
    min-height: 2.5rem;
  }
}

@media (max-width: 520px) {
  body.guest-site .nav-dock-link {
    padding: 0.42rem 0.58rem;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }

  body.guest-site .btn-cart-label {
    display: none;
  }
}

/* ── Header → split layout spacing (match Home .hero.hero--landing) ── */
body.guest-site .band-shop.band-shop--flush {
  margin-top: 0;
  padding-top: 0;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

body.guest-site .rm-shop-layout:not(.rm-shop-layout--pdp) {
  margin-top: 0;
}

body.guest-site .rm-landing {
  margin-top: 0;
}

/* ── Main content padding ── */
@media (max-width: 640px) {
  body.guest-site .sub-main {
    padding-top: 0.85rem;
    padding-inline: clamp(0.75rem, 3vw, 1rem);
  }

  body.guest-site .home-landing-layout {
    padding-inline: clamp(0.75rem, 3vw, 1rem);
  }

  body.guest-site .band-shop {
    padding-inline: clamp(0.75rem, 3vw, 1rem);
  }

  body.guest-site .checkout-page {
    padding-inline: clamp(0.75rem, 3vw, 1rem);
    padding-bottom: 2.5rem;
  }
}

/* ── Product grids & cards ── */
@media (max-width: 639px) {
  body.guest-site .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.55rem;
  }
}

@media (max-width: 380px) {
  body.guest-site .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Product detail / gallery (mobile carousel — desktop unchanged ≥900px) ── */
@media (max-width: 899px) {
  .product-catalog-gallery--multi {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .product-catalog-gallery--multi .product-catalog-gallery__hero {
    display: block;
    width: 100%;
    order: 0;
  }

  .product-catalog-gallery--multi .product-hero-img--fx,
  .product-catalog-gallery--multi .product-hero-img--zoomhost {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    max-height: min(88vw, 520px);
    background: linear-gradient(180deg, #fff 0%, #f8f4fa 100%);
    box-shadow: 0 12px 32px rgba(80, 100, 140, 0.12);
  }

  .product-catalog-gallery--multi .product-hero-img--fx img,
  .product-catalog-gallery--multi #productImage {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center;
    touch-action: pan-y;
  }

  .product-catalog-gallery--multi .product-catalog-gallery__thumb-col {
    order: 2;
    max-height: none;
    width: 100%;
    margin-top: 0.15rem;
  }

  .product-catalog-gallery--multi .pdp-feature-bar.cg-pdp__feature-pills {
    order: 3;
    margin-top: 0.45rem;
  }

  .product-catalog-gallery--multi .product-catalog-gallery__nav {
    display: none;
  }

  .product-catalog-gallery--multi .product-catalog-gallery__track {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    gap: 0.45rem;
    padding: 0.15rem 0;
    background: transparent;
    border: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .product-catalog-gallery--multi .product-catalog-gallery__track::-webkit-scrollbar {
    display: none;
  }

  .product-catalog-gallery--multi .product-catalog-gallery__thumb {
    width: 3.35rem;
    height: 3.35rem;
    flex: 0 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 14px rgba(80, 100, 140, 0.1);
  }

  .product-catalog-gallery--multi .product-catalog-gallery__thumb img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    max-height: none;
    object-fit: cover;
  }

  .product-catalog-gallery__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    order: 1;
    margin: 0.15rem 0 0;
    padding: 0;
    list-style: none;
  }

  .product-catalog-gallery__dot {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.22);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, width 0.2s ease;
  }

  .product-catalog-gallery__dot.is-active {
    width: 0.65rem;
    background: rgba(38, 166, 154, 0.92);
    transform: scale(1.05);
  }

  /* Modern RM / resin / PF PDP shell */
  .rm-pdp--modern .rm-pdp-gallery--shell:has(.rm-pdp__thumb + .rm-pdp__thumb),
  .rm-pdp-gallery:has(.rm-pdp__thumb + .rm-pdp__thumb) {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    grid-template-columns: unset;
    width: 100%;
  }

  .rm-pdp--modern .rm-pdp-gallery--shell:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp__hero-wrap,
  .rm-pdp-gallery:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp__hero-wrap {
    display: block;
    width: 100%;
    order: 0;
  }

  .rm-pdp--modern .rm-pdp-gallery--shell:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp__hero,
  .rm-pdp-gallery:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp__hero {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    max-height: min(88vw, 520px);
    object-fit: contain;
  }

  .rm-pdp--modern .rm-pdp-gallery--shell:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp-thumb-col,
  .rm-pdp-gallery:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp-thumb-col {
    order: 2;
    width: 100%;
    max-height: none;
    flex-direction: row;
    margin-top: 0.15rem;
  }

  .rm-pdp--modern .rm-pdp-gallery--shell:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp-thumb-nav,
  .rm-pdp-gallery:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp-thumb-nav {
    display: none;
  }

  .rm-pdp--modern .rm-pdp-gallery--shell:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp-thumb-track,
  .rm-pdp-gallery:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp-thumb-track {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    gap: 0.45rem;
    padding: 0.15rem 0;
    background: transparent;
    border: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .rm-pdp--modern .rm-pdp-gallery--shell:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp-thumb-track::-webkit-scrollbar,
  .rm-pdp-gallery:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp-thumb-track::-webkit-scrollbar {
    display: none;
  }

  .rm-pdp--modern .rm-pdp-gallery--shell:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp__thumb,
  .rm-pdp-gallery:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp__thumb {
    width: 3.35rem;
    height: 3.35rem;
    flex: 0 0 auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(80, 100, 140, 0.1);
  }

  .rm-pdp--modern .rm-pdp-gallery--shell:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp__thumb img,
  .rm-pdp-gallery:has(.rm-pdp__thumb + .rm-pdp__thumb) .rm-pdp__thumb img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    max-height: none;
    object-fit: cover;
  }

  .rm-pdp--modern .rm-pdp-gallery--shell:not(:has(.rm-pdp__thumb + .rm-pdp__thumb)) .rm-pdp-thumb-col,
  .rm-pdp-gallery:not(:has(.rm-pdp__thumb + .rm-pdp__thumb)) .rm-pdp-thumb-col {
    display: none;
  }

  body.guest-site .product-layout--split {
    gap: 1.35rem;
  }

  body.guest-site .product-visual--fx .product-hero-img--fx {
    max-width: 100%;
  }

  body.pdp-ethereal .pdp-trust-bar,
  body.pdp-ethereal .rm-pdp__trust-bar {
    margin-top: 1rem;
  }
}

/* ── RM / PF shop filters & grids ── */
@media (max-width: 720px) {
  body.guest-site .rm-filter-toolbar .category-toolbar__group,
  body.guest-site .rm-filter-toolbar .category-toolbar__group--grow,
  body.guest-site .rm-filter-toolbar .category-toolbar__group--actions {
    flex: 1 1 100%;
    min-width: 0;
  }

  body.guest-site .rm-filter-toolbar .category-toolbar__btn-row {
    width: 100%;
  }

  body.guest-site .rm-filter-toolbar .category-toolbar__btn-row .category-toolbar__btn {
    flex: 1 1 calc(50% - 0.25rem);
    min-height: 2.75rem;
  }

  body.guest-site .rm-grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
}

@media (max-width: 400px) {
  body.guest-site .rm-grid-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Checkout & forms ── */
@media (max-width: 859px) {
  body.guest-site .checkout-layout {
    gap: 1.35rem;
  }

  body.guest-site .checkout-panel--sticky {
    position: static;
    top: auto;
  }

  body.guest-site .checkout-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.guest-site .checkout-pay-modal__sheet {
    width: min(100%, calc(100vw - 1.5rem));
    max-height: min(92vh, 720px);
    margin-inline: auto;
  }
}

@media (max-width: 768px) {
  body.guest-site input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  body.guest-site select,
  body.guest-site textarea {
    font-size: max(16px, 1em);
  }
}

@media (pointer: coarse) {
  body.guest-site .category-pill--rail,
  body.guest-site .cart-item__qty,
  body.guest-site .icon-btn {
    min-height: 2.75rem;
    min-width: 2.75rem;
  }
}

/* ── Cart drawer ── */
@media (max-width: 480px) {
  body.guest-site .cart-drawer {
    width: 100%;
  }

  body.guest-site .cart-drawer-inner {
    border-radius: var(--radius-xl, 1.75rem) 0 0 var(--radius-xl, 1.75rem);
    padding-inline: 1rem;
  }

  body.guest-site .cart-item {
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  body.guest-site .cart-item__side {
    width: 100%;
    justify-content: space-between;
  }
}

/* ── Footer ── */
@media (max-width: 640px) {
  body.guest-site:not(.page-home) .site-footer--craftguru {
    margin-top: 1.5rem;
    padding-top: 1.75rem;
    padding-left: clamp(0.75rem, 3vw, 1.25rem);
    padding-right: clamp(0.75rem, 3vw, 1.25rem);
  }

  body.guest-site .footer-sitemap {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-inline: auto;
    width: 100%;
    text-align: center;
    padding: 1.35rem clamp(0.85rem, 3vw, 1.25rem);
  }

  body.guest-site .footer-sitemap__col {
    text-align: center;
    justify-items: center;
  }

  body.guest-site .footer-sitemap__title {
    text-align: center;
  }

  body.guest-site .footer-sitemap__list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
  }

  body.guest-site .footer-sitemap__list li {
    margin-bottom: 0.25rem;
  }

  body.guest-site .site-footer--craftguru {
    padding-inline: clamp(0.75rem, 3vw, 1.25rem);
  }

  body.guest-site .footer-copy--craftguru {
    text-align: center;
  }
}

/* ── Auth / account modals ── */
@media (max-width: 560px) {
  body.guest-site .auth-modal__sheet,
  body.guest-site .checkout-auth-sheet {
    width: min(100%, calc(100vw - 1.25rem));
    margin-inline: auto;
    padding-inline: 1rem;
  }

  body.guest-site .account-layout {
    gap: 1rem;
  }

  body.guest-site .account-side-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Search popover ── */
@media (max-width: 640px) {
  body.guest-site .global-find__popover {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(calc(100vw - 1.5rem), 20rem);
  }

  body.guest-site .guest-header-search {
    max-width: calc(100vw - 1.5rem);
  }

  body.guest-site .guest-header-search__results {
    width: min(calc(100vw - 1.5rem), 22rem);
    max-width: none;
  }
}

/* ── Hero sections — exact-panel system (Home, RM, Photo Frames) ── */
body.guest-site .hero-atelier,
body.page-home .hero-atelier,
body.guest-site .rm-hero,
body.guest-site .home-landing-hero--exact,
body.guest-site .rm-landing-hero--exact,
body.guest-site .pf-landing-hero--exact,
body.page-home .home-landing-hero--exact,
body.page-home .hero.hero--landing,
body.page-home .home-landing-layout,
body.page-home .home-landing-main {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

body.guest-site .home-landing-hero__exact-art,
body.guest-site .rm-landing-hero__exact-art,
body.guest-site .pf-landing-hero__exact-art,
body.page-home .home-landing-hero__exact-art,
body.page-home .hero-atelier__exact-art,
body.page-home .hero-atelier__shell--exact-ref .hero-atelier__exact-art {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 899px) {
  body.guest-site .home-landing-layout,
  body.page-home .home-landing-layout {
    padding-inline: clamp(0.65rem, 3vw, 1rem);
    gap: 0.85rem;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body.page-home .hero-atelier,
  body.guest-site .hero-atelier {
    padding: 0;
    max-width: 100%;
  }

  body.guest-site .home-landing-main,
  body.page-home .home-landing-main {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  body.page-home .home-landing-main .hero-atelier__shell,
  body.guest-site .home-landing-main .hero-atelier__shell,
  body.page-home .hero-atelier__shell,
  body.page-home .hero-atelier__shell--exact-ref {
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.guest-site .home-landing-hero--exact,
  body.guest-site .rm-landing-hero--exact,
  body.guest-site .pf-landing-hero--exact,
  body.page-home .home-landing-hero--exact {
    width: 100%;
    margin-bottom: clamp(1rem, 3vw, 1.65rem);
    border-radius: clamp(1rem, 3.5vw, 1.75rem);
  }

  body.guest-site .home-landing-hero__exact-art,
  body.guest-site .rm-landing-hero__exact-art,
  body.guest-site .pf-landing-hero__exact-art,
  body.page-home .home-landing-hero__exact-art {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
  }

  body.rm-page-wide .rm-hero__media img {
    max-height: none !important;
  }

  body.guest-site .rm-shop-layout__main,
  body.guest-site .band-shop-inner {
    min-width: 0;
    overflow-x: clip;
  }
}

@media (max-width: 480px) {
  body.guest-site .home-landing-hero--exact,
  body.guest-site .rm-landing-hero--exact,
  body.guest-site .pf-landing-hero--exact,
  body.page-home .home-landing-hero--exact {
    border-radius: clamp(0.85rem, 2.5vw, 1.25rem);
  }
}

/* ── Mobile / tablet sidebar drawer (desktop unchanged ≥900px) ── */
.cg-rail-toggle,
.cg-rail-backdrop {
  display: none;
}

@media (max-width: 899px) {
  body.cg-rail-drawer-enabled .cg-rail-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    max-width: 100%;
    min-height: 2.85rem;
    margin: 0 0 0.85rem;
    padding: 0.62rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(38, 166, 154, 0.28);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(232, 245, 242, 0.95));
    color: var(--cg-navy, #1a2b48);
    font-family: var(--font-body, "Plus Jakarta Sans", system-ui, sans-serif);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(26, 43, 72, 0.08);
    -webkit-tap-highlight-color: transparent;
    transition:
      transform 0.22s ease,
      box-shadow 0.22s ease,
      border-color 0.22s ease;
  }

  body.cg-rail-drawer-enabled .cg-rail-toggle:active {
    transform: scale(0.98);
  }

  body.cg-rail-drawer-enabled .cg-rail-toggle__bars {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.22rem;
    width: 1.05rem;
    height: 0.85rem;
    flex-shrink: 0;
  }

  body.cg-rail-drawer-enabled .cg-rail-toggle__bars span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: var(--cg-teal-deep, #1e8e84);
  }

  body.cg-rail-drawer-enabled .cg-rail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9100;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(15, 22, 38, 0.42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.28s ease,
      visibility 0.28s ease;
  }

  body.cg-rail-drawer-enabled.cg-rail-open .cg-rail-backdrop:not([hidden]) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.cg-rail-drawer-enabled .home-category-rail.cg-rail-drawer-panel,
  body.cg-rail-drawer-enabled .guest-page-category-rail.cg-rail-drawer-panel,
  body.cg-rail-drawer-enabled .rm-nav-tree-wrap.cg-rail-drawer-panel,
  body.cg-rail-drawer-enabled .rm-category-rail.cg-rail-drawer-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9200;
    width: min(88vw, var(--cg-sidebar-w-max, 17rem));
    min-width: var(--cg-sidebar-w-min, 13rem);
    max-width: var(--cg-sidebar-w-max, 17rem);
    max-height: none;
    margin: 0;
    transform: translateX(-108%);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-top: calc(env(safe-area-inset-top, 0px) + 0.85rem);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
    box-shadow: 8px 0 40px rgba(26, 43, 72, 0.18);
    pointer-events: auto;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  body.cg-rail-drawer-enabled .cg-rail-drawer-panel.is-open {
    transform: translateX(0);
  }

  body.cg-rail-drawer-enabled .guest-page-category-rail.cg-rail-drawer-panel .category-grid--rail {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: hidden;
    overflow-y: visible;
  }

  body.cg-rail-drawer-enabled .home-category-rail.cg-rail-drawer-panel .category-grid--rail,
  body.cg-rail-drawer-enabled .rm-category-rail.cg-rail-drawer-panel .category-grid--rail {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: hidden;
    overflow-y: visible;
  }

  body.cg-rail-drawer-enabled .rm-nav-tree-wrap.cg-rail-drawer-panel,
  body.cg-rail-drawer-enabled .rm-category-rail.cg-rail-drawer-panel {
    border-radius: 0 1.25rem 1.25rem 0;
  }

  body.cg-rail-drawer-enabled .rm-shop-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* Home mobile: teal SHOP BY CATEGORY bar above hero; rail slides in as drawer. */
  body.page-home.cg-rail-drawer-enabled .home-landing-layout {
    display: flex;
    flex-direction: column;
  }

  body.page-home.cg-rail-drawer-enabled .home-landing-layout > .cg-rail-toggle {
    order: -1;
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 0.85rem;
  }

  body.page-home.cg-rail-drawer-enabled .home-landing-main {
    order: 0;
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Category / PDP / wishlist: toggle above content column */
  body.guest-site:not(.page-home).cg-rail-drawer-enabled main.sub-main:has(.guest-main-with-rail-inner) {
    flex-direction: column;
  }

  body.guest-site:not(.page-home).cg-rail-drawer-enabled .guest-main-with-rail-inner {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
  }

  body.guest-site:not(.page-home).cg-rail-drawer-enabled .guest-main-with-rail-inner > .cg-rail-toggle {
    order: -1;
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 0.85rem;
  }
}

@media (min-width: 900px) {
  .cg-rail-toggle,
  .cg-rail-backdrop {
    display: none !important;
  }

  body.cg-rail-drawer-enabled .cg-rail-drawer-panel {
    position: static !important;
    transform: none !important;
    width: auto !important;
    max-height: none !important;
    box-shadow: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.cg-rail-drawer-enabled .cg-rail-drawer-panel,
  body.cg-rail-drawer-enabled .cg-rail-backdrop {
    transition: none !important;
  }
}

/* ── Guest main + category pages ── */
@media (max-width: 899px) {
  body.guest-site:not(.page-home) main.sub-main:has(.guest-page-category-rail),
  body.guest-site:not(.page-home) main.sub-main:has(.guest-main-with-rail-inner),
  body.guest-site .guest-main-with-rail-inner {
    flex-direction: column;
    min-width: 0;
  }

  body.guest-site .guest-main-with-rail-inner > :not(.guest-page-category-rail):not(.cg-rail-toggle) {
    min-width: 0;
    width: 100%;
  }
}

/* ── Category / corporate gifting band headers ── */
@media (max-width: 720px) {
  body.guest-site .category-band-head,
  body.guest-site .band-head,
  body.guest-site .flow-step {
    font-size: clamp(0.72rem, 2.8vw, 0.85rem);
  }

  body.guest-site .category-band-head h1,
  body.guest-site .band-head h1 {
    font-size: clamp(1.35rem, 5vw, 1.85rem);
  }
}

/* ── RM / PF modern PDP ── */
@media (max-width: 859px) {
  body.guest-site .rm-pdp--modern,
  body.guest-site .rm-pdp-grid {
    min-width: 0;
  }

  body.guest-site .rm-shop-layout--pdp {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.guest-site .rm-pdp__hero-img-wrap,
  body.guest-site .rm-pdp__gallery {
    max-width: 100%;
  }
}

/* ── About & static subpages ── */
@media (max-width: 720px) {
  body.guest-site .about-grid,
  body.guest-site .content-prose {
    min-width: 0;
  }
}

/* ── Prevent horizontal scroll sitewide ── */
html.guest-responsive-root,
body.guest-site {
  overflow-x: clip;
}

body.guest-site .mesh-gradient,
body.guest-site .animated-backdrop {
  max-width: 100vw;
}

/* Normalize vertical rhythm on guest subpages (preserve home hero + footer spacing) */
body.guest-site:not(.page-home):not(.page-checkout) .sub-main {
  min-height: 0;
  padding-top: 0.85rem;
}

body.guest-site:not(.page-home) .band-shop:not(.band-shop--home) {
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

/* ── Social float stack — mobile safe area ── */
@media (max-width: 520px) {
  body.guest-site .cg-social-float-stack {
    right: max(0.65rem, env(safe-area-inset-right, 0px));
    bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
    z-index: 2147483000;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: none;
  }

  body.guest-site .cg-social-float-stack > * {
    pointer-events: auto;
  }
}

/* ── Category listing toolbar ── */
@media (max-width: 720px) {
  body.guest-site .category-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  body.guest-site .category-toolbar__group {
    width: 100%;
    min-width: 0;
  }
}
