/* =======================================
   Home Kitchen Menu v2 — style.css
   ======================================= */

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

:root {
  --red:        #c0392b;
  --red-hover:  #a93226;
  --red-light:  #fff5f2;
  --red-border: #f5cdc8;
  --green:      #25D366;
  --green-glow: rgba(37,211,102,0.25);
  --amber:      #e67e22;
  --amber-bg:   #fef9f0;
  --amber-border:#f5deb3;
  --surface:    #ffffff;
  --bg:         #faf7f2;
  --border:     #ece8df;
  --border-str: #d5cfc5;
  --text:       #1c1a17;
  --text2:      #56524a;
  --text3:      #9a958c;
  --radius:     10px;
  --shadow:     0 1px 4px rgba(0,0,0,0.07);
  --shadow-lg:  0 8px 28px rgba(0,0,0,0.13);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  background: rgba(255,255,255,0.95);
  border-bottom: 0.5px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.tab-btn {
  flex: 1; padding: 13px 6px 11px;
  background: none; border: none;
  border-bottom: 2.5px solid transparent;
  font-size: 12px; font-weight: 500;
  color: var(--text3); cursor: pointer;
  transition: color .15s, border-color .15s;
  display: flex; align-items: center;
  justify-content: center; gap: 5px;
}
.tab-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.tab-btn.active { color: var(--red); border-bottom-color: var(--red); }

/* ── Screens ── */
.screen { display: none; }
.screen.active { display: block; }

/* ════════════════════════════════
   MENU TAB
════════════════════════════════ */

/* Hero */
.hero { position: relative; height: 240px; overflow: hidden; background: #e8ddd0; }
.hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.04) 0%, rgba(0,0,0,.62) 100%);
}
.hero-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; }
.hero-name { font-size: 21px; font-weight: 600; color: #fff; text-shadow: 0 1px 5px rgba(0,0,0,.3); }
.hero-sub  { font-size: 13px; color: rgba(255,255,255,.82); margin-top: 2px; }
.hero-date {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.16); border: 0.5px solid rgba(255,255,255,.3);
  border-radius: 20px; padding: 4px 12px;
  font-size: 12px; color: #fff; margin-top: 8px;
  backdrop-filter: blur(6px);
}
.hero-date svg { width: 12px; height: 12px; stroke: #fff; fill: none; stroke-width: 2; }

/* Sub notice banner */
.sub-banner {
  display: none; align-items: center; gap: 8px;
  background: #eafaf1; border-bottom: 0.5px solid #a9dfbf;
  padding: 9px 16px; font-size: 13px; color: #1a7a40;
}
.sub-banner svg { width: 15px; height: 15px; stroke: #1a7a40; fill: none; stroke-width: 2.5; flex-shrink: 0; }
.sub-banner.visible { display: flex; }

/* Content */
.content { padding: 14px 14px 32px; max-width: 520px; margin: 0 auto; }
.section-label {
  font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .07em; margin: 16px 0 9px;
}

/* ── Menu item card (customer view) ── */
.menu-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 9px;
  overflow: hidden;
}
.menu-card-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; padding: 13px 14px 10px;
}
.menu-card-name { font-size: 15px; color: var(--text); font-weight: 500; }
.menu-card-unit { font-size: 12px; color: var(--text3); margin-top: 2px; }
.menu-card-price {
  font-size: 14px; font-weight: 600; color: var(--red);
  background: var(--red-light); border-radius: 6px;
  padding: 3px 10px; white-space: nowrap; flex-shrink: 0; margin-left: 10px;
}

