/* ============================================================
   KASHMIRA — MENU PAGE (FoodPanda-style)
   ============================================================ */

/* ---- Sticky Category Bar ---- */
.menu-sticky-bar {
  position: sticky;
  top: 68px;
  z-index: 200;
  background: #fff;
  border-bottom: 1px solid #EBEBEB;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.menu-sticky-inner {
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
  overflow: hidden;
  min-width: 0;
}
.menu-search-wrap {
  flex-shrink: 0;
  padding: 0 16px 0 0;
  border-right: 1px solid #EBEBEB;
  height: 100%;
  display: flex;
  align-items: center;
}
.menu-search-input {
  background: #F5F5F5;
  border: none;
  border-radius: 20px;
  padding: 8px 16px 8px 38px;
  font-size: 0.88rem;
  font-family: var(--font-body);
  width: 190px;
  outline: none;
  transition: var(--transition);
  color: var(--text);
}
.menu-search-input:focus { background: #EAEAEA; width: 220px; }
.menu-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 0.9rem;
  pointer-events: none;
}
.menu-search-box { position: relative; }

/* Wrapper holds left arrow + track + right arrow */
.cat-pills-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

/* Fade-edge overlays */
.cat-pills-wrap::before,
.cat-pills-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 36px;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.2s;
}
.cat-pills-wrap::before {
  left: 44px;
  background: linear-gradient(to right, #fff 0%, transparent 100%);
}
.cat-pills-wrap::after {
  right: 44px;
  background: linear-gradient(to left, #fff 0%, transparent 100%);
}
.cat-pills-wrap.at-start::before { opacity: 0; }
.cat-pills-wrap.at-end::after   { opacity: 0; }

.cat-pills-track {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
  padding: 0 4px;
  height: 100%;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  touch-action: pan-x;
}
.cat-pills-track::-webkit-scrollbar { display: none; }
.cat-pills-track.is-dragging { cursor: grabbing; }

.cat-pill {
  white-space: nowrap;
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 0;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
}
.cat-pill:hover { color: var(--primary); }
.cat-pill.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Arrow buttons — shown on both sides */
.cat-arrow {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #E0E0E0;
  box-shadow: 0 1px 5px rgba(0,0,0,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #555;
  font-size: 0.82rem;
  transition: all 0.2s;
  z-index: 2;
  margin: 0 7px;
  opacity: 1;
}
.cat-arrow:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.cat-arrow.hidden {
  opacity: 0;
  pointer-events: none;
  width: 0;
  margin: 0;
  overflow: hidden;
}

/* ─── Mobile: 2-row sticky bar ─── */
@media (max-width: 767px) {
  .menu-sticky-bar { top: 68px; }

  .menu-sticky-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0;
    overflow: visible;
    align-items: stretch;
  }

  /* Row 1: full-width search */
  .menu-search-wrap {
    flex: 0 0 100%;
    border-right: none;
    border-bottom: 1px solid #EBEBEB;
    padding: 8px 0;
    height: auto;
  }
  .menu-search-box { width: 100%; }
  .menu-search-input { width: 100%; box-sizing: border-box; }
  .menu-search-input:focus { width: 100%; }

  /* Row 2: full-width pills, no arrows, native swipe */
  .cat-pills-wrap {
    flex: 0 0 100%;
    overflow: hidden;
  }
  .cat-pills-wrap::before,
  .cat-pills-wrap::after { display: none; }
  .cat-arrow { display: none !important; }
  .cat-pills-track {
    padding: 0 4px;
    cursor: default;
  }
  .cat-pill {
    padding: 9px 14px;
    font-size: 0.82rem;
  }

  /* Adjust section scroll offset for taller 2-row bar (68px nav + 54px search + 42px pills = ~164px) */
  .cat-section[data-section] { scroll-margin-top: 170px; }

  /* Cards on small phones */
  .fp-grid { gap: 8px; }
  .fp-card { height: 96px; }
  .fp-card-img-wrap { width: 100px; }
  .fp-card-info { padding: 10px 4px 10px 11px; gap: 2px; }
  .fp-card-name { font-size: 0.82rem; }
  .fp-card-desc { display: none; }
  .fp-add-btn { width: 28px; height: 28px; font-size: 1.15rem; bottom: 7px; right: 7px; }
}

/* ---- Category Sections ---- */
.menu-body { padding: 32px 0 80px; background: #F7F7F7; }
.cat-section { margin-bottom: 36px; }
.cat-section[data-section] { scroll-margin-top: 132px; }
.cat-section-title {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid #EBEBEB;
}

/* ---- FoodPanda-style Food Card (3 per row) ---- */
.fp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 991px) { .fp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) { .fp-grid { grid-template-columns: 1fr; } }

.fp-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  height: 120px;
}
.fp-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.11); }
.fp-card:hover .fp-card-img { transform: scale(1.05); }

