/* ══════════════════════════════════════════════════════════════
   Phone + tablet redesign (Sep 2026)
   Loaded with media="(max-width: 1023px)" in app/root.tsx, so NOTHING in
   this file can reach desktop. Design reference: Figma "✅ FINAL · Mobile &
   tablet design". Desktop stays the style guide: same fonts (Noto Serif JP
   titles, Satoshi body, DM Sans UI), same greens and cream.
   ══════════════════════════════════════════════════════════════ */

:root {
  --tcm-cream: #F5F0DC;
  --tcm-ivory: #FAF8F0;
  --tcm-line: #E6E0CC;
  --tcm-soft: #E6EFE2;
  --tcm-green: #2E7D32;
  --tcm-dgreen: #1B5E20;
  --tcm-ink: #2C2C2C;
  --tcm-grey: #5B6360;
  --tcm-persimmon: #B8412D;
  /* floating bar: 56 tab + 12 padding + 12 gap below */
  --tcm-bar-space: calc(96px + env(safe-area-inset-bottom, 0px));
}

/* ── Header: logo + search icon row, store strip below ──────────── */
/* Account, cart and the hamburger move to the bottom bar / Menu sheet. */
.nav-mobile-btn,
.nav-actions .nav-labeled { display: none !important; }
.nav-searchpill { display: none !important; }
:root { --nav-height: 120px; }

.tcm-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  border: 0;
  background: none;
  color: var(--tcm-ink);
  border-radius: 999px;
  cursor: pointer;
}
.tcm-search-btn:focus-visible { outline: 2px solid var(--tcm-green); outline-offset: 2px; }

.nav-storestrip {
  min-height: 44px;
  border-radius: 12px;
  font-size: 14px;
  padding: 8px 14px;
  background: var(--tcm-soft);
  border-color: transparent;
}

/* ── Floating bottom bar ───────────────────────────────────────── */
.tcm-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.tcm-bar-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: 540px;
  margin: 0 auto;
  padding: 6px;
  background: var(--tcm-cream);
  border: 1px solid var(--tcm-line);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}
.tcm-tab {
  flex: 1 1 0;
  min-width: 0;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--tcm-ink);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 15px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tcm-tab svg { width: 24px; height: 24px; stroke-width: 1.9; }
.tcm-tab.is-active {
  flex: 0 0 auto;
  padding: 0 14px;
  background: var(--tcm-dgreen);
  color: var(--tcm-cream);
  font-weight: 700;
}
.tcm-tab.is-active svg { stroke-width: 2.2; }
.tcm-tab:focus-visible { outline: 2px solid var(--tcm-dgreen); outline-offset: 2px; }
.tcm-bar-icon { position: relative; display: inline-flex; }
.tcm-bar-badge {
  position: absolute;
  top: -5px;
  right: -9px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--tcm-persimmon);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* Keep the last content (footer legal lines) and any focused element clear
   of the bar — WCAG 2.4.11 focus-not-obscured. */
body { padding-bottom: var(--tcm-bar-space); }
html { scroll-padding-bottom: calc(var(--tcm-bar-space) + 16px); }

/* "Amazon way": Add to cart / Continue to payment live in the page, and the
   bar is the only thing pinned to the bottom. */
.tc-sticky-buy,
.tc-cart-mobilebar { display: none !important; }

/* Minimized newsletter pill sits above the bar. */
.popup-pill { bottom: calc(var(--tcm-bar-space) + 8px) !important; }

/* ── Menu sheet (native <dialog>) ─────────────────────────────── */
.tcm-sheet {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--tcm-ivory);
  color: var(--tcm-ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tcm-sheet::backdrop { background: rgba(0, 0, 0, 0.45); }
.tcm-sheet[open] { animation: tcm-sheet-up 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes tcm-sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 768px) {
  .tcm-sheet {
    inset: 0;
    margin: auto;
    width: 600px;
    max-height: 86dvh;
    border-radius: 24px;
  }
}
@media (prefers-reduced-motion: reduce) { .tcm-sheet[open] { animation: none; } }

.tcm-sheet-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 768px) { .tcm-sheet-inner { padding: 22px 24px 24px; } }
.tcm-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.tcm-sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--tcm-ink);
}
.tcm-sheet-close {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tcm-line);
  border-radius: 999px;
  background: #fff;
  color: var(--tcm-ink);
  cursor: pointer;
}
.tcm-sheet-close svg { width: 20px; height: 20px; }

.tcm-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border: 1px solid var(--tcm-line);
  border-radius: 16px;
}
.tcm-duo-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 14px;
  border: 0;
  background: none;
  text-align: left;
  color: var(--tcm-ink);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.tcm-duo-cell + .tcm-duo-cell { border-left: 1px solid var(--tcm-line); }
.tcm-duo-cell b { display: block; font-family: var(--font-ui); font-size: 15px; font-weight: 700; }
.tcm-duo-cell small { display: block; font-size: 12px; color: var(--tcm-grey); }
.tcm-duo-cell small.tcm-duo-link { color: var(--tcm-green); font-weight: 600; }
.tcm-duo-ic {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--tcm-soft);
  color: var(--tcm-dgreen);
}
.tcm-duo-ic svg { width: 20px; height: 20px; }

.tcm-list {
  list-style: none;
  margin: 0;
  padding: 4px 12px;
  background: #fff;
  border: 1px solid var(--tcm-line);
  border-radius: 16px;
}
.tcm-list li + li { border-top: 1px solid var(--tcm-line); }
.tcm-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  color: var(--tcm-ink);
  text-decoration: none;
}
.tcm-list-ic {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--tcm-soft);
  color: var(--tcm-dgreen);
}
.tcm-list-ic svg { width: 20px; height: 20px; }
.tcm-list-label { flex: 1; font-family: var(--font-ui); font-size: 15.5px; font-weight: 600; }
.tcm-list-chev { width: 18px; height: 18px; color: var(--tcm-grey); }

.tcm-help { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tcm-help a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border: 1.5px solid var(--tcm-green);
  border-radius: 999px;
  color: var(--tcm-green);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.tcm-help svg { width: 18px; height: 18px; }

/* ── Store picker: bottom sheet on phones (desktop keeps its modal) ─ */
@media (max-width: 767px) {
  .tc-storepicker-overlay { align-items: flex-end; padding: 0; }
  .tc-storepicker {
    width: 100%;
    max-width: 100%;
    max-height: 88dvh;
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}
