/* ==========================================================================
   Product section: sticky category nav, dishes, cart, reviews
   ========================================================================== */

/* ---------- Menu block ---------- */
.menu-area { padding-top: 8px; scroll-margin-top: var(--header-h); }

/* ---------- Sticky category nav ---------- */
.menu-nav-wrap { position: sticky; top: var(--header-h); z-index: 40; background: #fff; border-bottom: 1px solid var(--line); }
.menu-nav { display: flex; align-items: center; gap: 16px; height: 60px; }
.cat-list { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; height: 100%; align-items: stretch; }
.cat-list::-webkit-scrollbar { display: none; }
.cat-list button { position: relative; padding: 0 14px; font-weight: 700; color: var(--muted); white-space: nowrap; transition: color .15s; }
.cat-list button:hover { color: var(--text); }
.cat-list button::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary); opacity: 0; transition: .15s; }
.cat-list button.active { color: var(--primary); }
.cat-list button.active::after { opacity: 1; }

.menu-search { position: relative; flex: 0 0 280px; }
.menu-search input { width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); padding: 0 36px 0 40px; outline: 0; transition: .15s; }
.menu-search input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-100); }
.menu-search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.menu-search .clear { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; background: #8a8a8a; color: #fff; display: none; align-items: center; justify-content: center; }
.menu-search .clear svg { width: 14px; height: 14px; }
.menu-search.has-value .clear { display: flex; }

/* ---------- Layout ---------- */
.menu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; padding-top: 8px; padding-bottom: 40px; }
.menu-section { scroll-margin-top: calc(var(--header-h) + 72px); padding-bottom: 12px; }
.menu-section h2 { font-size: 24px; font-weight: 800; margin: 24px 0 14px; }
.menu-section .sec-desc { color: var(--muted); margin: -8px 0 14px; font-size: 14px; }
.dish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dish {
  display: flex; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  background: #fff; cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; min-height: 130px; text-align: left;
}
.dish:hover { box-shadow: var(--shadow); border-color: #d9d9d9; }
.dish:focus-visible { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.dish-body { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.dish-name { font-size: 16px; font-weight: 800; line-height: 1.3; }
.dish-desc { color: var(--muted); font-size: 13px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish-price { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; flex-wrap: wrap; }
.dish-price s { color: var(--muted); font-weight: 600; font-size: 13px; }
.dish-tag { font-size: 11px; font-weight: 800; color: var(--secondary-dark); background: var(--secondary-100); padding: 2px 8px; border-radius: 999px; }
.dish-media { position: relative; flex: 0 0 102px; width: 102px; height: 102px; border-radius: 12px; overflow: hidden; background: var(--bg-2); }
.dish-media img { width: 100%; height: 100%; object-fit: cover; }
.dish-add {
  position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; border-radius: 50%; background: var(--secondary); color: #fff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, .35); display: grid; place-items: center; font-size: 22px; font-weight: 800; line-height: 1; transition: .15s;
}
.dish:hover .dish-add { background: var(--secondary-dark); transform: scale(1.1); }
.dish:hover { transform: translateY(-2px); }
.dish-qty-badge { position: absolute; left: 6px; top: 6px; background: var(--secondary); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 800; padding: 2px 8px; box-shadow: var(--shadow-s); }
.menu-empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.menu-empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 4px; }

/* ---------- Cart panel ---------- */
.cart-col { position: sticky; top: calc(var(--header-h) + 76px); }
.cart-panel { border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-s); display: flex; flex-direction: column; max-height: calc(100vh - var(--header-h) - 100px); overflow-y: auto; overscroll-behavior: contain; }
.cart-panel.pulse { animation: cartPulse .7s ease-out; }
@keyframes cartPulse { 0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .45); } 100% { box-shadow: 0 0 0 14px rgba(37, 99, 235, 0); } }
.cart-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: #fff; border-top-left-radius: inherit; border-top-right-radius: inherit; }
.cart-head-row { display: flex; align-items: center; gap: 10px; }
.cart-clear { margin-left: auto; min-height: 32px; font-size: 13px; font-weight: 700; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.cart-clear:hover { color: #c62828; background: #fdecea; }
.cart-head h2 { font-size: 20px; font-weight: 800; }
.cart-close { display: none; width: 40px; height: 40px; margin-right: -8px; }
.cart-mode { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: 6px; font-weight: 600; }
.cart-mode svg { width: 16px; height: 16px; color: var(--primary); flex: 0 0 auto; }
/* Items never shrink away behind the checkout form: the whole panel scrolls instead */
.cart-body { padding: 6px 20px; flex: 1 0 auto; }
.cart-empty { text-align: center; padding: 26px 10px 30px; }
.cart-empty svg { width: 130px; height: 110px; margin: 0 auto 12px; }
.cart-empty h3 { font-size: 18px; font-weight: 800; }
.cart-empty p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.cart-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.cart-item:last-child { border-bottom: 0; }
.ci-img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: var(--bg-2); }
.ci-body { flex: 1; min-width: 0; }
.ci-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.ci-opts { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ci-price { font-weight: 800; font-size: 14px; margin-top: 4px; }
.cart-item .qty { height: 32px; }
.cart-item .qty button { width: 32px; height: 30px; font-size: 16px; }
.cart-foot { border-top: 1px solid var(--line); padding: 14px 20px 18px; }
.free-delivery { font-size: 13px; margin-bottom: 12px; color: var(--text-2); }
.free-delivery .bar { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.free-delivery .fill { height: 100%; background: var(--secondary); border-radius: 3px; transition: width .3s; }
.voucher { display: flex; gap: 8px; margin-bottom: 12px; }
.voucher input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; outline: 0; text-transform: uppercase; font-weight: 700; letter-spacing: .5px; }
.voucher input::placeholder { text-transform: none; font-weight: 400; letter-spacing: 0; }
.voucher input:focus { border-color: var(--primary); }
.voucher .btn { height: 38px; padding: 0 14px; }
.voucher-applied { display: flex; justify-content: space-between; align-items: center; background: var(--secondary-50); color: var(--secondary-dark); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.voucher-applied button { color: var(--muted); font-weight: 700; }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); padding: 3px 0; }
.sum-row.total { font-weight: 800; font-size: 17px; color: var(--text); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.sum-row.total small { font-weight: 600; color: var(--muted); font-size: 12px; }
.sum-row .disc { color: var(--secondary); font-weight: 700; }
.cart-foot .btn-block { margin-top: 12px; height: 48px; }

/* ---------- Mobile cart bar ---------- */
.mobile-cart-bar { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 45; display: none; }
.mobile-cart-bar .btn { height: 54px; justify-content: space-between; box-shadow: var(--shadow-l); padding: 0 18px; }
.mobile-cart-bar .pill { background: rgba(255, 255, 255, .25); border-radius: 8px; padding: 2px 8px; font-size: 13px; flex: 0 0 auto; }
.mobile-cart-bar .mcb-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: center; }

/* ---------- Reviews ---------- */
.reviews { padding: 32px 0 8px; border-top: 1px solid var(--line); scroll-margin-top: var(--header-h); }
.reviews-grid { display: grid; grid-template-columns: 300px 1fr; gap: 40px; margin-top: 8px; }
.rating-big { display: flex; align-items: center; gap: 14px; }
.rating-big .num { font-size: 56px; font-weight: 900; line-height: 1; letter-spacing: -1px; }
.stars { color: var(--amber); display: inline-flex; gap: 2px; }
.stars svg { width: 16px; height: 16px; }
.stars .off { color: #ddd; }
.rating-big small { display: block; color: var(--muted); margin-top: 4px; }
.rating-bars { margin-top: 18px; display: flex; flex-direction: column; gap: 7px; }
.rb { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.rb .bar { flex: 1; height: 8px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.rb .fill { height: 100%; background: var(--amber); border-radius: 4px; }
.rb .pct { width: 36px; text-align: right; color: var(--muted); font-weight: 600; }
.review-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.review-tags .chip { height: 32px; font-size: 13px; cursor: default; }
.review-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.review { border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.review-head { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-100); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.review-head b { display: block; font-size: 14px; }
.review-head small { color: var(--muted); font-size: 12px; }
.review-head .stars { margin-left: auto; }
.review p { margin-top: 10px; font-size: 14px; color: var(--text-2); }
.review .liked { font-size: 12px; color: var(--muted); margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.review .liked span { background: var(--bg-2); padding: 2px 8px; border-radius: 999px; font-weight: 700; }

/* ---------- Dish modal ---------- */
.dish-dialog { max-width: 540px; }
.dm-img { height: 240px; width: 100%; object-fit: cover; background: var(--bg-2); }
.dm-body { padding: 20px 24px 8px; }
.dm-body h2 { font-size: 22px; font-weight: 800; line-height: 1.25; }
.dm-price { font-weight: 800; font-size: 18px; margin-top: 4px; }
.dm-price s { color: var(--muted); font-weight: 600; font-size: 14px; margin-left: 6px; }
.dm-desc { color: var(--muted); font-size: 14px; margin-top: 8px; }
.opt-group { margin-top: 20px; }
.opt-group h4 { font-size: 15px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.opt-group .req { font-size: 11px; background: var(--bg-2); padding: 2px 8px; border-radius: 999px; color: var(--muted); font-weight: 700; }
.opt-group .req.must { background: var(--primary-100); color: var(--primary); }
.opt { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; }
.opt:last-child { border-bottom: 0; }
.opt input { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }
.opt .op { margin-left: auto; color: var(--muted); font-weight: 700; }
.dm-note { margin-top: 18px; }
.dm-note label { font-weight: 800; font-size: 15px; display: block; margin-bottom: 6px; }
.dm-note textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 72px; resize: vertical; outline: 0; font-size: 14px; }
.dm-note textarea:focus { border-color: var(--primary); }
.dm-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 14px 24px; display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.dm-foot .btn { flex: 1; height: 48px; justify-content: space-between; padding: 0 18px; }
.dm-foot .qty { height: 44px; }
.dm-foot .qty button { width: 42px; height: 42px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .menu-layout { grid-template-columns: 1fr; }
  .cart-col { position: fixed; inset: 0; z-index: 70; display: none; background: rgba(0, 0, 0, .45); padding: 0; }
  .cart-col.open { display: flex; align-items: flex-end; }
  .cart-panel { width: 100%; max-height: 88vh; max-height: 88dvh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: slideUp .25s ease-out; }
  .cart-close { display: inline-flex; }
  .cart-item .qty { height: 36px; }
  .cart-item .qty button { width: 36px; height: 34px; }
  .mobile-cart-bar.visible { display: block; }
  /* room for the floating cart bar, only while it is on screen */
  body.has-cart-bar .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  body.has-cart-bar .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .reviews-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 900px) {
  .menu-search { flex: 0 0 200px; }
  .dish-grid { grid-template-columns: 1fr; }
  .review-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* compact sticky bar: search on top, categories below, ~90px total */
  .menu-nav { height: auto; flex-wrap: wrap; padding-top: 6px; padding-bottom: 0; gap: 4px; }
  .cat-list {
    order: 2; flex: 1 1 100%; height: 42px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .menu-search { order: 1; flex: 1 1 100%; }
  .menu-search input { height: 38px; }
  .menu-section { scroll-margin-top: calc(var(--header-h) + 98px); }
  .dish { min-height: 0; padding: 12px; }
  .dish-media { flex-basis: 88px; width: 88px; height: 88px; }
  .dish-add { width: 36px; height: 36px; }
  /* dish modal becomes a bottom sheet */
  .modal { padding: 0; align-items: flex-end; }
  .dish-dialog { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; max-height: 92dvh; animation: slideUp .25s ease-out; }
  .dm-img { height: 190px; }
  .dm-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .dm-body { padding: 16px 16px 8px; }
}
/* landscape phones: keep the dish photo short so the options stay in view */
@media (max-height: 500px) {
  .dm-img { height: 120px; }
}
/* 16px inputs stop iOS Safari zooming the page on focus */
@media (pointer: coarse) {
  .menu-search input, .voucher input, .dm-note textarea { font-size: 16px; }
}

/* ---------- checkout: mobile, address, payment buttons ---------- */
.checkout-form { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.co-field { display: block; margin-bottom: 10px; }
.co-field span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.co-field input, .co-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: 0; resize: vertical; }
.co-field input:focus, .co-field textarea:focus { border-color: var(--primary); }
.co-field .invalid { border-color: #dc2626; }
.co-error { background: #fef2f2; color: #b91c1c; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; }
.cart-foot .co-pay { margin-top: 10px; }
.cart-foot .co-pay:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-bkash { background: #e2136e; color: #fff; }
.btn-bkash:hover { background: #c40f5f; box-shadow: 0 6px 16px rgba(226, 19, 110, .25); transform: translateY(-1px); }
@media (max-width: 760px) { .co-field input, .co-field textarea { font-size: 16px; } }

/* ---------- order result modal ---------- */
.order-dialog { max-width: 420px; padding: 28px 24px 22px; text-align: center; }
.order-dialog .om-icon { font-size: 44px; line-height: 1; }
.order-dialog h2 { margin-top: 12px; font-size: 22px; }
.order-dialog p { margin: 8px 0 18px; color: var(--text-2); }