/* Quantity row */
.qty-row {
  display: flex; align-items: center; gap: 0;
  border-top: 0.5px solid var(--border);
  padding: 9px 14px;
  background: #fdfcfa;
}
.qty-label { font-size: 12px; color: var(--text3); flex: 1; }
.qty-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 0.5px solid var(--border-str);
  background: var(--surface); color: var(--text);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s, border-color .1s;
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--red-light); border-color: var(--red); color: var(--red); }
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-input {
  width: 44px; text-align: center;
  border: 0.5px solid var(--border-str); border-radius: 7px;
  padding: 5px 4px; font-size: 14px; font-weight: 600;
  background: var(--surface); color: var(--text);
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-input:focus { outline: none; border-color: var(--red); }
.qty-subtotal { font-size: 12px; color: var(--text3); min-width: 48px; text-align: right; }

/* Order summary strip */
.order-summary {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  margin-top: 4px; display: none;
}
.order-summary.visible { display: block; }
.order-summary-title { font-size: 12px; font-weight: 600; color: var(--text3); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.order-line { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; color: var(--text2); }
.order-total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; color: var(--text); border-top: 0.5px solid var(--border); margin-top: 8px; padding-top: 8px; }

/* Info row */
.info-row { display: flex; gap: 8px; margin-top: 10px; }
.info-card {
  flex: 1; background: var(--surface); border-radius: var(--radius);
  padding: 12px 13px; border: 0.5px solid var(--border); box-shadow: var(--shadow);
}
.info-icon { width: 28px; height: 28px; background: var(--red-light); border-radius: 7px; display: flex; align-items: center; justify-content: center; margin-bottom: 7px; }
.info-icon svg { width: 14px; height: 14px; stroke: var(--red); fill: none; stroke-width: 2; }
.info-title { font-size: 11px; color: var(--text3); margin-bottom: 3px; }
.info-val   { font-size: 13px; color: var(--text); line-height: 1.4; }

/* WhatsApp button */
.wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--green); color: #fff; text-decoration: none;
  padding: 15px; border-radius: 12px; margin: 14px 0 7px;
  font-size: 16px; font-weight: 600;
  box-shadow: 0 4px 16px var(--green-glow);
  transition: opacity .15s;
}
.wa-btn svg { width: 22px; height: 22px; fill: #fff; flex-shrink: 0; }
.wa-btn:active { opacity: .9; }
.support-msg { text-align: center; font-size: 13px; color: var(--text3); padding: 4px 0 10px; }


/* ════════════════════════════════
   ADMIN TAB
════════════════════════════════ */
.admin-wrap { padding: 14px 14px 36px; max-width: 520px; margin: 0 auto; }

.admin-notice {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--amber-bg); border: 0.5px solid var(--amber-border);
  border-radius: var(--radius); padding: 11px 13px;
  margin-bottom: 16px; font-size: 13px; color: #7d5a0a;
}
.admin-notice svg { width: 15px; height: 15px; stroke: var(--amber); fill: none; stroke-width: 2; flex-shrink: 0; margin-top: 1px; }

.field-group { margin-bottom: 13px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; display: block; }
.field-hint  { font-size: 11px; color: var(--text3); margin-bottom: 5px; display: block; }
.field-input {
  width: 100%; border: 0.5px solid var(--border-str); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.field-input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(192,57,43,.1); }
textarea.field-input { resize: vertical; min-height: 62px; }

