/* Agnes 的衣橱 — "sweet macaron" theme. Mobile first: base styles are for phones, wider screens add on. */
:root {
  --bg: #FFF5F7;
  --card: #FFFFFF;
  --pink-50: #FFF0F4;
  --pink-100: #FFE3EC;
  --pink-200: #FFC9DA;
  --accent: #C8336F;
  --accent-hover: #B02A61;
  --accent-dark: #8C1D4B;
  --text: #4B2637;
  --muted: #8A5A6E;
  --mint: #CDEFE3;
  --mint-ink: #23584A;
  --butter: #FFF0C2;
  --butter-ink: #7A4E00;
  --lilac: #E9E1FF;
  --lilac-ink: #5B3FA8;
  --sky: #DDEBFA;
  --sky-ink: #2F5F8F;
  --danger: #B42318;
  --font-cute: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif;
  --font-round: 'Fredoka', 'Noto Sans SC', sans-serif;
  --font-script: 'Lobster', 'ZCOOL KuaiLe', 'Noto Sans SC', cursive;
  --font-body: 'Noto Sans SC', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.6; }
body.has-cart-bar { padding-bottom: 88px; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.25; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; margin: 0 auto; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

/* ---------- header ---------- */
.announce { margin: 0; background: var(--accent); color: #FFFFFF; text-align: center; font-size: 13px; font-weight: 500; padding: 6px 12px; }
.site-header { background: var(--card); border-bottom: 2px dashed var(--pink-200); }
.site-header .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 10px; padding-bottom: 10px; }
.logo { order: 1; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--accent); }
.logo svg { flex: none; }
.logo-text { min-width: 0; }
.logo-text b { display: block; font-family: var(--font-script); font-weight: 400; font-size: 27px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-text small { display: block; font-family: var(--font-cute); font-size: 14px; line-height: 1.2; color: var(--muted); letter-spacing: 1px; }
.header-cart { order: 2; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px 0 14px; border-radius: 999px; background: var(--accent); color: #FFFFFF; text-decoration: none; font-weight: 700; font-size: 14px; }
.header-cart .count { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; background: #FFFFFF; color: var(--accent); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.nav { order: 3; flex: 1 1 100%; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--pink-50); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav a:hover { background: var(--pink-100); }
@media (min-width: 900px) {
  .site-header .bar { flex-wrap: nowrap; gap: 28px; padding-top: 14px; padding-bottom: 14px; }
  .logo { flex: none; }
  .logo-text b { font-size: 30px; }
  .nav { order: 2; flex: 1 1 auto; margin: 0; padding: 0; overflow: visible; }
  .nav a { background: transparent; }
  .header-cart { order: 3; padding: 0 10px 0 18px; font-size: 15px; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; font: inherit; font-weight: 700; font-size: 15px; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 16px; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-soft { background: var(--pink-100); color: var(--accent-dark); }
.btn-soft:hover { background: var(--pink-200); }
.btn-ghost { background: #FFFFFF; border: 2px solid var(--pink-200); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-done { background: var(--accent); color: #FFFFFF; }
.btn-out { background: #FFFFFF; border: 2px dashed #E3C3CF; color: var(--muted); cursor: default; }
.btn-whatsapp { background: #1F7A4D; color: #FFFFFF; }
.btn-whatsapp:hover { background: #18633E; }
.btn-link-danger { background: none; border: 0; padding: 0 4px; min-height: 44px; color: var(--danger); font: inherit; font-weight: 700; font-size: 14px; text-decoration: underline; cursor: pointer; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- flash ---------- */
.flash { margin: 12px 0 0; padding: 12px 16px; border-radius: 16px; font-weight: 500; }
.flash-success { background: var(--mint); color: var(--mint-ink); }
.flash-error { background: #FDE2E1; color: #912018; }

/* ---------- hero ---------- */
.hero { display: grid; gap: 20px; align-items: center; padding: 22px 0 6px; }
.pill-tag { display: inline-block; margin: 0; padding: 4px 14px; border-radius: 999px; background: var(--mint); color: var(--mint-ink); font-weight: 700; font-size: 13px; }
.hero h1 { margin: 12px 0 8px; font-family: var(--font-cute); font-weight: 400; font-size: 34px; line-height: 1.2; white-space: pre-line; }
.hero p.lead { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.hero-art { display: none; }
@media (min-width: 768px) {
  .hero { grid-template-columns: 1.1fr 1fr; gap: 40px; padding: 48px 0 32px; }
  .hero h1 { font-size: 52px; }
  .hero p.lead { font-size: 17px; max-width: 460px; }
  .hero-art { display: block; position: relative; height: 320px; }
  .hero-art .bubble { position: absolute; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
}

/* ---------- how to buy ---------- */
.steps { display: grid; gap: 14px; margin: 10px 0 26px; padding: 16px; border-radius: 24px; background: var(--card); scroll-margin-top: 12px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .num { flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-round); font-weight: 700; font-size: 18px; }
.step h3 { margin: 0; font-size: 15px; }
.step p { margin: 0; font-size: 13px; color: var(--muted); }
.n1 { background: var(--pink-200); color: var(--accent-dark); }
.n2 { background: var(--butter); color: var(--butter-ink); }
.n3 { background: var(--mint); color: var(--mint-ink); }
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 24px 28px; border-radius: 32px; }
  .step .num { width: 48px; height: 48px; font-size: 22px; }
  .step h3 { font-size: 17px; }
  .step p { font-size: 14px; }
}

/* ---------- sections ---------- */
.section { padding: 0 0 32px; scroll-margin-top: 12px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.section-title { margin: 0; font-family: var(--font-cute); font-weight: 400; font-size: 26px; }
.section-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.page-title { margin: 20px 0 14px; font-family: var(--font-cute); font-weight: 400; font-size: 28px; }
@media (min-width: 768px) {
  .section { padding-bottom: 56px; }
  .section-title { font-size: 34px; }
  .page-title { margin-top: 32px; font-size: 36px; }
}

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; width: calc(100% + 32px); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--pink-200); background: #FFFFFF; text-decoration: none; font-weight: 500; font-size: 14px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #FFFFFF; font-weight: 700; }
@media (min-width: 768px) { .chips { margin: 0; padding: 0; width: auto; flex-wrap: wrap; overflow: visible; } }

/* ---------- product grid ---------- */
.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1000px) { .products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }
.card { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 12px; border-radius: 20px; background: var(--card); box-shadow: 0 5px 0 var(--pink-100); scroll-margin-top: 16px; }
.card-img { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--pink-100); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
/* Reserved / sold: photo turns grey like "no stock". */
.card.is-out .card-img { background: #ECE8EA; }
.card.is-out .card-img img, .card.is-out .card-img .art { filter: grayscale(1); opacity: 0.55; }
.card.is-out .price { color: var(--muted); }
.tag { position: absolute; left: 8px; top: 8px; padding: 2px 10px; border-radius: 999px; background: #FFFFFF; font-size: 12px; font-weight: 700; color: var(--text); }
.ribbon { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px; text-align: center; background: rgba(75, 38, 55, 0.82); color: #FFFFFF; font-size: 13px; font-weight: 700; }
.card .info { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 0 4px; }
.card h3 { margin: 0; font-size: 14px; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 a { text-decoration: none; }
.card .meta { margin: 0; font-size: 12px; color: var(--muted); }
.card .price { margin: 2px 0 0; font-family: var(--font-round); font-weight: 700; font-size: 19px; color: var(--accent); }
.card form { margin: 0; }
.card .btn { font-size: 14px; padding: 0 10px; }
@media (min-width: 640px) {
  .card { gap: 10px; padding: 12px 12px 16px; border-radius: 28px; box-shadow: 0 6px 0 var(--pink-100); }
  .card-img { border-radius: 20px; }
  .tag { left: 10px; top: 10px; font-size: 13px; }
  .card h3 { font-size: 16px; }
  .card .meta { font-size: 13px; }
  .card .price { font-size: 22px; }
  .card .btn { font-size: 15px; min-height: 46px; }
}

.art { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.art svg { width: 56%; height: auto; }

.empty { padding: 36px 20px; border-radius: 24px; background: var(--card); text-align: center; color: var(--muted); }
.empty .btn { margin-top: 14px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 24px; }
.pager span { color: var(--muted); font-size: 14px; }

/* ---------- delivery ---------- */
.delivery { background: var(--card); border-top: 2px dashed var(--pink-200); border-bottom: 2px dashed var(--pink-200); padding: 28px 0; scroll-margin-top: 0; }
.delivery-grid { display: grid; gap: 12px; }
.delivery-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 20px; background: var(--bg); }
.delivery-card svg { flex: none; }
.delivery-card h3 { margin: 0 0 2px; font-size: 16px; }
.delivery-card p { margin: 0; font-size: 14px; color: var(--muted); }
.fee { display: inline-block; margin-top: 6px; padding: 1px 10px; border-radius: 999px; background: var(--mint); color: var(--mint-ink); font-size: 12px; font-weight: 700; }
@media (min-width: 640px) { .delivery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
  .delivery { padding: 48px 0; }
  .delivery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .delivery-card { flex-direction: column; gap: 8px; padding: 20px; border-radius: 24px; }
}

/* ---------- footer ---------- */
.site-footer { padding: 28px 0 36px; }
.site-footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.site-footer .bye { margin: 0; font-family: var(--font-cute); font-size: 20px; color: var(--accent); }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.social { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; text-decoration: none; font-weight: 700; }
.s-wa { background: var(--mint); color: var(--mint-ink); }
.s-ig { background: var(--pink-100); color: var(--accent-dark); }
.s-xhs { background: var(--butter); color: var(--butter-ink); }

/* ---------- floating cart bar (phones) ---------- */
.cart-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--text); color: #FFFFFF; text-decoration: none; font-weight: 700; box-shadow: 0 10px 24px rgba(75, 38, 55, 0.28); }
.cart-bar[hidden] { display: none; }
.cart-bar .go { display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 999px; background: var(--pink-200); color: var(--accent-dark); }
@media (min-width: 900px) { .cart-bar { left: auto; right: 24px; bottom: 24px; min-width: 320px; } }

.toast { position: fixed; left: 50%; top: 16px; z-index: 40; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: var(--text); color: #FFFFFF; font-weight: 700; font-size: 14px; box-shadow: 0 8px 20px rgba(75, 38, 55, 0.25); }

/* ---------- product page ---------- */
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-top: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.detail { display: grid; gap: 18px; padding: 4px 0 28px; }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 22px; }
.gallery::-webkit-scrollbar { display: none; }
.gallery > * { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; background: var(--pink-100); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.thumbs button { flex: none; width: 56px; height: 70px; padding: 0; border: 3px solid transparent; border-radius: 12px; overflow: hidden; background: var(--pink-100); cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.is-out .gallery > *, .is-out .thumbs button { background: #ECE8EA; }
.is-out .gallery img, .is-out .gallery .art, .is-out .thumbs img { filter: grayscale(1); opacity: 0.55; }
.photo-count { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.detail h1 { margin: 8px 0 0; font-family: var(--font-cute); font-weight: 400; font-size: 28px; }
.price-lg { margin: 6px 0 14px; font-family: var(--font-round); font-weight: 700; font-size: 30px; color: var(--accent); }
.spec { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 14px; padding: 16px; border-radius: 20px; background: var(--card); }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-weight: 500; }
.desc { margin: 0 0 16px; white-space: pre-line; }
.tip { margin: 12px 0 0; padding: 12px 14px; border-radius: 16px; background: var(--butter); color: var(--butter-ink); font-size: 13px; }
@media (min-width: 860px) {
  .detail { grid-template-columns: 1.1fr 1fr; gap: 44px; align-items: start; padding: 8px 0 48px; }
  .detail h1 { font-size: 36px; }
  .thumbs button { width: 72px; height: 90px; }
}

/* ---------- panels, forms ---------- */
.panel { margin-bottom: 14px; padding: 18px 16px; border-radius: 24px; background: var(--card); }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
@media (min-width: 768px) { .panel { padding: 24px 28px; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .field > .label { font-weight: 700; font-size: 14px; }
.field .opt { font-weight: 400; color: var(--muted); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.input, .textarea, .select { width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid var(--pink-200); border-radius: 16px; background: #FFFFFF; color: var(--text); font: inherit; font-size: 16px; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200, 51, 111, 0.15); }
.textarea { min-height: 96px; resize: vertical; }
.error { margin: 0; color: var(--danger); font-size: 13px; font-weight: 500; }
.radio-cards { display: grid; gap: 10px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 2px solid var(--pink-200); border-radius: 18px; background: #FFFFFF; cursor: pointer; }
.radio-card input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--pink-50); }
.radio-card b { display: block; }
.radio-card small { display: block; color: var(--muted); font-size: 13px; }
.form-note { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- cart & order lines ---------- */
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 18px; background: var(--card); }
.line .thumb { flex: none; width: 68px; height: 84px; border-radius: 12px; overflow: hidden; background: var(--pink-100); }
.line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.line .body { flex: 1; min-width: 0; }
.line .name { margin: 0; font-weight: 700; font-size: 15px; }
.line .name a { text-decoration: none; }
.line .sub { margin: 0; font-size: 13px; color: var(--muted); }
.line .amt { margin: 2px 0 0; font-family: var(--font-round); font-weight: 700; font-size: 17px; color: var(--accent); }
.line .gone { margin: 2px 0 0; color: var(--danger); font-size: 13px; font-weight: 700; }
.line form { margin: 0; flex: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--pink-50); color: var(--accent-dark); cursor: pointer; }
.icon-btn:hover { background: var(--pink-100); }
.summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 4px 4px; font-weight: 700; font-size: 16px; }
.summary .total { font-family: var(--font-round); font-size: 26px; color: var(--accent); }

/* ---------- order page ---------- */
.order-hero { margin-top: 16px; padding: 22px 18px; border-radius: 28px; background: var(--card); text-align: center; }
.order-hero .yay { margin: 0 0 6px; font-family: var(--font-cute); font-size: 26px; color: var(--accent); }
.order-hero .label { margin: 0; color: var(--muted); font-size: 14px; }
.order-no { margin: 2px 0 10px; font-family: var(--font-round); font-weight: 700; font-size: 34px; letter-spacing: 0.04em; color: var(--accent); word-break: break-all; }
.badge { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.b-pending { background: var(--butter); color: var(--butter-ink); }
.b-confirmed { background: var(--lilac); color: var(--lilac-ink); }
.b-paid { background: var(--mint); color: var(--mint-ink); }
.b-shipped { background: var(--sky); color: var(--sky-ink); }
.b-completed { background: var(--mint); color: var(--mint-ink); }
.b-cancelled { background: #EFE7EA; color: #5E4A53; }
.next-step { margin-top: 14px; padding: 18px 16px; border-radius: 24px; background: var(--pink-100); }
.next-step h2 { margin: 0 0 4px; font-size: 18px; color: var(--accent-dark); }
.next-step p { margin: 0 0 12px; font-size: 14px; }
.keep-link { display: flex; gap: 8px; align-items: center; }
.keep-link input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 2px solid var(--pink-200); border-radius: 12px; background: #FFFFFF; color: var(--muted); font: inherit; font-size: 13px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; white-space: pre-line; word-break: break-word; }
details.edit > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 700; cursor: pointer; list-style: none; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit[open] > summary { margin-bottom: 8px; }
.notice { margin-top: 14px; padding: 14px 16px; border-radius: 18px; background: var(--lilac); color: var(--lilac-ink); font-weight: 500; }
.danger-zone { margin: 8px 0 24px; text-align: center; }

.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--card); text-decoration: none; }
.order-row b { font-family: var(--font-round); font-size: 18px; color: var(--accent); }
.order-row small { display: block; color: var(--muted); font-size: 13px; }
