/* Craftguru Mobile Quality Layer
 * Safe mobile/tablet overrides. Desktop layout is intentionally untouched.
 * Loaded globally by guest-layout.js so all storefront pages share one mobile system.
 */

html.guest-responsive-root,
html.guest-responsive-root body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

html.guest-responsive-root body {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

html.guest-responsive-root body *,
html.guest-responsive-root body *::before,
html.guest-responsive-root body *::after {
  box-sizing: border-box;
}

@media (max-width: 900px) {
  /* ---------- Header ---------- */
  html.guest-responsive-root body .site-top {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.65rem;
    overflow: visible;
  }

  html.guest-responsive-root body .guest-top-cluster {
    min-width: 0;
    width: 100%;
  }

  html.guest-responsive-root body .brand {
    min-width: 0;
    overflow: hidden;
  }

  html.guest-responsive-root body .brand__logo-img {
    display: block;
    width: auto;
    max-width: min(40vw, 9rem);
    height: auto;
  }

  html.guest-responsive-root body .site-top-end {
    min-width: 0;
    width: auto;
    max-width: 60vw;
    overflow: visible;
  }

  html.guest-responsive-root body .home-auth-bar {
    min-width: 0;
    max-width: 42vw;
    overflow: hidden;
  }

  html.guest-responsive-root body .home-auth-user {
    display: block;
    min-width: 0;
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.guest-responsive-root body .home-auth-btn {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  html.guest-responsive-root body .site-top-actions {
    min-width: 0;
    flex: 0 0 auto;
  }

  html.guest-responsive-root body .home-header-wish,
  html.guest-responsive-root body .btn-cart {
    flex: 0 0 auto;
  }

  html.guest-responsive-root body .nav-dock {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 0.15rem;
    padding-bottom: 0.15rem;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
  }

  html.guest-responsive-root body .nav-dock-link {
    scroll-snap-align: start;
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
  }

  /* Search results must stay inside the viewport. */
  html.guest-responsive-root body .guest-header-search,
  html.guest-responsive-root body .guest-header-search__results {
    min-width: 0;
  }

  html.guest-responsive-root body .guest-header-search__results {
    left: 0;
    right: 0;
    width: 100%;
    max-width: calc(100vw - 1.5rem);
  }

  /* ---------- Main shells ---------- */
  html.guest-responsive-root body .sub-main,
  html.guest-responsive-root body .band-shop,
  html.guest-responsive-root body .band-shop-inner,
  html.guest-responsive-root body .rm-shop-layout,
  html.guest-responsive-root body .rm-shop-layout__main,
  html.guest-responsive-root body .rm-shop-layout__main--pdp {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  html.guest-responsive-root body .band-shop-inner {
    padding-inline: 0;
  }

  html.guest-responsive-root body .crumb {
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    padding-inline: 0.1rem;
  }

  html.guest-responsive-root body .crumb::-webkit-scrollbar {
    display: none;
  }

  /* ---------- Home ---------- */
  body.page-home .home-shop-layout,
  body.page-home .rm-shop-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  body.page-home .home-shop-layout__main,
  body.page-home .rm-shop-layout__main {
    width: 100%;
    min-width: 0;
  }

  body.page-home .home-resin-hero,
  body.page-home .rm-landing-hero--exact {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    height: auto;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: clamp(1rem, 4vw, 1.5rem);
  }

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

  body.page-home .home-landing-hero__copy,
  body.page-home .rm-landing-hero__copy {
    left: 0.9rem;
    right: 0.9rem;
    bottom: 0.9rem;
    width: auto;
    max-width: calc(100% - 1.8rem);
    padding: 0.8rem 0.9rem;
    border-radius: 1rem;
    background: rgba(255,255,255,0.78);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  body.page-home .rm-hero__title-stack {
    font-size: clamp(1.35rem, 6.5vw, 2rem);
    line-height: 1.02;
  }

  body.page-home .rm-hero__sub {
    font-size: 0.76rem;
    line-height: 1.45;
    margin-top: 0.45rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.page-home .rm-hero__kicker {
    font-size: 0.62rem;
    margin-bottom: 0.25rem;
  }

  body.page-home .home-landing-hero__fx {
    pointer-events: none;
  }

  body.page-home .featured-collections-grid,
  body.page-home .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  body.page-home .craft-cat-section__head {
    align-items: flex-start;
    gap: 0.5rem;
  }

  body.page-home .craft-cat-section__title {
    font-size: clamp(1.2rem, 5vw, 1.55rem);
  }

  body.page-home .craft-cat-section__all-link {
    flex: 0 0 auto;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  body.page-home .cg-category-section__trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  body.page-home .cg-category-section__trust-item {
    min-width: 0;
  }

  /* ---------- Product cards ---------- */
  html.guest-responsive-root body .product-card,
  html.guest-responsive-root body .rm-product-card {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  html.guest-responsive-root body .product-card__media,
  html.guest-responsive-root body .product-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 0;
    max-height: none;
  }

  html.guest-responsive-root body .product-card__media img,
  html.guest-responsive-root body .product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  html.guest-responsive-root body .product-card__body,
  html.guest-responsive-root body .rm-product-card__body {
    min-width: 0;
  }

  html.guest-responsive-root body .product-card__title,
  html.guest-responsive-root body .rm-product-card__title {
    overflow-wrap: anywhere;
  }

  /* ---------- Modern PDP ---------- */
  html.guest-responsive-root body .rm-pdp--modern,
  html.guest-responsive-root body .rm-pdp-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  html.guest-responsive-root body .rm-pdp-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem;
  }

  html.guest-responsive-root body .rm-pdp__gallery,
  html.guest-responsive-root body .rm-pdp__purchase,
  html.guest-responsive-root body .rm-pdp__details,
  html.guest-responsive-root body .rm-pdp__description,
  html.guest-responsive-root body .rm-pdp__info {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  html.guest-responsive-root body .rm-pdp__purchase,
  html.guest-responsive-root body .rm-pdp__buy-panel,
  html.guest-responsive-root body .rm-pdp__side {
    position: static !important;
    top: auto !important;
    max-height: none !important;
  }

  html.guest-responsive-root body .rm-pdp__hero,
  html.guest-responsive-root body .rm-pdp__hero-img,
  html.guest-responsive-root body .rm-pdp__hero-wrap,
  html.guest-responsive-root body .rm-pdp__gallery-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  html.guest-responsive-root body .rm-pdp__hero,
  html.guest-responsive-root body .rm-pdp__hero-img {
    max-height: 82vw;
    aspect-ratio: 1 / 1;
    object-fit: contain;
  }

  html.guest-responsive-root body .rm-pdp__cart-row {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  html.guest-responsive-root body .rm-pdp__cart-row > * {
    min-width: 0;
  }

  html.guest-responsive-root body .rm-pdp__add {
    flex: 1 1 12rem;
    min-height: 3rem;
  }

  html.guest-responsive-root body .rm-pdp__buy-row,
  html.guest-responsive-root body .rm-pdp__buy-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  html.guest-responsive-root body .rm-pdp__bulk-row {
    width: 100%;
  }

  html.guest-responsive-root body .rm-pdp__size-row,
  html.guest-responsive-root body .rm-pdp__color-row,
  html.guest-responsive-root body .rm-pdp__colour-row,
  html.guest-responsive-root body .rm-pdp__variant-row {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  html.guest-responsive-root body .rm-pdp__size-row button,
  html.guest-responsive-root body .rm-pdp__color-row button,
  html.guest-responsive-root body .rm-pdp__colour-row button,
  html.guest-responsive-root body .rm-pdp__variant-row button {
    min-height: 2.75rem;
  }

  html.guest-responsive-root body .rm-pdp__description,
  html.guest-responsive-root body .rm-pdp__description * {
    max-width: 100%;
  }

  /* ---------- Raw material / photo frame shop ---------- */
  html.guest-responsive-root body .rm-shop-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html.guest-responsive-root body .rm-filter-toolbar {
    width: 100%;
    max-width: 100%;
  }

  html.guest-responsive-root body .rm-grid-cards,
  html.guest-responsive-root body .product-grid {
    min-width: 0;
  }

  html.guest-responsive-root body .rm-product-card,
  html.guest-responsive-root body .product-card {
    min-width: 0;
  }

  /* ---------- Cart ---------- */
  html.guest-responsive-root body .cart-drawer {
    width: min(100vw, 100%);
    max-width: 100%;
  }

  html.guest-responsive-root body .cart-drawer-inner {
    width: 100%;
    max-width: 100%;
    padding-top: max(0.8rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }

  html.guest-responsive-root body .cart-list {
    min-width: 0;
    overflow-x: hidden;
  }

  html.guest-responsive-root body .cart-item__name {
    overflow-wrap: anywhere;
  }

  /* ---------- Forms / checkout ---------- */
  html.guest-responsive-root body .checkout-page,
  html.guest-responsive-root body .checkout-layout,
  html.guest-responsive-root body .checkout-panel,
  html.guest-responsive-root body .checkout-form,
  html.guest-responsive-root body .checkout-summary {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  html.guest-responsive-root body .checkout-layout {
    display: flex;
    flex-direction: column;
  }

  html.guest-responsive-root body .checkout-panel,
  html.guest-responsive-root body .checkout-summary {
    overflow: hidden;
  }

  html.guest-responsive-root body button,
  html.guest-responsive-root body a,
  html.guest-responsive-root body input,
  html.guest-responsive-root body select,
  html.guest-responsive-root body textarea {
    -webkit-tap-highlight-color: transparent;
  }

  /* ---------- Footer ---------- */
  html.guest-responsive-root body .site-footer--craftguru,
  html.guest-responsive-root body .footer-sitemap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  html.guest-responsive-root body .site-top {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  html.guest-responsive-root body .home-auth-btn {
    min-height: 2.45rem;
    padding-inline: 0.5rem;
  }

  html.guest-responsive-root body .home-auth-user {
    font-size: 0.68rem;
  }

  html.guest-responsive-root body .home-header-wish__label,
  html.guest-responsive-root body .btn-cart-label {
    display: none;
  }

  html.guest-responsive-root body .home-header-wish,
  html.guest-responsive-root body .btn-cart {
    width: 2.45rem;
    min-width: 2.45rem;
    padding-inline: 0;
    justify-content: center;
  }

  html.guest-responsive-root body .guest-header-search {
    height: 2.7rem;
  }

  html.guest-responsive-root body .guest-header-search__input {
    font-size: 16px;
  }

  html.guest-responsive-root body .guest-header-search__results {
    max-height: min(60vh, 24rem);
  }

  html.guest-responsive-root body .rm-pdp-promo-strip {
    font-size: 0.68rem;
    line-height: 1.3;
    padding: 0.45rem 0.75rem;
    text-align: center;
  }

  html.guest-responsive-root body .rm-pdp__cart-row {
    gap: 0.55rem;
  }

  html.guest-responsive-root body .rm-pdp__qty {
    min-height: 3rem;
  }
}

@media (max-width: 480px) {
  html.guest-responsive-root body .site-top {
    padding-inline: 0.7rem;
  }

  html.guest-responsive-root body .brand__logo-img {
    max-width: 7.2rem;
    max-height: 2.25rem;
  }

  html.guest-responsive-root body .site-top-end {
    max-width: 66vw;
  }

  html.guest-responsive-root body .home-auth-bar {
    max-width: 37vw;
  }

  html.guest-responsive-root body .home-auth-btn {
    font-size: 0.58rem;
    padding-inline: 0.4rem;
  }

  html.guest-responsive-root body .home-auth-user {
    max-width: 34vw;
  }

  body.page-home .home-resin-hero,
  body.page-home .rm-landing-hero--exact {
    aspect-ratio: 4 / 5;
    border-radius: 0.95rem;
  }

  body.page-home .home-landing-hero__copy,
  body.page-home .rm-landing-hero__copy {
    left: 0.65rem;
    right: 0.65rem;
    bottom: 0.65rem;
    max-width: calc(100% - 1.3rem);
    padding: 0.7rem 0.75rem;
  }

  body.page-home .rm-hero__title-stack {
    font-size: clamp(1.18rem, 6.8vw, 1.65rem);
  }

  body.page-home .rm-hero__sub {
    font-size: 0.7rem;
    -webkit-line-clamp: 2;
  }

  body.page-home .featured-collections-grid,
  body.page-home .product-grid {
    gap: 0.5rem;
  }

  body.page-home .cg-category-section__trust {
    grid-template-columns: 1fr;
  }

  html.guest-responsive-root body .rm-pdp__add {
    flex-basis: 100%;
  }

  html.guest-responsive-root body .rm-pdp__hero,
  html.guest-responsive-root body .rm-pdp__hero-img {
    max-height: 90vw;
  }
}

@media (max-width: 360px) {
  html.guest-responsive-root body .home-auth-user {
    display: inline-flex;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.guest-responsive-root body .home-auth-bar {
    max-width: 43vw;
  }

  html.guest-responsive-root body .home-auth-btn {
    font-size: 0.58rem;
    padding-inline: 0.34rem;
  }

  body.page-home .home-resin-hero,
  body.page-home .rm-landing-hero--exact {
    aspect-ratio: 1 / 1.15;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.guest-responsive-root body .home-landing-hero__copy,
  html.guest-responsive-root body .rm-landing-hero__copy {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}


/* -------------------------------------------------------------------------
   Mobile hardening pass
   -------------------------------------------------------------------------
   These rules are intentionally last in the mobile layer. They normalize
   legacy desktop constraints, prevent horizontal bleed/overlap, and keep
   interactive content readable without changing desktop behavior.
------------------------------------------------------------------------- */

@media (max-width: 899px) {
  html.guest-responsive-root,
  html.guest-responsive-root body {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  html.guest-responsive-root body main,
  html.guest-responsive-root body section,
  html.guest-responsive-root body article,
  html.guest-responsive-root body aside,
  html.guest-responsive-root body .sub-main,
  html.guest-responsive-root body .band-shop,
  html.guest-responsive-root body .band-shop-inner {
    min-width: 0;
    max-width: 100%;
  }

  html.guest-responsive-root body img,
  html.guest-responsive-root body video,
  html.guest-responsive-root body iframe,
  html.guest-responsive-root body svg,
  html.guest-responsive-root body canvas {
    max-width: 100%;
  }

  html.guest-responsive-root body pre,
  html.guest-responsive-root body code {
    max-width: 100%;
  }

  html.guest-responsive-root body pre {
    overflow-x: auto;
    white-space: pre;
  }

  html.guest-responsive-root body table {
    width: 100%;
    max-width: 100%;
  }

  html.guest-responsive-root body .site-top > *,
  html.guest-responsive-root body .site-top .guest-top-cluster > *,
  html.guest-responsive-root body .site-top-end > *,
  html.guest-responsive-root body .site-top-actions > *,
  html.guest-responsive-root body .home-auth-bar > * {
    min-width: 0;
  }

  /* Never let a flex/grid child force the viewport wider than the parent. */
  html.guest-responsive-root body .rm-shop-layout > *,
  html.guest-responsive-root body .rm-pdp-grid > *,
  html.guest-responsive-root body .checkout-layout > *,
  html.guest-responsive-root body .home-shop-layout > *,
  html.guest-responsive-root body .featured-collections-grid > *,
  html.guest-responsive-root body .product-grid > *,
  html.guest-responsive-root body .rm-grid-cards > * {
    min-width: 0;
    max-width: 100%;
  }

  /* Long product/category names must wrap instead of pushing controls out. */
  html.guest-responsive-root body h1,
  html.guest-responsive-root body h2,
  html.guest-responsive-root body h3,
  html.guest-responsive-root body h4,
  html.guest-responsive-root body p,
  html.guest-responsive-root body a,
  html.guest-responsive-root body button,
  html.guest-responsive-root body label,
  html.guest-responsive-root body .product-card__title,
  html.guest-responsive-root body .rm-product-card__title,
  html.guest-responsive-root body .rm-card-shop__name,
  html.guest-responsive-root body .rm-pdp__title,
  html.guest-responsive-root body .rm-pdp__description {
    overflow-wrap: anywhere;
  }

  /* PDP: every section owns its width; no desktop absolute/sticky geometry
     is allowed to overlap another mobile section. */
  html.guest-responsive-root body .rm-pdp-grid,
  html.guest-responsive-root body .rm-pdp--modern {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch;
    gap: clamp(0.85rem, 3vw, 1.15rem);
    overflow: visible;
  }

  html.guest-responsive-root body .rm-pdp__gallery,
  html.guest-responsive-root body .rm-pdp__purchase,
  html.guest-responsive-root body .rm-pdp__details,
  html.guest-responsive-root body .rm-pdp__description,
  html.guest-responsive-root body .rm-pdp__info,
  html.guest-responsive-root body .rm-pdp__buy-panel,
  html.guest-responsive-root body .rm-pdp__side,
  html.guest-responsive-root body .rm-pdp__feature-grid,
  html.guest-responsive-root body .rm-pdp__delivery-grid {
    position: relative !important;
    inset: auto !important;
    float: none !important;
    transform: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: none !important;
  }

  html.guest-responsive-root body .rm-pdp__purchase,
  html.guest-responsive-root body .rm-pdp__buy-panel,
  html.guest-responsive-root body .rm-pdp__side {
    overflow: visible;
  }

  html.guest-responsive-root body .rm-pdp__description,
  html.guest-responsive-root body .rm-pdp__description > *,
  html.guest-responsive-root body .rm-pdp__details > *,
  html.guest-responsive-root body .rm-pdp__info > * {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  html.guest-responsive-root body .rm-pdp__cart-row,
  html.guest-responsive-root body .rm-pdp__buy-row,
  html.guest-responsive-root body .rm-pdp__buy-actions,
  html.guest-responsive-root body .rm-pdp__trust-bar,
  html.guest-responsive-root body .rm-pdp__trust,
  html.guest-responsive-root body .rm-pdp__bulk-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  /* Gallery controls stay inside the gallery instead of covering content. */
  html.guest-responsive-root body .product-catalog-gallery__track {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  html.guest-responsive-root body .product-catalog-gallery__thumb {
    flex: 0 0 3.35rem;
  }

  /* Cards: media and content are independent boxes. */
  html.guest-responsive-root body .product-card,
  html.guest-responsive-root body .rm-product-card,
  html.guest-responsive-root body .rm-card-shop {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  html.guest-responsive-root body .product-card__body,
  html.guest-responsive-root body .rm-product-card__body,
  html.guest-responsive-root body .rm-card-shop__body,
  html.guest-responsive-root body .product-meta,
  html.guest-responsive-root body .rm-card-shop__cta {
    min-width: 0;
    max-width: 100%;
  }

  /* Product-card overlays are allowed only inside the media box. */
  html.guest-responsive-root body .product-card__media,
  html.guest-responsive-root body .product-card-image {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }

  html.guest-responsive-root body .product-card-share,
  html.guest-responsive-root body .product-card-wish {
    max-width: calc(100% - 0.75rem);
  }

  /* Floating UI must remain tappable and clear of content. */
  html.guest-responsive-root body .cg-social-float-stack {
    max-width: calc(100vw - 1rem);
  }

  /* Search/dropdowns/popovers must never create a second horizontal page. */
  html.guest-responsive-root body .guest-header-search__results,
  html.guest-responsive-root body .global-find__popover,
  html.guest-responsive-root body .product-share-bar__dropdown,
  html.guest-responsive-root body .product-card-share__pop {
    max-width: calc(100vw - 1rem);
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* Modals fit short phone screens and scroll internally. */
  html.guest-responsive-root body .auth-modal,
  html.guest-responsive-root body .checkout-auth-modal,
  html.guest-responsive-root body .checkout-pay-modal,
  html.guest-responsive-root body .vendor-gate-modal {
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  html.guest-responsive-root body .auth-modal__sheet,
  html.guest-responsive-root body .checkout-auth-sheet,
  html.guest-responsive-root body .checkout-pay-modal__panel,
  html.guest-responsive-root body .vendor-gate-modal__card {
    width: min(100%, calc(100vw - 1rem));
    max-width: 100%;
    max-height: calc(100dvh - 1rem);
    overflow-y: auto;
  }

  /* Tables/receipt-like content scroll horizontally rather than overlap. */
  html.guest-responsive-root body .vendor-inline-bill,
  html.guest-responsive-root body .checkout-summary,
  html.guest-responsive-root body .checkout-panel {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  html.guest-responsive-root body .vendor-inline-bill__table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  /* Mobile header: use explicit stacked rows. This eliminates the common
     logo/account/cart/nav collision on narrow phones. */
  html.guest-responsive-root body .site-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    width: 100%;
    max-width: 100%;
    gap: 0.45rem;
    align-items: center;
  }

  html.guest-responsive-root body .site-top > .brand,
  html.guest-responsive-root body .site-top .guest-top-cluster > .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    max-width: 52vw;
  }

  html.guest-responsive-root body .site-top > .nav-dock {
    grid-column: 1;
    grid-row: 4;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  html.guest-responsive-root body .site-top-end,
  html.guest-responsive-root body .site-top-end--home {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    position: relative;
    z-index: 3;
    padding: 0.15rem 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  html.guest-responsive-root body .site-top-end::-webkit-scrollbar,
  html.guest-responsive-root body .site-top-end--home::-webkit-scrollbar {
    display: none;
  }

  html.guest-responsive-root body .home-auth-bar {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    min-width: 0;
    overflow: visible;
  }

  html.guest-responsive-root body .home-auth-user {
    flex: 1 1 auto;
    max-width: 42vw;
    min-width: 0;
  }

  html.guest-responsive-root body .site-top-actions {
    flex: 0 0 auto;
    min-width: 0;
  }

  html.guest-responsive-root body .site-top > .nav-dock {
    position: relative;
    z-index: 2;
    grid-row: 4;
    /* Some legacy headers inject account controls after first paint. Reserve
       a distinct line so the nav can never sit underneath those controls. */
    margin-top: 4.35rem;
  }

  html.guest-responsive-root body .guest-header-search {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    max-width: 100%;
  }

  html.guest-responsive-root body .nav-dock {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 0;
  }

  html.guest-responsive-root body .nav-dock-link {
    flex: 0 0 auto;
  }

  html.guest-responsive-root body .home-auth-btn {
    min-width: 0;
    max-width: 100%;
  }

  html.guest-responsive-root body .home-header-wish,
  html.guest-responsive-root body .btn-cart {
    flex: 0 0 auto;
  }

  html.guest-responsive-root body .sub-main {
    padding-inline: 0.75rem;
  }

  /* Two-column product cards remain readable down to small phones. */
  html.guest-responsive-root body .product-grid,
  html.guest-responsive-root body .featured-collections-grid,
  html.guest-responsive-root body .rm-grid-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html.guest-responsive-root body .product-card__title,
  html.guest-responsive-root body .rm-product-card__title,
  html.guest-responsive-root body .rm-card-shop__name {
    font-size: clamp(0.72rem, 3.1vw, 0.88rem);
    line-height: 1.3;
  }

  html.guest-responsive-root body .product-meta,
  html.guest-responsive-root body .rm-card-shop__meta {
    min-width: 0;
    flex-wrap: wrap;
  }
}

@media (max-width: 380px) {
  /* At very narrow widths, one card per row is more readable than squeezed
     controls/text. */
  html.guest-responsive-root body .product-grid,
  html.guest-responsive-root body .featured-collections-grid,
  html.guest-responsive-root body .rm-grid-cards {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html.guest-responsive-root body .home-auth-user {
    max-width: 35vw;
  }

  html.guest-responsive-root body .site-top-actions {
    gap: 0.2rem;
  }
}

@media (max-width: 480px) {
  html.guest-responsive-root body .rm-pdp__add,
  html.guest-responsive-root body .rm-pdp__buy-row > *,
  html.guest-responsive-root body .rm-pdp__buy-actions > * {
    width: 100%;
    min-width: 0;
  }

  html.guest-responsive-root body .rm-pdp__qty {
    width: 100%;
    justify-content: space-between;
  }

  html.guest-responsive-root body .rm-pdp__size-row,
  html.guest-responsive-root body .rm-pdp__color-row,
  html.guest-responsive-root body .rm-pdp__colour-row,
  html.guest-responsive-root body .rm-pdp__variant-row {
    display: flex;
    gap: 0.45rem;
  }

  html.guest-responsive-root body .rm-pdp__size-row > *,
  html.guest-responsive-root body .rm-pdp__color-row > *,
  html.guest-responsive-root body .rm-pdp__colour-row > *,
  html.guest-responsive-root body .rm-pdp__variant-row > * {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.guest-responsive-root body *,
  html.guest-responsive-root body *::before,
  html.guest-responsive-root body *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