/* ── Photo upload zone ── */
.photo-zone {
  border: 1.5px dashed #f0c5b4;
  border-radius: var(--radius);
  background: #fff9f7;
  overflow: hidden;
  margin-bottom: 10px;
  transition: border-color .15s, background .15s;
}
.photo-zone:hover { border-color: var(--red); background: #fff4f0; }

.photo-zone-inner {
  padding: 22px 16px; text-align: center; cursor: pointer;
}
.photo-upload-icon {
  width: 48px; height: 48px; background: var(--red-light);
  border-radius: 12px; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 10px;
}
.photo-upload-icon svg { width: 22px; height: 22px; stroke: var(--red); fill: none; stroke-width: 1.8; }
.photo-zone-title { font-size: 14px; font-weight: 500; color: var(--red); margin-bottom: 3px; }
.photo-zone-sub   { font-size: 12px; color: var(--text3); }

/* preview strip shown after upload */
.photo-preview-strip {
  display: none;
  align-items: center; gap: 12px;
  padding: 10px 12px;
  border-top: 0.5px solid var(--border);
  background: var(--surface);
}
.photo-preview-strip.visible { display: flex; }
.photo-preview-thumb {
  width: 52px; height: 52px; object-fit: cover;
  border-radius: 8px; border: 0.5px solid var(--border); flex-shrink: 0;
}
.photo-preview-info { flex: 1; min-width: 0; }
.photo-preview-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-preview-size { font-size: 11px; color: var(--text3); margin-top: 2px; }
.photo-remove-btn {
  background: none; border: 0.5px solid var(--border-str);
  border-radius: 6px; padding: 5px 9px; cursor: pointer;
  font-size: 12px; color: var(--text3); flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.photo-remove-btn:hover { border-color: var(--red); color: var(--red); }

/* ── Admin menu rows ── */
.admin-item-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  margin-bottom: 9px; box-shadow: var(--shadow);
}
.admin-item-row1 { display: flex; gap: 7px; margin-bottom: 7px; }
.admin-item-row2 { display: flex; gap: 7px; align-items: center; }
.admin-item-row1 .field-input:first-child { flex: 2; }
.admin-item-row1 .field-input:last-child  { flex: 1; }
.price-input  { flex: 1; }
.unit-input   { flex: 2; }

.del-item-btn {
  flex-shrink: 0; background: none; border: 0.5px solid var(--border);
  border-radius: 7px; width: 34px; height: 34px; cursor: pointer;
  color: var(--text3); display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s;
}
.del-item-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.del-item-btn:hover { border-color: var(--red); color: var(--red); }

.qty-range-row { display: flex; gap: 7px; align-items: center; flex: 1; }
.qty-range-row label { font-size: 11px; color: var(--text3); white-space: nowrap; }
.qty-range-row .field-input { padding: 7px 10px; font-size: 13px; }

.add-item-btn {
  background: none; border: 0.5px dashed var(--red); color: var(--red);
  border-radius: 8px; padding: 9px; font-size: 13px; font-family: inherit;
  cursor: pointer; width: 100%; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background .15s;
}
.add-item-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; }
.add-item-btn:hover { background: var(--red-light); }

.divider { height: 0.5px; background: var(--border); margin: 18px 0; }

.save-btn {
  background: var(--red); color: #fff; border: none;
  border-radius: 12px; padding: 14px; font-size: 15px;
  font-weight: 600; font-family: inherit; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .15s, transform .1s;
}
.save-btn svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 2.5; }
.save-btn:hover  { background: var(--red-hover); }
.save-btn:active { transform: scale(.99); }


/* ════════════════════════════════
   SUBSCRIBE TAB
════════════════════════════════ */
.sub-wrap { padding: 14px 14px 36px; max-width: 520px; margin: 0 auto; }
.sub-hero { text-align: center; padding: 20px 0 16px; }
.sub-hero-icon { font-size: 36px; line-height: 1; }
.sub-hero h2   { font-size: 18px; font-weight: 600; margin: 10px 0 4px; }
.sub-hero p    { font-size: 13px; color: var(--text3); }

/* Auth status block */
.auth-block {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.auth-block-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }

.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px; border-radius: 9px;
  border: 0.5px solid var(--border-str); background: var(--surface);
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer; color: var(--text); margin-bottom: 8px;
  transition: background .15s, box-shadow .15s;
}
.google-btn:hover { background: #f8f6f2; box-shadow: var(--shadow); }
.google-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.or-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text3); margin: 10px 0;
}
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 0.5px; background: var(--border); }

