/* ==========================================================================
   Terrain — mobile: drawer navigation, touch targets, small-screen spacing.
   ========================================================================== */

/* wp_nav_menu emits <li>; without this they render list markers in the flex row */
.t-nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.t-nav__list li { list-style: none; margin: 0; padding: 0; }

/* desktop order: wordmark · nav (pushed right) · cart · (burger hidden) */
.t-nav { order: 2; }
.t-cartbtn--bar { order: 3; }
.t-burger {
  order: 4; display: none; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--b-12); background: rgba(232, 226, 212, .05);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  cursor: pointer; -webkit-tap-highlight-color: transparent; flex: none; padding: 0;
}
.t-burger span { display: block; width: 18px; height: 2px; background: var(--sand); border-radius: 1px; transition: transform .25s var(--ease), opacity .2s; }
.t-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.t-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.t-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 899px) {
  /* backdrop-filter on an ancestor makes position:fixed descendants resolve
     against THAT box, not the viewport (CSS Filter Effects 2). The drawer sits
     inside the header, so with the blur on it collapsed to a 0-height strip.
     Trade the blur for a near-opaque header on phones. */
  .t-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--ink); }
  .t-header__row { gap: 10px; }
  .t-wordmark { margin-right: auto; }
  .t-cartbtn--bar { min-height: 44px; }
  .t-burger { display: flex; }

  /* the inline nav becomes a full-height drawer */
  .t-nav {
    position: fixed; top: 74px; left: 0; right: 0; bottom: 0; z-index: 55;
    margin-left: 0; order: 0; display: flex; flex-direction: column; align-items: stretch; gap: 6px;
    padding: 18px var(--sec-x) max(24px, env(safe-area-inset-bottom));
    background: var(--ink); border-top: 1px solid var(--b-10);   /* opaque: a .98 layer visibly ghosted the page beneath */
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(100%); visibility: hidden;
    transition: transform .3s var(--ease), visibility 0s linear .3s;
  }
  .t-nav.is-open { transform: none; visibility: visible; transition: transform .3s var(--ease); }
  body.t-nav-open { overflow: hidden; }

  .t-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .t-nav a, .t-nav button, .t-nav summary {
    display: flex; align-items: center; min-height: 48px; padding: 12px 14px;
    font-size: 17px; letter-spacing: .04em; border-radius: 10px;
  }
  .t-nav .t-more { width: 100%; }
  .t-nav .t-more__panel {
    position: static; min-width: 0; box-shadow: none; border: 0; background: transparent;
    padding: 0 0 6px 14px;
  }
  .t-nav .t-more__panel a { font-size: 15px; min-height: 44px; }
  .t-nav .t-search { margin-top: 10px; width: 100%; padding: 4px 12px; min-height: 48px; }
  .t-nav .t-search input { width: 100%; font-size: 16px; } /* 16px stops iOS zooming the field */
}

/* ---------- announcement bar on small screens ---------- */
@media (max-width: 560px) {
  .t-announce { font-size: 12px; padding: 8px 44px 8px 14px; justify-content: flex-start; text-align: left; line-height: 1.35; }
  .t-announce__sep, .t-announce__tel { display: none; }
  .t-announce__x { width: 44px; height: 44px; right: 0; display: flex; align-items: center; justify-content: center; }
}

/* ---------- touch targets and spacing ---------- */
@media (max-width: 767px) {
  .t-btn, .t-btn--sm { min-height: 44px; }
  .t-fchip { min-height: 40px; display: inline-flex; align-items: center; }
  .t-qty button { width: 44px; height: 46px; }
  .t-qty input { height: 46px; }
  .t-pills a, .t-tabs a { min-height: 40px; display: inline-flex; align-items: center; }
  .t-actions .t-btn { flex: 1 1 auto; }
  .t-buybox { max-width: none; padding: 20px 18px; border-radius: 16px; }
  /* keeps the price a clear step above .t-pdp__h1 on a phone too (28px there) */
  .t-price--lg { font-size: 36px; }
  .t-section { padding-left: 16px; padding-right: 16px; }
  .t-aside { position: static; max-width: none; }   /* sticky sidebars just eat the screen on a phone */
}

