/* MEMO mobile experience — deliberately loaded last. */
@media (max-width: 767px) {
  :root {
    --mobile-gutter: 18px;
    --mobile-radius: 14px;
    --mobile-shadow: 0 14px 36px rgba(17, 14, 9, .08);
  }

  html { scroll-padding-top: 74px; }
  body { background: #f8f6f1; line-height: 1.65; }
  .shell { width: calc(100% - (var(--mobile-gutter) * 2)); }
  main { min-height: 60svh; }

  /* Compact, balanced mobile header. */
  .site-header,
  .site-header.is-sticky {
    height: 66px;
    padding-top: env(safe-area-inset-top);
    background: rgba(250, 248, 243, .94);
    color: #111;
    border-color: rgba(17, 17, 17, .08);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
  }
  .home .site-header:not(.is-sticky) {
    background: linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent);
    color: #fff;
    border-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .has-announcement .site-header:not(.is-sticky) { inset-block-start: 32px; }
  .header__inner { height: 100%; gap: 8px; }
  .header-primary { gap: 2px; }
  .header-primary > .brand { width: 62px; height: 48px; }
  .brand img { width: 62px; height: 46px; }
  .header-actions { gap: 2px; }
  .header-actions .desktop-only { display: none !important; }
  .header-actions .icon-btn,
  .header-primary > .mobile-only {
    width: 42px;
    height: 42px;
    border-radius: 50%;
  }
  .site-header.is-sticky .header-actions .icon-btn:active,
  .site-header.is-sticky .header-primary > .mobile-only:active { background: #eee9df; }
  .cart-link b { min-width: 17px; height: 17px; font-size: 8px; border: 2px solid #f8f6f1; }

  /* Cinematic hero with readable copy and thumb-friendly actions. */
  .ref-hero {
    height: min(82svh, 680px);
    min-height: 540px;
    border-radius: 0 0 22px 22px;
  }
  .ref-hero > img { object-position: 62% center; transform: scale(1.015); }
  .ref-hero__overlay {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, .12) 25%, rgba(0, 0, 0, .85) 88%),
      linear-gradient(90deg, rgba(0, 0, 0, .32), transparent 65%);
  }
  .ref-hero__copy {
    justify-content: flex-end;
    align-items: stretch;
    padding: 0 0 max(40px, env(safe-area-inset-bottom));
  }
  .hero-kicker { margin-bottom: 10px; color: #e3bd69; letter-spacing: .14em; }
  .ref-hero__copy h1 {
    max-width: 340px;
    margin-bottom: 12px;
    font-size: clamp(2.25rem, 10.5vw, 3.15rem);
    line-height: 1.08;
    letter-spacing: -.05em;
  }
  .ref-hero__copy p { max-width: 335px; margin-bottom: 20px; color: rgba(255,255,255,.82); font-size: 12px; }
  .ref-hero__copy > div { display: grid; grid-template-columns: 1fr auto; gap: 10px; max-width: 100%; }
  .ref-hero__copy .btn { min-height: 50px; border-radius: 8px; font-size: 11px; }
  .hero-about-link { min-height: 50px; padding-inline: 8px; border: 0; font-size: 10px; white-space: nowrap; }
  .hero-scroll { display: none; }

  /* Sections and horizontal discovery rails. */
  .category-rail,
  .ref-products,
  .instagram-strip { padding-block: 34px; }
  .section-title { margin-bottom: 18px; gap: 14px; }
  .section-title h2 { font-size: 20px; line-height: 1.3; }
  .section-title a { flex: 0 0 auto; min-height: 36px; display: inline-flex; align-items: center; }
  .category-rail__grid {
    gap: 12px;
    margin-inline: calc(var(--mobile-gutter) * -1);
    padding: 0 var(--mobile-gutter) 6px;
    scroll-padding-inline: var(--mobile-gutter);
    overscroll-behavior-inline: contain;
  }
  .category-rail__grid > a { flex: 0 0 min(44vw, 180px); text-align: right; }
  .category-rail__grid > a > div {
    aspect-ratio: .9;
    margin-bottom: 10px;
    border-radius: var(--mobile-radius);
    box-shadow: var(--mobile-shadow);
  }
  .category-rail__grid strong { font-size: 13px; }
  .category-rail__grid small { margin-top: 2px; font-size: 9px; }

  /* Product cards: larger image, cleaner information hierarchy. */
  .ref-products .product-grid,
  .shop-results .product-grid,
  .related .product-grid { gap: 28px 10px; }
  .product-card__media { border-radius: 12px; overflow: hidden; box-shadow: 0 7px 24px rgba(29, 22, 12, .06); }
  .product-card__media::after { border-radius: inherit; }
  .product-card__info { padding: 11px 2px 0; gap: 5px; }
  .product-card__category { margin-bottom: 4px; color: #8b857b; font-size: 9px; }
  .product-card__info h3 { margin-bottom: 5px; font-size: 12px; line-height: 1.45; }
  .product-card__info .price { font-size: 11px; color: #a57624; }
  .product-card__cta { display: none; }
  .badge { top: 9px; left: 9px; border-radius: 999px; padding: 4px 9px; }
  .wish-form { top: 5px; right: 5px; }
  .wish-form .icon-btn { background: rgba(255,255,255,.9); box-shadow: 0 4px 12px #0001; }

  .essentials-banner {
    width: calc(100% - 20px);
    height: 235px;
    margin: 8px auto 28px;
    border: 0;
    border-radius: 18px;
    box-shadow: var(--mobile-shadow);
  }
  .essentials-banner::after { background: linear-gradient(90deg, rgba(0,0,0,.84), rgba(0,0,0,.12)); }
  .essentials-banner > div { right: 22px; max-width: 72%; }
  .essentials-banner p { font-size: 20px; }
  .essentials-banner h2 { margin-block: 9px 17px; font-size: 15px; line-height: 1.45; }
  .essentials-banner .btn { min-height: 44px; border-radius: 7px; }

  .service-strip {
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 8px var(--mobile-gutter) 30px;
    border: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .service-strip::-webkit-scrollbar { display: none; }
  .service-strip > div {
    flex: 0 0 152px;
    min-height: 128px;
    padding: 22px 12px 16px;
    border: 1px solid #e8e2d7 !important;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(24, 19, 10, .04);
    scroll-snap-align: start;
  }
  .service-strip svg { width: 27px; height: 27px; margin-bottom: 12px; }
  .service-strip strong,
  .service-strip small { white-space: normal; }
  .service-strip strong { font-size: 11px; line-height: 1.5; }
  .service-strip small { margin-top: 4px; font-size: 8px; line-height: 1.6; }

  .ref-products .product-rail { gap: 12px; margin-inline: calc(var(--mobile-gutter) * -1); padding-inline: var(--mobile-gutter); scroll-padding-inline: var(--mobile-gutter); }
  .ref-products .product-rail .product-card { flex: 0 0 min(72vw, 290px); }
  .ref-newsletter { margin-top: 8px; padding-block: 34px; }
  .ref-newsletter h2 { font-size: 20px; line-height: 1.45; }
  .ref-newsletter p { max-width: 320px; font-size: 10px; line-height: 1.8; }
  .ref-newsletter form { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 20px; }
  .ref-newsletter input,
  .ref-newsletter button { width: 100%; min-height: 50px; border-radius: 7px; }
  .ref-newsletter button { font-weight: 600; }
  .ref-newsletter form > small { margin-top: 2px; line-height: 1.7; }
  .instagram-strip > div:last-child { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .instagram-strip > div:last-child a { border-radius: 9px; }

  /* Store, product and conversion flows. */
  .collection-hero { padding-top: 102px; padding-bottom: 25px; }
  .collection-hero h1 { font-size: 30px; }
  .collection-hero > div p { max-width: 330px; font-size: 11px; }
  .shop-toolbar {
    top: 66px;
    height: 58px;
    margin-inline: calc(var(--mobile-gutter) * -1);
    padding-inline: var(--mobile-gutter);
    background: rgba(248,246,241,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .filter-trigger { min-height: 42px; padding-inline: 12px; border: 1px solid #ded8cd; border-radius: 8px; background: #fff; }
  .results-count { display: none; }
  .sort-form select { min-height: 42px; max-width: 145px; border-radius: 8px; background-color: #fff; }
  .filters { border: 0; padding: 18px var(--mobile-gutter) max(30px, env(safe-area-inset-bottom)); }
  .filters .btn { width: 100%; min-height: 50px; margin-top: 10px; border-radius: 8px; }

  .pdp { width: 100%; padding-top: 66px; }
  .pdp-gallery { gap: 0; scroll-snap-type: x mandatory; }
  .pdp-gallery figure,
  .pdp-gallery figure:first-child { flex: 0 0 100%; width: 100%; scroll-snap-align: center; }
  .pdp-gallery figure:not(:first-child) { display: block; }
  .pdp-gallery figure,
  .pdp-gallery figure img { border-radius: 0; }
  .gallery-count { bottom: 14px; border-radius: 999px; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); }
  .pdp-info { padding: 27px var(--mobile-gutter) 112px; background: #f8f6f1; }
  .pdp-info h1 { margin-bottom: 11px; font-size: 27px; }
  .pdp-lead { font-size: 12px; line-height: 1.8; }
  .pdp-delivery,
  .pdp-trust { border-color: #ded8cd; }
  .variant-form fieldset { margin-bottom: 22px; }
  .choice-row.sizes span { min-width: 48px; height: 46px; border-radius: 7px; }
  .add-btn,
  .buy-now { min-height: 52px; border-radius: 8px; }
  .pdp-tools { display: grid; grid-template-columns: 1fr 1fr; }
  .pdp-tools button { min-height: 46px; border-radius: 7px; }
  .pdp-accordions details { padding-block: 17px; }
  .mobile-buybar {
    min-height: calc(74px + env(safe-area-inset-bottom));
    padding: 10px var(--mobile-gutter) max(10px, env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .mobile-buybar button { min-height: 48px; border-radius: 8px; }

  .cart-page,
  .checkout,
  .wishlist-page,
  .account { padding-top: 100px; }
  .cart-summary,
  .checkout-summary,
  .account aside,
  .account-content { border-radius: 12px; box-shadow: var(--mobile-shadow); }
  .checkout-form section { padding: 20px 16px; border-radius: 12px; background: #fff; box-shadow: 0 7px 24px rgba(29,22,12,.04); }
  .field input:not([type=checkbox]):not([type=radio]),
  .field select,
  .field textarea { border-radius: 8px; background: #fff; }
  .auth-form { padding-inline: var(--mobile-gutter); }

  /* Footer remains useful without becoming a wall of links. */
  .site-footer { padding-top: 42px; }
  .footer-top { gap: 30px 18px; }
  .footer-top > div:first-child { padding-bottom: 22px; border-bottom: 1px solid #ffffff18; }
  .footer-top h3 { margin-bottom: 13px; color: #d6aa4c; font-size: 11px; }
  .footer-top a { min-height: 36px; margin: 0; display: flex; align-items: center; line-height: 1.45; }
  .footer-bottom { align-items: flex-start; gap: 12px; font-size: 9px; }
  .footer-bottom > div { flex-wrap: wrap; gap: 8px 14px; }

  .back-to-top { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  :root { --mobile-gutter: 14px; }
  .header-actions .icon-btn { width: 38px; }
  .ref-hero { min-height: 510px; }
  .ref-hero__copy h1 { font-size: 2.15rem; }
  .ref-hero__copy > div { grid-template-columns: 1fr; }
  .hero-about-link { justify-content: flex-start; min-height: 36px; padding: 0; }
  .category-rail__grid > a { flex-basis: 47vw; }
  .product-card__info h3 { font-size: 11px; }
  .service-strip > div { flex-basis: 142px; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-top > div:first-child { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .ref-hero > img { transform: none; }
}