.email-auth-row { display: flex; gap: 7px; }
.email-auth-row .field-input { flex: 1; }
.email-sign-btn {
  flex-shrink: 0; background: var(--text); color: #fff; border: none;
  border-radius: 8px; padding: 9px 14px; font-size: 13px;
  font-weight: 500; font-family: inherit; cursor: pointer;
  white-space: nowrap; transition: background .15s;
}
.email-sign-btn:hover { background: #333; }

/* Signed-in user bar */
.user-bar {
  display: none; align-items: center; gap: 10px; margin-bottom: 14px;
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 11px 13px; box-shadow: var(--shadow);
}
.user-bar.visible { display: flex; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--red-light); border: 0.5px solid var(--red-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--red); flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.user-email { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sign-out-btn {
  background: none; border: 0.5px solid var(--border); border-radius: 6px;
  padding: 5px 10px; font-size: 12px; color: var(--text3); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.sign-out-btn:hover { border-color: var(--red); color: var(--red); }

/* Pending approval notice */
.pending-notice {
  display: none; align-items: flex-start; gap: 9px;
  background: var(--amber-bg); border: 0.5px solid var(--amber-border);
  border-radius: var(--radius); padding: 12px 13px; margin-bottom: 14px;
  font-size: 13px; color: #7d5a0a; line-height: 1.5;
}
.pending-notice svg { width: 16px; height: 16px; stroke: var(--amber); fill: none; stroke-width: 2; flex-shrink: 0; margin-top: 1px; }
.pending-notice.visible { display: flex; }

/* Active subscription card */
.active-sub-card {
  display: none; background: #eafaf1; border: 0.5px solid #a9dfbf;
  border-radius: var(--radius); padding: 13px 14px; margin-bottom: 16px;
}
.active-sub-card.visible { display: block; }
.active-sub-title { font-size: 13px; font-weight: 600; color: #1a7a40; margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.active-sub-title svg { width: 15px; height: 15px; stroke: #1a7a40; fill: none; stroke-width: 2.5; }
.active-sub-detail { font-size: 12px; color: #2e8b57; }

/* Plan cards */
.plan-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 11px; box-shadow: var(--shadow);
}
.plan-card.featured { border: 2px solid var(--red); }
.plan-badge {
  display: inline-block; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 4px; margin-bottom: 9px;
}
.plan-name  { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.plan-name svg { width: 16px; height: 16px; stroke: var(--red); fill: none; stroke-width: 2; }
.plan-price { font-size: 26px; font-weight: 700; color: var(--red); margin: 4px 0 8px; }
.plan-price span { font-size: 13px; font-weight: 400; color: var(--text3); }
.plan-features { list-style: none; margin-bottom: 14px; }
.plan-features li { font-size: 13px; color: var(--text2); padding: 3px 0; display: flex; align-items: center; gap: 7px; }
.plan-features li svg { width: 13px; height: 13px; stroke: var(--green); fill: none; stroke-width: 2.5; flex-shrink: 0; }
.plan-btn {
  width: 100%; padding: 13px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: opacity .15s;
}
.plan-btn:active { opacity: .9; }
.plan-btn.primary   { background: var(--red);  color: #fff; }
.plan-btn.secondary { background: #4a4a4a; color: #fff; }
.plan-btn:disabled  { opacity: .45; cursor: not-allowed; }

.sub-footer { text-align: center; margin-top: 16px; font-size: 12px; color: var(--text3); line-height: 1.9; }
.sub-footer a { color: var(--red); text-decoration: none; }

/* ── OTP / email modal ── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 200;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 16px;
  padding: 24px 20px; width: 100%; max-width: 340px;
  box-shadow: var(--shadow-lg);
}
.modal-title  { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.modal-sub    { font-size: 13px; color: var(--text3); margin-bottom: 18px; line-height: 1.5; }
.modal-input  { width: 100%; border: 0.5px solid var(--border-str); border-radius: 8px; padding: 10px 12px; font-size: 16px; letter-spacing: .15em; text-align: center; font-family: inherit; margin-bottom: 12px; }
.modal-input:focus { outline: none; border-color: var(--red); }
.modal-actions { display: flex; gap: 8px; }
.modal-cancel { flex: 1; background: none; border: 0.5px solid var(--border-str); border-radius: 9px; padding: 11px; font-size: 14px; font-family: inherit; cursor: pointer; color: var(--text2); }
.modal-confirm { flex: 2; background: var(--red); color: #fff; border: none; border-radius: 9px; padding: 11px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; }

/* ════════════════════════════════
   TOAST
════════════════════════════════ */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #1c1a17; color: #fff; padding: 10px 22px;
  border-radius: 24px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; z-index: 9999;
  white-space: nowrap; box-shadow: 0 4px 18px rgba(0,0,0,.2);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 480px) {
  .hero { height: 280px; }
}
