/* ==========================================================================
   Nuruddin Chop Ghor — ডিজাইন টোকেন
   কনসেপ্ট: হোস্টেলের চপের দোকানের অর্ডার-টোকেন/রিসিট থিম।
   রং: গাঢ় ইটরঙা মেরুন (ভাজা তেলেভাজার রং) + সরিষা হলুদ + উষ্ণ কাগজের বেইজ।
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tiro+Bangla:ital@0;1&family=Hind+Siliguri:wght@400;500;600;700&display=swap');

:root {
  --paper: #FAF2E2;
  --paper-card: #FFFCF5;
  --ink: #2B1B12;
  --ink-soft: #5C4A3D;
  --maroon: #7A2E27;
  --maroon-dark: #5C2019;
  --mustard: #D9A441;
  --mustard-deep: #B9832B;
  --green: #43664A;
  --green-bg: #E9F1E7;
  --red: #A83B32;
  --red-bg: #F7E7E4;
  --line: #E3D5BC;

  --radius: 4px;
  --shadow: 0 2px 0 rgba(43, 27, 18, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Hind Siliguri', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Tiro Bangla', serif;
  font-weight: 400;
  margin: 0;
  color: var(--maroon-dark);
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

img { max-width: 100%; display: block; }

/* ---------- Layout shell ---------- */

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  position: relative;
  padding-bottom: 32px;
}

.topbar {
  background: var(--maroon);
  color: #FFF6EA;
  padding: 22px 20px 26px;
  position: relative;
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 10px;
  background-image: radial-gradient(circle at 10px 0, transparent 9px, var(--maroon) 10px);
  background-size: 20px 10px;
  background-repeat: repeat-x;
}

.topbar .shop-name {
  font-size: 28px;
  color: #FFF6EA;
  line-height: 1.15;
}

.topbar .shop-tagline {
  font-size: 13.5px;
  color: #E9C79A;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.brand-logo {
  display: block;
  width: 148px;
  height: 148px;
  object-fit: contain;
  margin: 0 auto;
}

.brand-logo-small {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero-video-wrap {
  margin: 0 0 18px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--maroon);
  box-shadow: 0 3px 0 rgba(43,27,18,0.1);
  position: relative;
  background: #000;
}

.hero-video-wrap video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-video-caption {
  position: absolute;
  left: 10px;
  bottom: 8px;
  background: rgba(43,27,18,0.55);
  color: #FFF6EA;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}

.topbar .back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.back-btn {
  background: rgba(255,255,255,0.14);
  border: none;
  color: #FFF6EA;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.step-label {
  font-size: 13px;
  color: #E9C79A;
}

.content {
  padding: 20px;
}

/* ---------- Product list ---------- */

.product-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  align-items: center;
}

.product-thumb {
  width: 72px;
  height: 72px;
  border-radius: 3px;
  object-fit: cover;
  background: var(--line);
  flex-shrink: 0;
}

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

.product-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.product-price {
  color: var(--mustard-deep);
  font-weight: 700;
  font-size: 15px;
  margin-top: 2px;
}

.product-desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

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

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--maroon);
  background: #fff;
  color: var(--maroon);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.qty-btn:active { background: var(--maroon); color: #fff; }

.qty-add {
  border: none;
  background: var(--maroon);
  color: #FFF6EA;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
}

.qty-value {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
}

.empty-note {
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 20px;
  font-size: 14.5px;
}

/* ---------- Cart bar ---------- */

.cart-bar {
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  background: var(--maroon);
  color: #FFF6EA;
  padding: 14px 18px;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  box-shadow: 0 -2px 12px rgba(43,27,18,0.18);
}

.cart-bar .cart-meta { font-size: 13.5px; color: #E9C79A; }
.cart-bar .cart-total { font-size: 18px; font-weight: 700; margin-top: 2px; }

.cart-bar button {
  background: var(--mustard);
  color: var(--maroon-dark);
  border: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14.5px;
}

/* ---------- Forms ---------- */

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input[type="text"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-card);
  font-family: inherit;
  font-size: 15.5px;
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--maroon);
}

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; }

.primary-btn {
  width: 100%;
  background: var(--maroon);
  color: #FFF6EA;
  border: none;
  padding: 15px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  margin-top: 6px;
}

.primary-btn:disabled { opacity: 0.55; }

