/* Components for the customer LIFF app (storefront /app). Needs theme.css first. */
* { box-sizing: border-box; }
body { margin: 0; padding-bottom: 84px; font-size: 15px; line-height: 1.5; }
a { color: inherit; }

/* ---------- top bar ---------- */
header {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  height: 58px; padding: 0 16px; color: var(--ink);
  background: rgba(248,246,241,.86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
header h1 { flex: 1; margin: 0; font-size: 16px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header h1.brand { font-family: var(--serif); font-size: 19px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
header .back, header .spacer { width: 36px; height: 36px; flex: none; }
header .back { display: grid; place-items: center; border: 0; background: none; color: var(--ink); cursor: pointer; border-radius: 50%; }
header .back:hover { background: var(--emerald-soft); }
header .back[hidden] { display: grid; visibility: hidden; }

main { max-width: 760px; margin: 0 auto; padding: 18px 16px 24px; }

/* ---------- bottom tab bar ---------- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex;
  background: rgba(255,255,255,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0 9px; font-size: 11px; letter-spacing: .02em; color: var(--muted); text-decoration: none; }
nav.tabs a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs a.on { color: var(--emerald); font-weight: 600; }
nav.tabs a.on::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 17px; text-align: center; }

/* ---------- editorial hero ---------- */
.hero-ed {
  position: relative; overflow: hidden; border-radius: 22px; padding: 30px 24px 28px; margin-bottom: 22px; color: #F4EFE4;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(176,141,87,.28) 0%, rgba(176,141,87,0) 55%),
    linear-gradient(160deg, #1E4636 0%, #13301F 100%);
}
.hero-ed::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(217,199,164,.28); border-radius: 15px; pointer-events: none; }
.hero-ed .eyebrow { color: var(--gold-soft); display: flex; align-items: center; gap: 10px; }
.hero-ed .eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--gold-soft); }
.hero-ed h2 { font-family: var(--serif); font-size: 27px; line-height: 1.3; font-weight: 600; margin: 12px 0 8px; }
.hero-ed p { margin: 0; font-size: 14px; color: rgba(244,239,228,.72); max-width: 30em; }

/* ---------- search + filters ---------- */
.search { position: relative; margin-bottom: 14px; }
.search svg { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%);
  stroke: var(--muted); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.search input { height: 48px; padding: 0 18px 0 44px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.search input:focus { border-color: var(--emerald); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; margin-bottom: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 14px; }
.section-head h3 { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0; }
.section-head span { font-size: 12px; color: var(--muted); letter-spacing: .04em; }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.pcard { cursor: pointer; }
.pcard .ph { overflow: hidden; border-radius: var(--radius); background: var(--emerald-soft); aspect-ratio: 4 / 5; }
.pcard img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.pcard:hover img { transform: scale(1.04); }
.pcard .info { padding: 10px 2px 0; }
.pcard .shopname { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pcard .name { margin-top: 3px; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .price { margin-top: 4px; font-size: 15px; }
.price { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.soldout { font-size: 11px; color: var(--muted); margin-left: 6px; font-weight: 400; }

/* ---------- product detail ---------- */
.pd-img { margin: -18px -16px 0; aspect-ratio: 1 / 1; max-height: 60vh; width: calc(100% + 32px); background: var(--emerald-soft); overflow: hidden; }
@media (min-width: 620px) { .pd-img { margin: 0; width: 100%; border-radius: var(--radius); } }
.pd-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd { padding: 22px 2px 0; }
.pd .shop { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); text-decoration: none; font-weight: 600; }
.pd h2 { font-family: var(--serif); font-size: 24px; line-height: 1.35; font-weight: 600; margin: 6px 0 8px; }
.pd .price { font-size: 22px; }
.pd .meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.pd .meta span { font-size: 12px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.pd .desc { color: #4A4D48; white-space: pre-wrap; padding: 16px 0; border-top: 1px solid var(--line); }
.buybar { position: sticky; bottom: 64px; z-index: 4; display: flex; gap: 10px; align-items: center; margin: 8px -16px 0; padding: 12px 16px;
  background: rgba(248,246,241,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }

/* ---------- generic ---------- */
input, textarea, select { width: 100%; font: inherit; color: var(--ink); padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); outline: none; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--emerald); }
textarea { min-height: 84px; resize: vertical; }
label { display: block; font-size: 12px; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border: 0; border-radius: 999px;
  font: inherit; font-weight: 600; letter-spacing: .02em; cursor: pointer; background: var(--emerald); color: #fff; transition: background .15s, transform .1s; }
.btn:hover { background: var(--emerald-deep); }
.btn:active { transform: scale(.98); }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid var(--line); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: default; }

.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.pad { padding: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.list > * + * { border-top: 1px solid var(--line); }
.item { padding: 14px 18px; }
.item img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: var(--emerald-soft); }
.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--card); }
.qty button { width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; cursor: pointer; font-size: 16px; color: var(--ink); }
.qty button:hover { background: var(--emerald-soft); }
.qty input { width: 34px; border: 0; padding: 0; text-align: center; background: none; }
.buybar .qty { height: 48px; padding: 0 6px; }
.muted { color: var(--muted); font-size: 13px; }
.label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.stack > * + * { margin-top: 12px; }
.total { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.status { display: inline-block; font-size: 11px; letter-spacing: .04em; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.s-pending { background: #F6EFE2; color: #8A6326; } .s-paid { background: #E9EEF3; color: #34506E; }
.s-shipped { background: #ECEEEB; color: #3E4A42; } .s-completed { background: var(--emerald-soft); color: var(--emerald); }
.s-cancelled { background: #F0EFEC; color: #8A8C85; }
#qr { display: flex; justify-content: center; padding: 14px; background: #fff; border-radius: 12px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 10; padding: 11px 20px; border-radius: 999px;
  background: rgba(19,21,19,.92); color: #fff; font-size: 14px; box-shadow: var(--shadow); white-space: nowrap; }
.empty { text-align: center; padding: 64px 0; color: var(--muted); }
.empty .serif { display: block; font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.devbar { display: flex; gap: 8px; align-items: center; padding: 6px 16px; font-size: 12px; background: #F3EEDF; color: #6D5A35; }
.devbar input { width: auto; flex: 1; padding: 4px 10px; border-radius: 8px; }
.devbar .btn { height: 28px; }

/* ---------- brand logo ---------- */
header .logo { position: absolute; left: 50%; transform: translateX(-50%); display: flex; }
header .logo[hidden] { display: none; }  /* inner pages show a title instead */
header .logo img { height: 42px; width: auto; display: block; }
.brand-foot { text-align: center; margin: 36px 0 4px; padding-top: 30px; border-top: 1px solid var(--line); }
.brand-foot img { width: 190px; display: block; margin: 0 auto 10px; }
.brand-foot small { font-size: 11px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }

/* ---------- partner logos (small row at the very bottom, inside the footer) ---------- */
.partners { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.partners .eyebrow { color: var(--muted); font-size: 10px; margin-bottom: 12px; }
.plogos { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.plogos a, .plogos span { display: block; width: 58px; height: 58px; padding: 5px; overflow: hidden; background: #fff;
  border-radius: 12px; border: 1px solid var(--line); transition: transform .15s; }
@media (min-width: 620px) { .plogos a, .plogos span { width: 68px; height: 68px; } }
.plogos a:hover { transform: translateY(-2px); }
.plogos img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- payment steps + slip upload ---------- */
.steps { list-style: none; display: flex; margin: 12px 0 0; padding: 16px 8px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.steps li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.3; }
.steps li::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 1px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.now::before { background: var(--emerald); }
.steps i { position: relative; z-index: 1; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  font-size: 12px; font-weight: 600; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.steps li.done i { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.steps li.now i { border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 3px rgba(176,141,87,.18); }
.steps li.now span { color: var(--ink); font-weight: 600; }
.slip-box { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.slip-drop { width: 100%; display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 22px 16px; cursor: pointer;
  border: 1.5px dashed var(--gold-soft); border-radius: 14px; background: #FCFAF5; font: inherit; color: var(--ink); }
.slip-drop:hover { border-color: var(--gold); }
.slip-drop span { font-size: 12px; color: var(--muted); }
.slip-done { display: flex; gap: 14px; align-items: center; }
.slip-thumb { width: 64px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; flex: none; }
.slip-preview { display: block; max-width: 220px; max-height: 320px; margin: 14px auto 12px; border-radius: 12px; box-shadow: var(--shadow); }
.linkbtn { background: none; border: 0; padding: 6px 0 0; font: inherit; font-size: 13px; color: var(--emerald); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.s-review { background: #F6EFE2; color: #8A6326; box-shadow: inset 0 0 0 1px var(--gold-soft); }
.slip-drop[hidden] { display: none; }

/* ---------- form validation ---------- */
.req { color: var(--red); }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 18px; }
.field-hint.ok { color: var(--emerald); font-weight: 600; }
.field-hint.err { color: var(--red); }
input.bad, textarea.bad { border-color: var(--red); background: #FFF8F8; }

/* ---------- shipping, deadline, refunds, consent, my data ---------- */
.sum-row { padding: 4px 0; font-size: 14px; }
.sum-row.grand { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.ship-row { background: #FCFAF5; font-size: 13px; }
.hint-gold { color: #8A6326; }
.free { color: var(--emerald); font-size: 13px; }
.due { margin-top: 2px; font-size: 13px; color: #8A6326; font-weight: 600; }
.refund-note { background: #F6EFE2; color: #6D5A35; font-size: 14px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; color: var(--ink); font-size: 13px; letter-spacing: 0; line-height: 1.6; }
.consent input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--emerald); }
.consent a { color: var(--emerald); }
.foot-links { margin-top: 8px; font-size: 12px; color: var(--muted); }
.foot-links a { color: var(--muted); }
