@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('fonts/sora-latin.woff2') format('woff2');
}

:root {
  --bg: #ffffff;
  --soft: #f5f2ef;
  --card: #ffffff;
  --ink: #17120e;
  --ink-soft: #8a8078;
  --accent: #f2bcc8;
  --accent-ink: #2a1219;
  --nav: #17120e;
  --nav-ink: #fffdfb;
  --line: #ece6e0;
  --shadow: 0 16px 40px rgba(23, 18, 14, 0.16);
  --shadow-soft: 0 8px 24px rgba(23, 18, 14, 0.08);
}

/* Deliberately light-only: the design commits to the white app look. */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.display { font-family: 'Sora', -apple-system, sans-serif; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app {
  width: min(560px, 100%);
  margin: 0 auto;
  min-height: 100svh;
  padding: 1.1rem 1.1rem 8.5rem;
}

/* ---------- shared header ---------- */
.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.appbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}
.round-btn {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--ink);
  text-decoration: none;
}
.round-btn svg { width: 19px; height: 19px; }
.round-btn.ghost { background: transparent; pointer-events: none; }

/* ---------- home view ---------- */
.greet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}
.greet small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.greet strong {
  font-family: 'Sora', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
}

.promo-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: var(--soft);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  margin-bottom: 1.6rem;
  box-shadow: var(--shadow-soft);
}
.promo-copy { padding: 1.15rem 0 1.15rem 1.15rem; }
.promo-bars {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
.promo-bars span {
  height: 3px;
  flex: 1;
  border-radius: 3px;
  background: var(--line);
}
.promo-bars span:first-child { background: var(--ink); }
.promo-copy h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.25;
  font-weight: 400;
}
.promo-copy h2 b {
  display: block;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-style: italic;
}
.promo-btn {
  display: inline-block;
  margin-top: 0.95rem;
  background: var(--nav);
  color: var(--nav-ink);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
}
.promo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 0.8rem;
}
.section-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.view-all {
  background: none;
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.82rem;
}
.view-all u {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.pillgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 1.6rem;
}
.hpill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.9rem 0.5rem 0.55rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  font-weight: 700;
  font-size: 0.88rem;
  text-align: left;
}
.hpill .ci {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--soft);
  display: grid;
  place-items: center;
}
.hpill .ci svg { width: 17px; height: 17px; }

/* ---------- menu view ---------- */
.toggle {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}
.tab {
  padding: 0.55rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.tab.on {
  background: var(--accent);
  color: var(--accent-ink);
}

.cats {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.2rem 0 0.9rem;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1.15rem 0.45rem 0.5rem;
  border-radius: 999px;
  background: var(--soft);
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
}
.cat .ci {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
}
.cat .ci svg { width: 16px; height: 16px; }
.cat.on {
  background: var(--nav);
  color: var(--nav-ink);
}
.cat.on .ci { background: rgba(255, 253, 251, 0.14); box-shadow: none; color: var(--nav-ink); }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
.tile {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow-soft);
  background: var(--soft);
}
.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.tile:hover img { transform: scale(1.04); }
.tile::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(to bottom, transparent, rgba(10, 7, 5, 0.72));
}
.tile h3 {
  position: absolute;
  z-index: 1;
  left: 0.95rem;
  right: 0.95rem;
  bottom: 0.85rem;
  margin: 0;
  color: #fffdfb;
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 800;
  text-wrap: balance;
}

