:root {
  --brand-primary: #ffe15a;
  --brand-primary-dark: #433a31;
  --brand-primary-soft: #fff7cb;
  --brand-ink: #463e36;
  --brand-navy: var(--brand-ink);
  --brand-background: #faf6ea;
  --brand-surface: #fffefa;
  --brand-border: #e8ded0;
  --brand-accent-text: #765d0b;
  --brand-warm-white: var(--brand-background);
  --brand-line: var(--brand-border);
  --ink: var(--brand-navy);
  --muted: #776e65;
  --cream: #f4eddf;
  --paper: var(--brand-surface);
  --peach: #c9574f;
  --peach-dark: #ef0025;
  --butter: #f1c84b;
  --gold-text: #b87900;
  --sage: #32685d;
  --line: var(--brand-border);
  --winter-blue: var(--brand-navy);
  --sky-blue: #d7a34e;
  --focus-ring: rgba(255, 225, 90, .42);
  --shadow: 0 8px 24px rgba(67, 58, 49, .08);
}

body[data-storefront-theme="gold"] {
  --brand-primary: #ffe15a;
  --brand-primary-dark: #433a31;
  --brand-primary-soft: #fff7cb;
  --brand-ink: #463e36;
  --brand-background: #faf6ea;
  --brand-surface: #fffefa;
  --brand-border: #e8ded0;
  --brand-accent-text: #765d0b;
}

body[data-storefront-theme="violet"] {
  --brand-primary: #89679f;
  --brand-primary-dark: #765889;
  --brand-primary-soft: #f3eff6;
  --brand-ink: #302c35;
  --brand-background: #f7f6f8;
  --brand-surface: #ffffff;
  --brand-border: #e6e2e9;
  --brand-accent-text: #89679f;
}

body[data-storefront-theme="pink"] {
  --brand-primary: #d881a3;
  --brand-primary-dark: #9a4669;
  --brand-primary-soft: #fff0f5;
  --brand-ink: #452f38;
  --brand-background: #fff8fa;
  --brand-surface: #ffffff;
  --brand-border: #efdbe3;
  --brand-accent-text: #a95073;
}

