:root {
  --bg: #fff9f2;
  --surface: #ffffff;
  --surface-soft: #fff3e4;
  --primary: #e65100;
  --primary-dark: #bf360c;
  --green: #1f4a2c;
  --green-soft: #e8f5e9;
  --danger: #c62828;
  --danger-soft: #ffebee;
  --text: #1f2421;
  --muted: #66706a;
  --border: #ecdccf;
  --shadow: 0 6px 20px rgba(74, 42, 16, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding-bottom: 96px;
}

.app-shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 14px 32px;
}

.store-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.store-logo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.store-meta {
  flex: 1;
  min-width: 0;
}

.store-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.store-title-row h1 {
  font-size: 1.12rem;
  color: var(--green);
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-open {
  background: var(--green-soft);
  color: var(--green);
}

.badge-closed {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-warn {
  background: #fff3cd;
  color: #856404;
}

.store-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  background: #1b8f4c;
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.banner-closed {
  background: var(--danger-soft);
  border: 1px solid #f5c2c7;
  color: var(--danger);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.top-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.search-box {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.chip {
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.chip.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.product-list {
  display: grid;
  gap: 10px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.product-card.sold-out {
  opacity: 0.65;
}

.product-thumb {
  width: 68px;
  height: 68px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-soft);
  cursor: pointer;
}

.product-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.product-info h3 {
  font-size: 0.96rem;
  font-weight: 700;
}

.product-cat {
  font-size: 0.74rem;
  color: var(--muted);
}

.product-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 4px;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--primary-dark);
  border: 1px solid var(--border);
}

.btn-green {
  background: var(--green);
  color: #fff;
}

.btn-gps {
  background: linear-gradient(135deg, #1b8f4c, #1f4a2c);
  color: #fff;
  border: 2px solid #145a32;
  box-shadow: 0 4px 12px rgba(31, 74, 44, 0.25);
  font-size: 0.9rem;
  padding: 12px 14px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 1.05rem;
  font-weight: 800;
  border: 1px solid var(--border);
  cursor: pointer;
}

.cart-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: calc(100% - 28px);
  max-width: 652px;
  background: var(--green);
  color: #fff;
  border-radius: 16px;
  padding: 13px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 50;
}

.hidden {
  display: none !important;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card h2, .card h3 {
  font-size: 1rem;
  color: var(--green);
  margin-bottom: 10px;
}

.field {
  margin-bottom: 10px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.9rem;
  font-family: inherit;
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.radio-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  background: #fff;
}

.radio-card.selected {
  border-color: var(--primary);
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.shipping-box {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.84rem;
  margin-top: 8px;
}

.shipping-ok {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid #b7dfc0;
}

.shipping-err {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f5c2c7;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 5px;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--primary-dark);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 100;
}

.modal-sheet {
  background: var(--bg);
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin: 10px 0;
}

.bank-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
}

.copy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.countdown {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.info-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.product-detail-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: var(--surface-soft);
  display: block;
  margin-bottom: 6px;
}

.product-detail-desc {
  font-size: 0.92rem;
  color: var(--text);
  white-space: pre-line;
  line-height: 1.55;
  margin: 8px 0 14px;
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px;
  z-index: 200;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
}

.lightbox-caption {
  color: #fff;
  font-weight: 700;
  font-size: 0.96rem;
  text-align: center;
}

.lightbox-close {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.option-group {
  margin-bottom: 10px;
}

.option-group-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
}

.option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.item-opt-tag {
  font-size: 0.78rem;
  color: var(--primary-dark);
  font-weight: 600;
}
