/* ==========================================================================
   STARS 29 — mobile.css
   Touch and small-screen refinements. Loaded last.

   Everything in this file lives inside a media query, so the desktop
   layout and behaviour are untouched by construction. If you are debugging
   something on a large screen, this file is not the cause.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Touch baseline — applies to any pointer that cannot hover
   -------------------------------------------------------------------------- */
@media (hover: none) {

  html { -webkit-tap-highlight-color: transparent; }

  /* Hover effects are dead weight on a touch screen; swap them for a press
     state so taps still feel acknowledged. */
  .btn:active,
  .icon-btn:active,
  .chip:active,
  .size:active,
  .pdp__thumb:active { transform: scale(0.97); }

  .btn::before { display: none; }
  .btn:active { background: var(--ink); color: #fff; border-color: var(--ink); }
  .btn--solid:active { background: var(--accent); color: var(--ink); }
  .btn--light:active { background: #fff; color: var(--ink); }

  .pcard:hover .pcard__media img { transform: none; }
  .pcard:hover .pcard__media img + img { opacity: 0; }
  .look__item:hover img { transform: none; }
  .coll-row:hover h3 { transform: none; color: inherit; }
  .cat-row:hover { transform: none; }
  .link-u::after { display: none; }
}

/* --------------------------------------------------------------------------
   1b. Reveal-on-hover affordances
   Plenty of touch devices still report `hover: hover`, so anything that would
   otherwise be unreachable by a finger is unlocked by EITHER signal.
   -------------------------------------------------------------------------- */
@media (hover: none), (max-width: 1024px) {

  /* The add-to-bag pill only appears on hover, which may never happen here.
     Pin it as a thumb-sized button in the corner of the photo instead. */
  /* Bottom-left: the chamfer cuts the top-left and bottom-right corners, so
     this is the only corner the button can sit square in. */
  .pcard__quick {
    opacity: 1;
    transform: none;
    right: auto;
    left: 10px;
    bottom: 10px;
    justify-content: flex-start;
  }
  .pcard__quick .btn {
    width: 42px;
    height: 42px;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
  }
  .pcard__quick .btn svg { display: none; }
  .pcard__quick .btn::before { display: none; }
  .pcard__quick .btn { font-size: 0; }
  .pcard__quick .btn::after {
    content: "+";
    font-size: 21px;
    font-weight: 400;
    line-height: 1;
    color: var(--ink);
  }
  .pcard__quick .btn:active { background: var(--accent); }

  /* The category list fades out down the column on the assumption you can
     hover to bring a row forward. Without that, every row must be legible. */
  .cats__list li:nth-child(1) .cat-row,
  .cats__list li:nth-child(2) .cat-row,
  .cats__list li:nth-child(3) .cat-row,
  .cats__list li:nth-child(4) .cat-row,
  .cats__list li:nth-child(5) .cat-row { color: var(--ink-2); }
  .cats__list li .cat-row.is-on { color: var(--ink); }
}

/* --------------------------------------------------------------------------
   2. Small screens
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {

  /* A 14px blur over a full-bleed photo is expensive on a mid-range phone.
     Half the radius and a shorter travel keep the entrance without the cost. */
  [data-reveal] {
    filter: blur(7px);
    transform: translateY(16px);
    transition-duration: 0.7s, 0.7s, 0.75s;
  }

  /* Give the thumb something to aim at */
  .icon-btn { width: 44px; height: 44px; }
  .btn { height: 48px; }
  .btn--lg { height: 52px; }
  .size { min-width: 56px; height: 46px; }

  /* Filters read better as one swipeable row than as a wrapped block */
  .shop__bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  /* These are flex items in a column container, where they otherwise size to
     their content and burst out of the gutter. Width is stated explicitly:
     the chips bleed a full gutter each side and scroll inside that. */
  .chips {
    width: calc(100% + var(--gutter) * 2);
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scroll-padding-inline: var(--gutter);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; height: 40px; }
  .shop__sort { width: 100%; justify-content: space-between; }
  .shop__sort select { height: 40px; flex: 0 1 200px; min-width: 0; }

  /* Product gallery: a swipeable strip beats five 60px squares */
  .pdp__thumbs {
    width: calc(100% + var(--gutter) * 2);
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 74px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .pdp__thumbs::-webkit-scrollbar { display: none; }

  .quote-text { min-height: 0; }
  .quotes__mark { width: 44px; height: 44px; font-size: 19px; padding-top: 10px; }

  .tribe-stack img,
  .tribe-stack .tribe-stack__more { width: 40px; height: 40px; }

  .value { padding: 22px 20px; }
  .stats { gap: 22px 18px; }
  .stat b { font-size: 2rem; }

  .ticker__track { animation-duration: 26s; gap: 26px; }
  .ticker__item { gap: 26px; }

  /* Stacked, the two-column feature left each price sitting under the WRONG
     photo. Flatten the side column so every price follows its own image. */
  .feature__grid {
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 4vw, 30px);
  }
  .feature__side { display: contents; }
  .feature__main   { order: 1; }
  .feature__price  { order: 2; align-self: flex-start; }
  .feature__copy   { order: 3; max-width: none; }
  .feature__media2 { order: 4; margin-top: 0; }
  .feature__aside  { order: 5; }
  .feature__thumb  { display: none; }
  .feature__main .mark-asterisk { top: -10px; left: 0; }
}

/* --------------------------------------------------------------------------
   3. Lookbook — pair the detail shots so the page is not twelve tall scrolls
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .m-a, .m-d { grid-column: span 12; aspect-ratio: 4 / 3.4; }
  .m-b, .m-c, .m-e { grid-column: span 6; aspect-ratio: 4 / 5; }
  .mosaic figcaption { left: 10px; bottom: 10px; padding: 6px 10px; font-size: 10px; }
}

/* --------------------------------------------------------------------------
   4. Sticky buy bar (product page)
   The inline Add to bag sits below a full-height gallery on a phone, so it
   is off screen for most of the page. This keeps it one thumb away.
   -------------------------------------------------------------------------- */
.buybar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: none;
  align-items: center;
  gap: 14px;
  padding: 12px var(--gutter);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease);
}
.buybar.is-on { transform: none; }
.buybar__info { flex: 1; min-width: 0; }
.buybar__name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.015em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buybar__price { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.buybar .btn { flex: none; }

@media (max-width: 1024px) {
  .buybar { display: flex; }
  /* Keep the end of the document clear of the bar, and lift the toast over it.
     `has-buybar` is set by product.js so this needs no :has() support. */
  .has-buybar .site-foot { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }
  .buybar.is-on ~ .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}

/* --------------------------------------------------------------------------
   5. Notch and home-indicator safe areas
   -------------------------------------------------------------------------- */
@supports (padding: env(safe-area-inset-bottom)) {
  .drawer__foot { padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
  .drawer__empty { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .menu__foot { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .site-foot { padding-bottom: calc(34px + env(safe-area-inset-bottom)); }
}

/* --------------------------------------------------------------------------
   6. Very narrow screens
   -------------------------------------------------------------------------- */
@media (max-width: 380px) {
  .site-head__logo img { width: 88px; }
  .prod-grid, .prod-grid--3 { gap: 18px 10px; }
  .pcard__name { font-size: 0.94rem; }
  .pcard__price { font-size: 0.94rem; }
  .buybar { gap: 10px; padding-inline: 14px; }
  .buybar .btn { padding: 0 16px; }
}

/* --------------------------------------------------------------------------
   7. Landscape phones — the hero should not eat the whole screen
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) and (orientation: landscape) and (max-height: 520px) {
  .hero__figure .c-frame { min-height: 260px; }
  .menu__body { align-content: start; }
  .menu__link { font-size: clamp(1.4rem, 4vw, 2.2rem); }
}