* { box-sizing: border-box; }
html { background: var(--cream); color: var(--ink); font-family: "Noto Sans TC", sans-serif; }
body { display: flex; min-height: 100vh; margin: 0; flex-direction: column; background: var(--brand-background); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.site-header { position: sticky; top: 0; z-index: 20; display: flex; min-height: 58px; align-items: center; justify-content: space-between; padding: 9px max(16px, env(safe-area-inset-left)); background: rgba(255,254,250,.97); border-bottom: 1px solid var(--line); color: var(--ink); backdrop-filter: blur(12px); }
.merchant-brand { display: flex; min-width: 0; min-height: 40px; padding: 4px 8px 4px 0; align-items: center; gap: 9px; border: 0; background: transparent; color: var(--ink); font-size: .78rem; font-weight: 700; cursor: pointer; }
.merchant-brand img { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--brand-primary-soft); object-fit: cover; }
.merchant-brand span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.merchant-brand:focus-visible { border-radius: 7px; outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.eyebrow { margin: 0 0 3px; color: var(--brand-accent-text); font-size: .68rem; font-weight: 700; letter-spacing: .15em; }
.header-link { min-height: 40px; padding: 8px 4px 8px 12px; border: 0; background: transparent; color: var(--brand-primary-dark); font-size: .82rem; font-weight: 700; cursor: pointer; }
.header-link:focus-visible { border-radius: 6px; outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.header-link.current-page { color: var(--ink); cursor: default; opacity: 1; }
.text-button { border: 0; background: transparent; color: var(--brand-accent-text); font-weight: 700; cursor: pointer; }

main { width: min(100%, 760px); margin: 0 auto; padding: 0 16px 110px; flex: 1; }
.storefront-hero { position: relative; overflow: hidden; margin: 0 -16px; aspect-ratio: 16/7; background: var(--brand-primary-soft); }
.storefront-hero img { display: block; width: 100%; height: 100%; opacity: 1; object-fit: cover; object-position: center 58%; transition: opacity .24s ease; }
.storefront-hero.is-loading { background: var(--brand-primary-soft); animation: storefront-image-loading 1.35s ease-in-out infinite alternate; }
.storefront-hero.is-loading img { opacity: 0; }
.store-identity { position: relative; z-index: 2; display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 14px; align-items: center; margin: -25px 0 0; padding: 18px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); }
.store-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-primary-soft); opacity: 1; object-fit: cover; transition: opacity .24s ease; }
.store-mark.is-loading { opacity: .18; animation: storefront-mark-loading 1.35s ease-in-out infinite alternate; }
.store-identity h1 { margin: 0; color: var(--ink); font-size: 1.2rem; line-height: 1.3; letter-spacing: -.02em; }
.store-identity p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.store-identity .brand-contact { color: var(--brand-primary-dark); font-size: .72rem; font-weight: 700; }
@keyframes storefront-image-loading { from { opacity: .72; } to { opacity: 1; } }
@keyframes storefront-mark-loading { from { opacity: .14; } to { opacity: .34; } }
@media (prefers-reduced-motion: reduce) {
  .storefront-hero.is-loading, .store-mark.is-loading { animation: none; }
  .storefront-hero img, .store-mark { transition: none; }
}
.preorder-rules { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; margin: 22px 2px 0; padding: 0 0 20px; border-bottom: 1px solid var(--line); }
.preorder-rules h2 { margin: 0 0 8px; font-size: 1rem; }
.preorder-rules p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: .78rem; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.preorder-rules.expanded p { display: block; overflow: visible; }
.preorder-rules button { min-height: 44px; padding: 6px 0 6px 8px; border: 0; background: transparent; color: var(--brand-primary-dark); font-size: .75rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.preorder-rules button span { margin-left: 3px; font-size: 1.15em; }
.catalog-search { position: relative; display: block; margin: 20px 0 10px; }
.catalog-search > img { position: absolute; z-index: 1; top: 50%; left: 14px; width: 22px; height: 22px; transform: translateY(-50%); object-fit: contain; pointer-events: none; }
.catalog-search input { width: 100%; min-height: 48px; padding: 12px 15px 12px 43px; border: 1px solid var(--brand-line); border-radius: 10px; background: var(--paper); color: var(--ink); outline: none; }
.catalog-search input::placeholder { color: #aaa5ae; }
.catalog-search input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--focus-ring); }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 24px 2px 13px; }
.section-heading h2 { margin: 0; font-size: 1.18rem; }
.section-heading > span { color: var(--muted); font-size: .8rem; }
.catalog-heading { align-items: center; gap: 14px; }
.catalog-heading > div:first-child { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.catalog-heading #productCount { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.catalog-display-controls { display: grid; flex: none; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.catalog-display-controls button { display: grid; width: 44px; min-width: 44px; min-height: 44px; padding: 6px; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.catalog-display-controls .material-symbols-rounded { font-size: 22px; line-height: 1; }
.catalog-display-controls button.active { background: var(--brand-primary); color: var(--brand-primary-dark); }
.catalog-display-controls button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.category-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.category-chips button { flex: none; min-height: 40px; padding: 8px 17px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-size: .76rem; font-weight: 600; cursor: pointer; }
.category-chips button.active { border-color: var(--brand-primary); background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.category-chips button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.status-panel { padding: 26px 14px; color: var(--muted); text-align: center; }

.product-grid { display: grid; }
.product-grid[data-display-mode="list"] { gap: 0; border-top: 1px solid var(--line); }
.product-grid[data-display-mode="list"] .product-card { display: grid; grid-template-columns: 116px minmax(0,1fr); gap: 15px; min-height: 142px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.product-card { cursor: pointer; transition: background .16s ease, transform .16s ease; }
.product-card:active { background: var(--brand-primary-soft); }
.product-grid[data-display-mode="list"] .product-card > img { display: block; width: 116px; height: 116px; align-self: center; border-radius: 8px; object-fit: cover; background: var(--brand-primary-soft); }
.product-card-body { display: flex; min-width: 0; flex-direction: column; padding: 2px 0; }
.category-label { display: inline-block; color: var(--brand-accent-text); font-size: .68rem; font-weight: 700; }
.product-card h3 { display: -webkit-box; margin: 5px 0 9px; overflow: hidden; color: var(--ink); font-size: .9rem; line-height: 1.38; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-card-footer { display: flex; gap: 10px; align-items: end; justify-content: space-between; margin-top: auto; }
.product-card .price { margin: 0; color: var(--brand-accent-text); font-size: 1rem; font-weight: 700; letter-spacing: -.02em; }
.card-add-button { flex: none; min-height: 40px; padding: 8px 0 6px 8px; border: 0; background: transparent; color: var(--brand-primary-dark); font-size: .72rem; font-weight: 700; cursor: pointer; }
.card-add-button:focus-visible { border-radius: 6px; outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.product-card small { display: block; margin-top: 4px; color: var(--muted); font-size: .67rem; }

/* Card view follows the supplied shop-card hierarchy while keeping Golden Crane colors. */
.product-grid[data-display-mode="card"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border: 0; }
.product-grid[data-display-mode="card"] .product-card { display: flex; min-width: 0; overflow: hidden; flex-direction: column; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: 0 7px 18px rgba(67,58,49,.06); }
.product-grid[data-display-mode="card"] .product-card:active { transform: translateY(1px); }
.product-grid[data-display-mode="card"] .product-card > img { display: block; width: 100%; aspect-ratio: 1/1; border-radius: 0; background: var(--brand-primary-soft); object-fit: cover; }
.product-grid[data-display-mode="card"] .product-card-body { flex: 1; padding: 11px; }
.product-grid[data-display-mode="card"] .category-label { font-size: .64rem; }
.product-grid[data-display-mode="card"] .product-card h3 { margin: 5px 0 12px; font-size: .82rem; line-height: 1.4; }
.product-grid[data-display-mode="card"] .product-card-footer { display: grid; grid-template-columns: 1fr; gap: 9px; align-items: stretch; }
.product-grid[data-display-mode="card"] .card-add-button { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--brand-primary); border-radius: 9px; background: var(--brand-primary); color: var(--brand-primary-dark); }

.cart-dock { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(250,246,234,.95); border-top: 1px solid var(--brand-line); backdrop-filter: blur(12px); }
.cart-dock button { display: flex; width: min(100%, 732px); margin: auto; padding: 14px 17px; align-items: center; justify-content: space-between; border: 1px solid var(--brand-primary); border-radius: 8px; background: var(--brand-primary); color: var(--brand-primary-dark); cursor: pointer; }
.cart-dock button span:last-child { color: var(--brand-primary-dark); }
.cart-dock button span:last-child { font-size: .82rem; }

dialog { width: min(calc(100% - 24px), 560px); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 24px 60px rgba(40,30,25,.24); }
dialog::backdrop { background: rgba(55,43,36,.52); backdrop-filter: blur(3px); }
.dialog-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.product-dialog > form { position: absolute; z-index: 1; top: 12px; right: 12px; }
.product-dialog-gallery { background: white; }
.product-dialog-gallery > img { display: block; width: 100%; height: auto; max-height: min(52vh, 480px); aspect-ratio: 1/1; object-fit: contain; object-position: center; background: white; }
.product-dialog-thumbnails { display: flex; gap: 7px; overflow-x: auto; padding: 8px 10px 1px; scrollbar-width: thin; }
.product-dialog-thumbnails:empty { display: none; }
.product-dialog-thumbnails button { flex: none; width: 56px; height: 56px; padding: 2px; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: white; }
.product-dialog-thumbnails button.active { border-color: var(--brand-primary); }
.product-dialog-thumbnails img { width: 100%; height: 100%; border-radius: 6px; object-fit: contain; background: white; }
.dialog-body { padding: 20px; }
.dialog-body h2 { margin: 5px 0; }
.twd-price { margin: 8px 0 12px; color: var(--brand-accent-text); font-size: 1.35rem; font-weight: 700; }
.product-description-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.product-description-section h3 { margin: 0 0 8px; font-size: .88rem; }
.product-description { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.65; white-space: pre-wrap; }
.product-description.is-collapsed { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.description-toggle { min-height: 40px; margin: 5px 0 -7px; padding: 7px 0; border: 0; background: transparent; color: var(--brand-accent-text); font-weight: 700; cursor: pointer; }
.description-toggle:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.dialog-quantity-field { display: grid; gap: 9px; margin: 14px 0; }
.quantity-field-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; font-size: .82rem; font-weight: 700; }
.quantity-field-heading strong { color: var(--brand-accent-text); }
.quantity-stepper { display: grid; grid-template-columns: 46px minmax(58px, 1fr) 46px; width: min(100%, 220px); overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.quantity-stepper button { min-height: 44px; border: 0; background: transparent; color: var(--ink); font-size: 1.25rem; font-weight: 700; cursor: pointer; }
.quantity-stepper button:disabled { color: var(--line); cursor: not-allowed; }
.quantity-stepper input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font-weight: 700; text-align: center; outline: none; appearance: textfield; }
.quantity-stepper input::-webkit-inner-spin-button, .quantity-stepper input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.quantity-stepper input:focus { box-shadow: inset 0 0 0 2px var(--focus-ring); }
.field { display: grid; gap: 7px; margin: 14px 0; }
.field > span { font-size: .82rem; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.primary-button { width: 100%; padding: 14px 17px; border: 0; border-radius: 8px; background: var(--brand-primary); color: var(--brand-primary-dark); font-weight: 700; cursor: pointer; }
.primary-button:disabled { opacity: .5; cursor: wait; }

.checkout-dialog { padding: 20px; }
.checkout-header { display: flex; align-items: start; justify-content: space-between; }
.checkout-header h2 { margin: 0; }
.checkout-header .dialog-close { background: var(--cream); }
.checkout-items { margin: 18px 0; border-top: 1px solid var(--line); }
.checkout-item { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.checkout-item img { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--brand-primary-soft); }
.checkout-item strong, .checkout-item small { display: block; }
.checkout-item small { margin-top: 3px; color: var(--muted); }
.checkout-item-content { min-width: 0; }
.checkout-item-quantity { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: center; justify-content: space-between; margin-top: 9px; }
.checkout-item-quantity > span { color: var(--brand-accent-text); font-size: .75rem; font-weight: 700; }
.quantity-stepper-compact { grid-template-columns: 34px 38px 34px; width: auto; }
.quantity-stepper-compact button { min-height: 34px; font-size: 1rem; }
.quantity-stepper-compact strong { display: grid; place-items: center; margin: 0; font-size: .88rem; }
.remove-item { border: 0; background: transparent; color: var(--peach-dark); cursor: pointer; }
.money-card { padding: 15px; border-radius: 8px; background: var(--brand-primary-soft); }
.money-card > div { display: flex; justify-content: space-between; padding: 5px 0; font-size: .88rem; }
.money-card .deposit-row { margin: 5px -7px; padding: 9px 7px; border-radius: 10px; background: white; color: var(--brand-accent-text); }
.money-card small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.5; }
.form-title { margin: 24px 0 5px; }
.transfer-info { margin: 16px 0 4px; padding: 13px; border: 1px dashed var(--ink); border-radius: 8px; background: var(--paper); }
.transfer-info strong { color: var(--brand-accent-text); font-size: .82rem; }
.transfer-info p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.55; white-space: pre-wrap; }
.order-first-note { margin: 18px 0 4px; padding: 0; border: 0; background: transparent; }
.order-first-note strong { color: var(--winter-blue); font-size: .86rem; }
.order-first-note p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.payment-order-summary { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; margin: 18px 0 10px; padding: 14px; border-radius: 8px; background: var(--cream); }
.payment-order-summary span { color: var(--muted); font-size: .78rem; }
.payment-order-summary strong { text-align: right; }
.later-button { width: 100%; margin-top: 9px; padding: 12px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.agreement { display: flex; gap: 9px; align-items: start; margin: 20px 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.agreement input { flex: none; margin-top: 3px; }
.submit-button { margin-bottom: 0; }
.order-submit-status { position: relative; margin: 10px 0 max(0px, env(safe-area-inset-bottom)); padding: 12px 13px 12px 40px; border: 1px solid #b8d1de; border-radius: 13px; background: #e8f3f7; color: var(--winter-blue); font-size: .8rem; font-weight: 600; line-height: 1.6; }
.order-submit-status::before { position: absolute; top: 14px; left: 14px; width: 15px; height: 15px; border: 2px solid rgba(71,116,142,.25); border-top-color: var(--winter-blue); border-radius: 50%; content: ""; animation: order-submit-spin .8s linear infinite; }
.order-submit-status.is-busy { border-color: #e1c67c; background: #fff8df; color: #765c16; }
.order-submit-status.is-busy::before { border-color: rgba(184,121,0,.22); border-top-color: var(--gold-text); }
@keyframes order-submit-spin { to { transform: rotate(360deg); } }
.checkout-logistics { margin-top: 18px; padding-top: 4px; border: 0; }
#sevenElevenPickupFields, #homeDeliveryFields, #pickupAppointmentFields { display: grid; gap: 10px; margin-top: 10px; padding: 0; border: 0; background: transparent; }
#sevenElevenPickupFields[hidden], #homeDeliveryFields[hidden], #pickupAppointmentFields[hidden] { display: none; }
.delivery-area-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.delivery-area-row .field { min-width: 0; margin-bottom: 0; }
.pickup-location-address { margin: -3px 0 0; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: .74rem; line-height: 1.55; }

.sale-closed-dialog { width: min(calc(100% - 32px), 440px); overflow: hidden; text-align: center; }
.sale-closed-dialog::backdrop { background: rgba(31,43,50,.78); backdrop-filter: blur(8px); }
.sale-closed-content { padding: 34px 26px 38px; background: linear-gradient(160deg, #fffdf7, #e7f1f5); }
.sale-closed-icon { display: grid; width: 62px; height: 62px; margin: 0 auto 17px; place-items: center; border-radius: 50%; background: var(--winter-blue); color: white; font-size: 1.8rem; font-weight: 700; box-shadow: 0 8px 24px rgba(71,116,142,.28); }
.sale-closed-content .eyebrow { color: var(--peach-dark); }
.sale-closed-content h2 { margin: 7px 0 12px; font-size: 1.65rem; }
.sale-closed-content > p:last-child { margin: 0; color: var(--muted); line-height: 1.75; white-space: pre-wrap; }

.orders-back-row { margin: 21px 0 2px; }
.orders-back-button { min-height: 44px; padding: 8px 8px 8px 0; }
.orders-heading { align-items: center; margin-top: 6px; margin-bottom: 4px; }
.order-history-toolbar { display: block; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.order-history-filters { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.order-history-filters button { flex: none; padding: 10px 8px 9px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 700; cursor: pointer; }
.order-history-filters button.active { border-bottom-color: var(--brand-primary); color: var(--ink); }
.order-history-filters span { display: inline-block; min-width: 1.3em; margin-left: 2px; color: inherit; font-size: .68rem; text-align: center; }
.order-history-refresh { flex: none; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: .7rem; font-weight: 700; cursor: pointer; }
.order-history-refresh:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.order-history-meta { margin: 12px 2px; color: var(--muted); font-size: .72rem; }
.order-list { display: grid; gap: 12px; }
.order-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.order-card summary { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 15px; cursor: pointer; list-style-position: inside; }
.order-card[open] summary { border-bottom: 1px solid var(--line); background: var(--brand-primary-soft); }
.order-card-heading { display: grid; gap: 4px; min-width: 0; }
.order-card-heading > strong { overflow: hidden; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.order-card time { color: var(--muted); font-size: .7rem; }
.order-card-total { display: grid; gap: 2px; text-align: right; }
.order-card-total small { color: var(--muted); font-size: .64rem; }
.order-card-total b { color: var(--ink); font-size: .9rem; white-space: nowrap; }
.order-card-body { padding: 15px; }
.order-status { width: max-content; padding: 3px 6px; border-radius: 4px; background: var(--brand-primary-soft); color: var(--ink); font-size: .67rem; font-weight: 700; }
.order-card-completed .order-status { background: #dcece6; color: var(--sage); }
.order-card-cancelled .order-status { background: #ece9e6; color: #6f6863; }
.order-status.overdue { background: #f3e4e1; color: #9a3e36; }
.order-info-list { display: grid; gap: 0; margin: 0 0 14px; }
.order-info-list > div { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.order-info-list dt { color: var(--muted); font-size: .76rem; }
.order-info-list dd { margin: 0; overflow-wrap: anywhere; font-size: .78rem; font-weight: 700; text-align: right; }
.order-items-summary { padding: 12px 0; }
.order-items-summary > span { color: var(--muted); font-size: .7rem; font-weight: 700; }
.order-items-summary pre { margin: 6px 0; color: var(--ink); font: inherit; font-size: .8rem; font-weight: 700; line-height: 1.6; white-space: pre-wrap; }
.order-items-summary small { color: var(--muted); font-size: .68rem; }
.order-shortage-notice { display: grid; gap: 3px; margin: 0 0 12px; padding: 10px 11px; border-radius: 11px; background: #fff3df; color: #795d34; font-size: .72rem; }
.order-shortage-notice strong { color: #b35d35; }
.order-money { display: grid; gap: 7px; padding-top: 12px; border-top: 1px solid var(--line); }
.order-money div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.order-money span { color: var(--muted); font-size: .76rem; }
.order-money strong { font-size: .84rem; }
.order-money div:last-child strong { color: var(--brand-accent-text); font-size: 1rem; }
.payment-action { width: 100%; margin-top: 13px; padding: 11px; border: 1px solid var(--brand-primary); border-radius: 7px; background: var(--brand-primary); color: var(--brand-primary-dark); font-weight: 700; cursor: pointer; }
.payment-action:disabled { cursor: wait; opacity: .65; }
.payment-report-form { display: grid; gap: 9px; margin-top: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); }
.payment-report-form label { display: grid; gap: 7px; color: var(--ink); font-size: .76rem; font-weight: 700; }
.payment-report-form input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; letter-spacing: .12em; }
.payment-report-form input:focus { border-color: var(--brand-primary-dark); outline: 3px solid var(--focus-ring); }
.payment-report-form .payment-action { margin-top: 0; }
.payment-report-form small, .payment-report-status { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.55; }
.payment-report-status { color: var(--winter-blue); font-weight: 700; }
.payment-report-complete { display: grid; gap: 3px; margin-top: 13px; padding: 11px 12px; border: 1px solid var(--sky-blue); border-radius: 12px; background: #edf5f8; color: var(--winter-blue); font-size: .75rem; }
.payment-report-complete span { color: var(--muted); }
.mall-payment { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.mall-payment p { margin: 0 0 9px; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.mall-payment .payment-action { display: block; margin-top: 0; background: var(--brand-primary); color: var(--brand-primary-dark); text-align: center; text-decoration: none; }
.mall-payment-expired { color: #9a3e36 !important; font-weight: 700; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 92px; max-width: calc(100% - 32px); padding: 11px 15px; border-radius: 7px; background: var(--ink); color: var(--paper); font-size: .82rem; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.site-footer { display: grid; gap: 5px; padding: 22px 16px calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); text-align: center; }
.site-footer p { margin: 0; font-size: .78rem; }
.site-footer strong { color: var(--ink); }
.site-footer small { font-size: .66rem; letter-spacing: .03em; }
.cart-dock:not([hidden]) + .site-footer { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

@media (min-width: 650px) {
  main { padding-top: 20px; }
  .storefront-hero { margin: 0; border-radius: 10px; }
  .store-identity { margin-right: 20px; margin-left: 20px; }
  .category-chips { margin-right: 0; margin-left: 0; padding-right: 0; padding-left: 0; }
  .product-grid[data-display-mode="list"] { grid-template-columns: 1fr; }
  .product-grid[data-display-mode="card"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .product-grid[data-display-mode="card"] .product-card-body { padding: 14px; }
  .product-grid[data-display-mode="card"] .product-card h3 { font-size: .94rem; }
  .product-grid[data-display-mode="card"] .product-card-footer { grid-template-columns: minmax(0,1fr) auto; align-items: end; }
  .product-grid[data-display-mode="card"] .card-add-button { width: auto; min-width: 92px; }
  .product-card h3 { font-size: .96rem; }
}

@media (min-width: 760px) {
  .product-dialog[open] { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); width: min(calc(100% - 48px), 960px); overflow: hidden; }
  .product-dialog-gallery { align-self: start; min-width: 0; }
  .product-dialog-gallery > img { height: min(68vh, 620px); max-height: none; aspect-ratio: auto; }
  .product-dialog-thumbnails { padding: 10px 12px 12px; }
  .product-dialog .dialog-body { max-height: calc(100dvh - 48px); overflow-y: auto; }
}

@media (max-width: 420px) {
  .catalog-heading { align-items: flex-start; }
  .catalog-heading > div:first-child { display: grid; gap: 2px; }
}

@media (min-width: 900px) {
  .product-grid[data-display-mode="card"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
