/* Phone-first refinements layered over the desktop storefront. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

html.overlay-open,
html.overlay-open body {
  overflow: hidden;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 950px) {
  .nav {
    position: relative;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
  }

  .site-header nav.mobile-open {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    z-index: 25;
    display: grid;
    gap: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 0 0 14px 14px;
    background: var(--cream);
    box-shadow: 0 18px 35px rgba(49, 48, 45, .16);
  }

  .site-header nav.mobile-open a {
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 8px;
  }

  .site-header nav.mobile-open a:active {
    background: var(--sand);
  }
}

@media (max-width: 650px) {
  body {
    font-size: 15px;
  }

  .announcement {
    padding: 7px 12px;
    font-size: 11px;
    line-height: 1.35;
  }

  .wrap {
    width: calc(100% - 28px);
  }

  .nav {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    height: 62px;
  }

  .brand {
    justify-self: center;
    margin: 0;
    grid-template-columns: 34px auto;
    grid-template-rows: 19px 11px;
    column-gap: 7px;
    font-size: 18px;
    white-space: nowrap;
  }

  .brand-bear {
    width: 34px;
    height: 34px;
  }

  .brand small {
    font-size: 7px;
  }

  .nav-actions {
    gap: 4px;
  }

  .nav-actions .icon-button {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
  }

  .cart-button {
    min-height: 44px;
    padding: 7px 10px;
  }

  .search-panel {
    padding-bottom: 12px;
  }

  .search-panel input,
  .catalog-tools select {
    min-height: 48px;
    font-size: 16px;
  }

  .section {
    padding: 56px 0;
  }

  .hero-grid {
    padding-top: 42px;
  }

  .hero h1 {
    font-size: clamp(40px, 12vw, 51px);
    letter-spacing: -2px;
  }

  .hero-copy > p:not(.kicker) {
    font-size: 17px;
  }

  .hero-actions {
    display: grid;
  }

  .hero-actions .button {
    width: 100%;
    min-height: 50px;
  }

  .hero-visual {
    min-height: 315px;
  }

  .main-card {
    top: 50px;
    height: 225px;
  }

  .main-card span {
    font-size: 58px;
  }

  .main-card strong {
    font-size: 24px;
  }

  .collection-grid button {
    min-height: 148px;
    padding: 16px 10px;
  }

  .shop-head h2,
  .section-title h2 {
    font-size: 34px;
  }

  .catalog-tools {
    align-items: center;
  }

  .catalog-tools select {
    max-width: 58%;
  }

  .filter-row {
    flex-wrap: nowrap;
    gap: 8px;
    margin-right: -14px;
    margin-left: -14px;
    padding: 0 14px 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-row button {
    flex: 0 0 auto;
    min-height: 44px;
    scroll-snap-align: start;
  }

  .product-grid {
    gap: 22px 10px;
  }

  .product-card {
    min-width: 0;
  }

  .product-image {
    border-radius: 14px;
  }

  .quick-add {
    right: 8px;
    bottom: 8px;
    width: 44px;
    height: 44px;
  }

  .product-info {
    padding: 10px 2px;
  }

  .product-info h3 {
    overflow-wrap: anywhere;
  }

  .story-art {
    min-height: 310px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  #productDialog,
  #checkoutDialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .dialog-close {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .detail-gallery {
    padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
  }

  .detail-main {
    max-height: 48dvh;
    object-fit: contain;
    background: #f7f0e8;
  }

  .thumbs {
    padding-bottom: 3px;
    scroll-snap-type: inline proximity;
  }

  .thumbs button {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
    scroll-snap-align: start;
  }

  .detail-copy {
    padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  }

  .detail-copy h2 {
    padding-right: 42px;
  }

  .option-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .option-value {
    min-height: 48px;
    padding: 8px;
  }

  .add-button {
    min-height: 52px;
  }

  .detail-description {
    max-height: none;
  }

  .cart-drawer {
    width: 100%;
    height: 100dvh;
  }

  .cart-head {
    min-height: 64px;
    padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  }

  .cart-head .icon-button,
  .cart-remove {
    min-width: 44px;
    min-height: 44px;
  }

  .cart-items {
    padding: 12px 16px;
    overscroll-behavior: contain;
  }

  .cart-item {
    grid-template-columns: 68px minmax(0, 1fr) 44px;
    align-items: start;
  }

  .cart-item img {
    width: 68px;
    height: 68px;
  }

  .cart-footer {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    background: white;
  }

  .cart-footer .checkout {
    min-height: 52px;
  }
}

@media (max-width: 370px) {
  .brand small {
    display: none;
  }

  .brand {
    grid-template-rows: auto;
  }

  .cart-button {
    font-size: 0;
  }

  .cart-button span {
    margin-left: 0;
    font-size: 11px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-image {
    aspect-ratio: 1 / .92;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