.secondary-btn {
  width: 100%;
  background: transparent;
  color: var(--maroon);
  border: 1.5px solid var(--maroon);
  padding: 13px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
}

.error-text {
  color: var(--red);
  font-size: 13.5px;
  margin-top: 6px;
}

/* ---------- Order summary / receipt ---------- */

.receipt {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 14.5px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.receipt-row:last-child { border-bottom: none; }

.receipt-row .name { color: var(--ink); }
.receipt-row .qty { color: var(--ink-soft); }
.receipt-row .price { color: var(--ink); font-weight: 600; }

.receipt-total {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 2px solid var(--maroon);
  font-weight: 700;
  font-size: 16.5px;
  color: var(--maroon-dark);
}

/* ---------- Payment options ---------- */

.pay-option {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.pay-option.active {
  border-color: var(--maroon);
  background: #FFF9EF;
}

.pay-option-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}

.pay-option-head input[type="radio"] {
  accent-color: var(--maroon);
  width: 17px; height: 17px;
}

.pay-body { margin-top: 12px; }

.qr-box {
  text-align: center;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.qr-box img { width: 190px; height: 190px; object-fit: contain; margin: 0 auto; }
.qr-box .phone-number {
  margin-top: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--maroon-dark);
  letter-spacing: 0.03em;
}

.upload-box {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
  background: var(--paper-card);
}

.upload-box input { display: none; }
.upload-preview { max-width: 140px; border-radius: 3px; margin: 10px auto 0; }

/* ---------- Success / token screen ---------- */

.token-card {
  background: var(--paper-card);
  border: 2px solid var(--maroon);
  border-radius: 6px;
  padding: 26px 22px;
  text-align: center;
  position: relative;
  margin: 10px 0 24px;
}

.token-card .checkmark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}

.token-card h2 { font-size: 21px; margin-bottom: 6px; }
.token-card .token-sub { color: var(--ink-soft); font-size: 14px; margin-bottom: 16px; }

.token-number {
  font-family: 'Tiro Bangla', serif;
  font-size: 34px;
  color: var(--maroon-dark);
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  padding: 12px 0;
}

.token-number .label { font-size: 12.5px; color: var(--ink-soft); font-family: 'Hind Siliguri', sans-serif; display: block; margin-bottom: 2px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.pending { background: #FCEFD9; color: var(--mustard-deep); }
.badge.confirmed { background: var(--green-bg); color: var(--green); }
.badge.delivered { background: #E4E4E4; color: #555; }
.badge.cancelled { background: var(--red-bg); color: var(--red); }

/* ---------- Admin ---------- */

.admin-shell { max-width: 620px; margin: 0 auto; padding-bottom: 40px; }

.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-login-box {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.pin-input {
  width: 100%;
  text-align: center;
  font-size: 26px;
  letter-spacing: 0.4em;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  margin: 16px 0;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 14px 16px 0;
  overflow-x: auto;
}

.tab-btn {
  border: 1.5px solid var(--line);
  background: var(--paper-card);
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

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

.order-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.order-card .order-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.order-card .order-id { font-weight: 700; color: var(--maroon-dark); font-size: 15px; }
.order-card .order-time { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.order-card .order-line { font-size: 14px; color: var(--ink); margin: 3px 0; }
.order-card .order-line .k { color: var(--ink-soft); }

.order-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.order-actions button {
  flex: 1;
  min-width: 90px;
  border: 1.5px solid var(--line);
  background: #fff;
  padding: 9px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.order-actions button.confirm { border-color: var(--green); color: var(--green); }
.order-actions button.deliver { border-color: var(--maroon); color: var(--maroon); }
.order-actions button.cancel { border-color: var(--red); color: var(--red); }

.admin-section-title {
  padding: 18px 16px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.settings-card {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 16px 16px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.list-row:last-child { border-bottom: none; }

.icon-btn {
  border: none;
  background: none;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
}

.inline-form { display: flex; gap: 8px; margin-top: 10px; }
.inline-form input { flex: 1; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: var(--radius); font-family: inherit; }
.inline-form button { background: var(--maroon); color: #fff; border: none; padding: 0 16px; border-radius: var(--radius); font-weight: 600; }

.loading-note, .toast {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 12px;
}

.toast.error { color: var(--red); }
.toast.success { color: var(--green); }

@media (max-width: 380px) {
  .content { padding: 16px; }
}