/* ---------- sticky buy bar (phones only) ----------
   Desktop keeps price and action in one column, so the bar never renders there.
   terrain.js adds .is-on once the real buy box scrolls out of view. */
.t-buybar { display: none; }

@media (max-width: 767px) {
  .t-buybar {
    display: flex; align-items: center; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    background: rgba(14, 16, 14, .94);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-top: 1px solid var(--b-16);
    transform: translateY(105%); visibility: hidden;
    transition: transform .28s var(--ease), visibility 0s linear .28s;
  }
  .t-buybar.is-on { transform: none; visibility: visible; transition: transform .28s var(--ease); }
  .t-buybar__fig { display: flex; flex-direction: column; gap: 2px; flex: none; min-width: 0; }
  .t-buybar__price { font-size: 22px; line-height: 1.05; }
  .t-buybar__price--ask { font-family: var(--font-display); font-weight: 800; font-size: 15px; }
  .t-buybar__plus { font-family: var(--font-mono); font-size: 9.5px; color: var(--t-42); }
  .t-buybar__cta { flex: 1 1 auto; justify-content: center; text-align: center; min-height: 48px; }
  /* the bar floats over the page end; give the footer room to clear it */
  body.single-product { padding-bottom: 76px; }
  /* the drawer must sit above the bar, not under it */
  .t-nav { z-index: 70; }
}

@media (prefers-reduced-motion: reduce) {
  .t-nav, .t-nav.is-open, .t-burger span { transition: none; }
  .t-buybar, .t-buybar.is-on { transition: none; }
}

/* ---------- polish: hero and fitted type on phones ---------- */
@media (max-width: 599px) {
  .t-fit__l { white-space: normal; }       /* wrap at the clamp() size; JS clears its fit */
}
@media (max-width: 767px) {
  .t-hero { min-height: 0; }
  .t-hero__dots { opacity: .3; }
}

/* ---------- shop filters collapse on phones ---------- */
@media (max-width: 767px) {
  .t-filters__sum {
    display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer;
    min-height: 48px; padding: 0 16px; border: 1px solid var(--b-12); border-radius: 12px;
    background: var(--panel); font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  }
  .t-filters__n { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--lime); font-weight: 400; }
  .t-filters__chev { margin-left: auto; width: 8px; height: 8px; border-right: 1.6px solid var(--lime); border-bottom: 1.6px solid var(--lime); transform: rotate(45deg); transition: transform .2s; }
  .t-filters[open] .t-filters__chev { transform: rotate(-135deg); }
  .t-filters form { padding: 18px 4px 4px; }
  .t-aside { margin-bottom: 6px; }

  /* cart + notices: every control reaches 44px */
  .t-line__rm { padding: 10px 12px; top: 10px; right: -12px; opacity: .6; font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; }
  .woocommerce a.button, .woocommerce button.button, .woocommerce input.button { min-height: 44px; }
  .woocommerce-message, .woocommerce-info { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

  /* checkout: one field per row, 48px inputs, full-width Place order */
  .woocommerce form .form-row-first, .woocommerce form .form-row-last,
  .woocommerce-page form .form-row-first, .woocommerce-page form .form-row-last { float: none; width: 100%; }
  .woocommerce .input-text, .woocommerce select, .t-form input, .t-form select, .select2-container .select2-selection { min-height: 48px; }
  #place_order, .woocommerce-page #place_order, .woocommerce-checkout #place_order,
  .woocommerce #payment #place_order, .woocommerce-page #payment #place_order { width: 100%; float: none; min-height: 50px; }
  .woocommerce-page .input-text, .woocommerce-page select { min-height: 48px; }
  .woocommerce-page form .form-row-first, .woocommerce-page form .form-row-last { float: none; width: 100%; }
  .t-fieldset { padding: 20px 18px; }

  /* footer links: comfortable to tap, still quiet */
  .t-footer li a { display: inline-block; padding: 8px 0; }
  .t-footer ul { gap: 0; }
}