/* ---------- detail view ---------- */
.detail-photo {
  width: min(240px, 64%);
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: var(--soft);
  box-shadow: var(--shadow-soft);
}
.detail-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.d-name {
  margin: 1.1rem 0 0.4rem;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
}
.d-desc {
  margin: 0 auto;
  max-width: 34ch;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.panel {
  margin-top: 1.3rem;
  background: var(--soft);
  border-radius: 24px 24px 0 0;
  padding: 1.4rem 1.2rem 1rem;
}
.panel::before {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin: -0.5rem auto 1rem;
}
.panel h3 {
  margin: 0 0 0.8rem;
  font-size: 1.05rem;
  font-weight: 800;
}
.panel section + section { margin-top: 1.4rem; }

.sizes {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.size {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.3rem;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 0.2s ease;
}
.size svg { display: block; }
.size.on { background: var(--accent); color: var(--accent-ink); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  font-weight: 700;
  font-size: 0.85rem;
}
.chip.on { background: var(--accent); color: var(--accent-ink); }

.req {
  width: 100%;
  border: none;
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--ink);
}
.req::placeholder { color: var(--ink-soft); }

/* black action bar */
.buybar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  width: min(528px, calc(100% - 1.8rem));
  background: var(--nav);
  color: var(--nav-ink);
  border-radius: 999px;
  padding: 0.6rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: var(--shadow);
  z-index: 30;
}
.qty-btn {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 253, 251, 0.35);
  color: var(--nav-ink);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  line-height: 1;
}
.qty {
  min-width: 1.6ch;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.add-btn {
  flex: 1;
  height: 52px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.98rem;
}

/* ---------- cart view ---------- */
.cart-line {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-line img {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  object-fit: cover;
  flex: none;
}
.cl-info { flex: 1; min-width: 0; }
.cl-info h4 { margin: 0; font-size: 0.95rem; font-weight: 800; }
.cl-info p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cl-qty button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}
.cl-qty span { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 1.4ch; text-align: center; }
.cl-price {
  width: 62px;
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

.summary {
  margin-top: 1.2rem;
  background: var(--soft);
  border-radius: 20px;
  padding: 1.1rem 1.2rem;
  font-size: 0.92rem;
}
.summary .row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  color: var(--ink-soft);
}
.summary .row.total {
  margin-top: 0.4rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
}
.summary .row span:last-child { font-variant-numeric: tabular-nums; }

.fineprint {
  margin: 0.8rem 0 0;
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-align: center;
}

.checkout {
  display: block;
  width: 100%;
  margin-top: 1rem;
  background: var(--nav);
  color: var(--nav-ink);
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  padding: 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 3rem 0 2rem;
}
.empty strong { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 0.3rem; }

/* ---------- bottom nav ---------- */
.badge {
  position: absolute;
  top: -9px;
  right: -13px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  width: min(528px, calc(100% - 1.8rem));
  background: var(--nav);
  color: var(--nav-ink);
  border-radius: 999px;
  padding: 0.95rem 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: var(--shadow);
  z-index: 20;
}
.dock a, .dock button {
  position: relative;
  color: var(--nav-ink);
  display: grid;
  place-items: center;
  text-decoration: none;
}
.dock a svg, .dock button svg { width: 22px; height: 22px; opacity: 0.55; }
.dock .on svg { opacity: 1; }

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(6.6rem + env(safe-area-inset-bottom));
  background: var(--nav);
  color: var(--nav-ink);
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  z-index: 40;
  animation: pop 0.25s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- checkout page ---------- */
.co-section {
  background: var(--soft);
  border-radius: 20px;
  padding: 1.2rem;
  margin-bottom: 1.1rem;
}
.co-section h2 { margin: 0 0 0.9rem; font-size: 1.05rem; font-weight: 800; }
.field { margin-bottom: 0.8rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.field input, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 0.75rem 0.9rem;
  font: inherit;
  color: var(--ink);
}
.paybox {
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 1rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.co-status {
  text-align: center;
  padding: 2rem 1rem;
}
.co-status h2 { font-size: 1.3rem; margin: 0 0 0.4rem; }
.co-status p { color: var(--ink-soft); margin: 0; }
.htmx-request .checkout { opacity: 0.6; pointer-events: none; }

@media (min-width: 900px) {
  .app { width: min(760px, 100%); }
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .tile img, .size { transition: none; }
  .toast { animation: none; }
}
