:root {
  --bg: #f6f7f8;
  --card: #ffffff;
  --text: #17191c;
  --muted: #73777f;
  --line: #e9eaec;
  --accent: #17191c;
  --soft: #eef0f2;
  --success: #0b8f4d;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow: 0 12px 32px rgba(20, 24, 31, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.app-shell { max-width: 760px; margin: 0 auto; padding: 18px 16px 32px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px 12px; }
.topbar h1 { margin: 2px 0 0; font-size: 23px; letter-spacing: -0.7px; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--success); }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card); box-shadow: 0 4px 16px rgba(0,0,0,.05); }

.address-card { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: var(--radius-md); padding: 12px 14px; margin: 4px 0 14px; }
.address-line { font-size: 14px; font-weight: 700; margin-top: 2px; }

.hero { border-radius: var(--radius-xl); background: linear-gradient(135deg, #1c1e22, #353942); color: white; padding: 20px; display: flex; min-height: 142px; align-items: center; justify-content: space-between; overflow: hidden; position: relative; }
.hero h2 { font-size: 32px; line-height: 1; margin: 10px 0 8px; letter-spacing: -1.1px; }
.hero p { margin: 0; color: rgba(255,255,255,.78); font-size: 13px; }
.hero-emoji { font-size: 72px; transform: rotate(-8deg); filter: drop-shadow(0 14px 18px rgba(0,0,0,.22)); }
.pill { display: inline-block; border-radius: 999px; padding: 6px 9px; background: rgba(255,255,255,.14); font-size: 11px; font-weight: 800; }

.search-wrap { margin: 14px 0 10px; background: var(--card); border-radius: 16px; min-height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid transparent; }
.search-wrap:focus-within { border-color: #c8cbd0; }
.search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 15px; }

.categories { display: flex; gap: 9px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.categories::-webkit-scrollbar { display:none; }
.category-chip { flex: 0 0 auto; border: 0; background: var(--card); border-radius: 999px; padding: 9px 13px; font-size: 13px; font-weight: 700; color: #383c43; }
.category-chip.active { background: var(--text); color: white; }

.section-head { display: flex; align-items: end; justify-content: space-between; margin: 18px 0 12px; }
.section-head h3 { margin: 2px 0 0; font-size: 21px; letter-spacing: -0.5px; }
.text-btn { border: 0; background: none; color: var(--muted); font-size: 12px; }
.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.product-card { background: var(--card); border-radius: var(--radius-lg); overflow: hidden; padding: 10px; min-height: 250px; display: flex; flex-direction: column; }
.product-image { height: 184px; background: linear-gradient(180deg,#ffffff 0%,#fbfbfc 100%); border-radius: 14px; display: grid; place-items: center; font-size: 58px; position: relative; overflow: hidden; border: 1px solid #eef0f2; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.product-photo { width: 100%; height: 100%; object-fit: contain; display: block; padding: 10px; filter: contrast(1.02) saturate(1.02); }
.product-emoji { font-size: 58px; line-height: 1; }
.badge { position: absolute; left: 8px; top: 8px; background: #17191c; color: white; border-radius: 999px; padding: 5px 7px; font-weight: 800; font-size: 9px; }
.product-name { font-size: 13px; line-height: 1.25; font-weight: 700; margin: 11px 0 4px; min-height: 34px; }
.product-meta { font-size: 11px; color: var(--muted); }
.product-bottom { margin-top: auto; padding-top: 9px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.product-price { font-size: 14px; font-weight: 800; }
.add-btn, .qty-control button { border: 0; background: var(--text); color: white; height: 34px; min-width: 34px; border-radius: 11px; font-weight: 800; }
.qty-control { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; }
.qty-control button { min-width: 30px; height: 30px; }
.empty-state { text-align: center; padding: 42px 12px; }
.empty-icon { font-size: 42px; }
.empty-state h3 { margin-bottom: 4px; }
.empty-state p { color: var(--muted); margin-top: 0; }

.cart-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); width: min(calc(100% - 24px), 736px); border: 0; background: var(--text); color: white; border-radius: 18px; min-height: 58px; padding: 0 16px; display: flex; align-items: center; box-shadow: 0 14px 34px rgba(0,0,0,.22); z-index: 20; }
.cart-count { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.14); font-weight: 800; }
.cart-label { margin-left: 10px; font-weight: 800; }
.cart-bar strong { margin-left: auto; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.38); z-index: 40; backdrop-filter: blur(1px); }
.sheet { position: fixed; left: 50%; transform: translate(-50%, 105%); bottom: 0; width: min(100%, 760px); max-height: 90vh; overflow-y: auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); z-index: 50; transition: transform .24s ease; box-shadow: var(--shadow); }
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle { width: 44px; height: 5px; background: #d7d9dc; border-radius: 99px; margin: 2px auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 6px 0 12px; }
.cart-items { display: grid; gap: 8px; }
.cart-item { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); padding: 8px 0 12px; }
.cart-item-image { width: 54px; height: 54px; background: #fff; border: 1px solid #eef0f2; border-radius: 12px; display: grid; place-items: center; font-size: 27px; overflow: hidden; }
.cart-photo { width: 100%; height: 100%; object-fit: contain; padding: 2px; display: block; }
.cart-item-name { font-weight: 700; font-size: 13px; }
.cart-item-price { font-size: 12px; color: var(--muted); margin-top: 4px; }
.summary { display: grid; gap: 10px; padding: 16px 0; }
.summary > div { display:flex; justify-content:space-between; font-size: 13px; }
.discount-row { color: var(--success); }
.total-row { font-size: 16px !important; border-top: 1px solid var(--line); padding-top: 12px; }
.primary-btn { width: 100%; min-height: 52px; border: 0; border-radius: 16px; background: var(--text); color: white; font-weight: 800; font-size: 15px; }
.checkout-form { display: grid; gap: 12px; }
.checkout-form label > span, .payment-title { display: block; font-size: 12px; font-weight: 700; margin: 0 0 6px 2px; color: #52565e; }
.checkout-form input, .checkout-form textarea { width:100%; border:1px solid var(--line); border-radius: 14px; padding: 13px 14px; outline:none; background:#fbfbfc; }
.checkout-form input:focus, .checkout-form textarea:focus { border-color: #b7bbc1; background:white; }
.radio-card { display:flex; align-items:center; gap:10px; padding: 12px 14px; border:1px solid var(--line); border-radius:14px; }
.radio-card span { margin:0 !important; color:var(--text) !important; font-size:14px !important; }
.success-sheet { text-align:center; padding-top: 34px; }
.success-icon { width:70px; height:70px; border-radius:50%; display:grid; place-items:center; margin:0 auto 16px; background:#e8f7ef; color:var(--success); font-size:34px; font-weight:900; }
.success-sheet p { color:var(--muted); line-height:1.5; }
.order-code { display:inline-block; margin:8px 0 20px; padding:10px 14px; border-radius:12px; background:var(--soft); font-weight:800; }

@media (min-width: 620px) {
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-card { min-height: 265px; }
  .product-image { height: 196px; }
}
.notice {background:#fff0e6;color:#973400;border-radius:12px;padding:12px 14px;margin:12px 0;font-size:14px}
.out-stock {color:#888;font-size:12px;font-weight:600}.qty-control button:disabled {opacity:.35}