/* Left: text */
.fp-card-info {
  flex: 1;
  padding: 12px 6px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.fp-card-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: #1a1a1a;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fp-card-desc {
  font-size: 0.72rem;
  color: #9e9e9e;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fp-card-price { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.fp-price-now { font-size: 0.875rem; font-weight: 700; color: var(--primary); }
.fp-price-orig { font-size: 0.74rem; color: #bbb; text-decoration: line-through; }
.fp-card-badges { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 3px; }
.fp-badge { font-size: 0.63rem; font-weight: 600; padding: 2px 7px; border-radius: 8px; }
.fp-badge-chef { background: rgba(27,58,92,0.08); color: var(--secondary); }
.fp-badge-hot  { background: rgba(231,76,60,0.1); color: #C0392B; }
.fp-badge-veg  { background: rgba(46,204,113,0.12); color: #1A8C4E; }

/* Right: image */
.fp-card-img-wrap {
  width: 120px;
  flex-shrink: 0;
  position: relative;
  background: #f5f5f5;
  overflow: hidden;
}
.fp-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

/* + button */
.fp-add-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  z-index: 1;
}
.fp-add-btn:hover { background: var(--primary); color: #fff; }
.fp-add-btn.added { background: var(--primary); color: #fff; }

/* No image fallback */
.fp-card-no-img {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #FFF0E6, #FFE0CC);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

/* Discount tag — top-left of image */
.fp-discount-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.63rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  line-height: 1.2;
  z-index: 2;
  letter-spacing: 0.3px;
}

/* Time-slot chip inside fp-card-info */
.fp-slot-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--secondary);
  background: rgba(27,58,92,0.07);
  border-radius: 20px;
  padding: 2px 8px;
  margin-bottom: 2px;
  width: fit-content;
}

/* ============================================================
   FOOD POPUP MODAL (FoodPanda-style)
   ============================================================ */
.fp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 640px) { .fp-modal-overlay { align-items: center; } }
.fp-modal-overlay.open { opacity: 1; visibility: visible; }

.fp-modal {
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(40px);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
@media (min-width: 640px) { .fp-modal { border-radius: 16px; transform: scale(0.95); } }
.fp-modal-overlay.open .fp-modal { transform: translateY(0); }
@media (min-width: 640px) { .fp-modal-overlay.open .fp-modal { transform: scale(1); } }

.fp-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}
.fp-modal-close:hover { background: rgba(0,0,0,0.7); }

.fp-modal-hero {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  background: #F0F0F0;
}
.fp-modal-hero-placeholder {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #FFF0E6, #FFE4CC);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  flex-shrink: 0;
}

.fp-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
}
.fp-modal-name { font-weight: 800; font-size: 1.2rem; color: var(--secondary); margin-bottom: 4px; font-family: var(--font-head); }
.fp-modal-tagline { font-size: 0.85rem; color: #888; margin-bottom: 10px; }
.fp-modal-price-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.fp-modal-price { font-size: 1.35rem; font-weight: 800; color: #1C1C1E; }
.fp-modal-orig-price { font-size: 0.95rem; color: #BBB; text-decoration: line-through; }
.fp-modal-save { font-size: 0.75rem; font-weight: 700; color: var(--success); background: rgba(46,204,113,0.12); padding: 2px 8px; border-radius: 10px; }
.fp-modal-desc { font-size: 0.88rem; color: #666; line-height: 1.7; margin-bottom: 14px; }
.fp-modal-diet { display: flex; gap: 6px; flex-wrap: wrap; }
.fp-modal-intro { padding: 18px 20px 14px; border-bottom: 8px solid #F5F5F5; }
.fp-modal-diet-tag { font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 10px; background: rgba(46,204,113,0.1); color: #1A8C4E; display: flex; align-items: center; gap: 4px; }

/* ── Variant / Addon groups ── */
.fp-group {
  padding: 18px 20px;
  border-bottom: 8px solid #F5F5F5;
}
.fp-group:last-of-type { border-bottom: none; }

.fp-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}
.fp-group-label { font-size: 1rem; font-weight: 700; color: var(--secondary); }
.fp-group-badges { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

.fp-badge-required  { background: var(--secondary); color: #fff; font-size: 0.62rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.fp-badge-optional  { background: #EEE; color: #777;            font-size: 0.62rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.fp-badge-completed { background: rgba(46,204,113,0.15); color: #1A8C4E; font-size: 0.62rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; display: none; }
.fp-badge-completed.show { display: inline-block; }

.fp-group-sub { font-size: 0.78rem; color: #AAA; margin-bottom: 12px; }

/* Radio variant row */
.fp-variant-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F5F5F5;
  cursor: pointer;
  gap: 12px;
}
.fp-variant-row:last-child { border-bottom: none; padding-bottom: 0; }
.fp-variant-row:hover .fp-opt-name { color: var(--primary); }

.fp-radio-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid #CCC;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.fp-radio-dot.checked { border-color: var(--primary); background: var(--primary); }
.fp-radio-dot.checked::after { content: ''; width: 7px; height: 7px; background: #fff; border-radius: 50%; display: block; }

.fp-opt-name { font-size: 0.9rem; font-weight: 500; color: #1C1C1E; flex: 1; }

.fp-opt-price-col { text-align: right; flex-shrink: 0; min-width: 60px; }
.fp-opt-deal  { font-size: 0.9rem; font-weight: 700; color: #1C1C1E; display: block; }
.fp-opt-orig  { font-size: 0.75rem; color: #BBB; text-decoration: line-through; display: block; margin-top: 1px; }

/* Addon row (qty stepper) */
.fp-addon-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F5F5F5;
  gap: 12px;
}
.fp-addon-row:last-child { border-bottom: none; padding-bottom: 0; }

.fp-addon-info { flex: 1; min-width: 0; }
.fp-addon-name { font-size: 0.88rem; font-weight: 500; color: #1C1C1E; }
.fp-addon-add-price { font-size: 0.8rem; font-weight: 600; color: var(--success); margin-top: 1px; }
.fp-addon-orig-price { font-size: 0.72rem; color: #BBB; text-decoration: line-through; display: inline; margin-left: 4px; }

.fp-addon-qty {
  display: flex;
  align-items: center;
  border: 1.5px solid #DDD;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}
.fp-addon-qty-btn {
  width: 30px; height: 30px;
  border: none;
  background: #F8F8F8;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.fp-addon-qty-btn:hover { background: #EBEBEB; }
.fp-addon-qty-btn:disabled { color: #CCC; cursor: default; }
.fp-addon-qty-num {
  min-width: 26px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1C1C1E;
  user-select: none;
}

/* Frequently Bought Together */
.fp-fbt-section {
  padding: 18px 20px 20px;
  border-bottom: 8px solid #F5F5F5;
}
.fp-fbt-tagline { font-size: 0.75rem; color: #AAA; margin-bottom: 14px; }
.fp-fbt-scroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.fp-fbt-scroll::-webkit-scrollbar { display: none; }
.fp-fbt-card {
  flex-shrink: 0;
  width: 120px;
  background: #fff;
  border: 1.5px solid #EBEBEB;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fp-fbt-card:hover  { border-color: #CCC; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.fp-fbt-card.selected { border-color: var(--primary); }
.fp-fbt-img { width: 100%; height: 80px; object-fit: cover; display: block; }
.fp-fbt-img-ph { width: 100%; height: 80px; background: linear-gradient(135deg,#FFF0E6,#FFE4CC); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.fp-fbt-body { padding: 8px 8px 0; }
.fp-fbt-name { font-size: 0.72rem; font-weight: 600; color: #1C1C1E; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-fbt-deal { font-size: 0.72rem; font-weight: 700; color: var(--success); }
.fp-fbt-orig { font-size: 0.68rem; color: #BBB; text-decoration: line-through; }
.fp-fbt-action {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  gap: 3px;
  transition: color 0.15s;
}
.fp-fbt-card.selected .fp-fbt-action { color: var(--success); }

/* Special instructions */
.fp-special-section { padding: 18px 20px 20px; }
.fp-special-label { font-size: 0.95rem; font-weight: 700; color: var(--secondary); margin-bottom: 4px; }
.fp-special-hint  { font-size: 0.75rem; color: #AAA; margin-bottom: 10px; }
.fp-special-input {
  width: 100%;
  border: 1.5px solid #E8E8E8;
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  resize: none;
  outline: none;
  color: #1C1C1E;
  transition: border-color 0.2s;
  background: #FAFAFA;
}
.fp-special-input:focus { border-color: var(--primary); background: #fff; }
.fp-special-input::placeholder { color: #CCC; }

/* Modal Footer */
.fp-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #F0F0F0;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.fp-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 0;
  background: #F5F5F5;
  border-radius: 24px;
  overflow: hidden;
  flex-shrink: 0;
}
.fp-qty-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.fp-qty-btn:hover { background: #EBEBEB; }
.fp-qty-btn:disabled { color: #CCC; cursor: not-allowed; }
.fp-qty-num { min-width: 28px; text-align: center; font-weight: 700; font-size: 0.95rem; }
.fp-add-cart-btn {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}
.fp-add-cart-btn:hover { background: var(--primary-dark); }
.fp-add-cart-btn:disabled { background: #CCC; cursor: not-allowed; }
.fp-add-cart-btn > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fp-btn-price { font-weight: 800; font-size: 1rem; flex-shrink: 0; }

/* Spice indicator inline */
.fp-spice { display: flex; gap: 3px; align-items: center; }
.fp-spice-dot { width: 10px; height: 10px; border-radius: 50%; background: #DDD; }
.fp-spice-dot.on { background: #E74C3C; }

/* Prep time chip */
.fp-meta-chip { display: inline-flex; align-items: center; gap: 5px; background: #F5F5F5; border-radius: 20px; padding: 4px 10px; font-size: 0.75rem; color: #666; font-weight: 500; }
