/* ============================================================
   A2C New Andra Mess — brand theme (mobile-first)
   Brand colors: green #3d6608, brown #661e08
   ============================================================ */

@font-face {
  font-family: 'ITC Benguiat Pro';
  src: url('../fonts/benguiat-pro-bold.woff2') format('woff2'),
       url('../fonts/benguiat-pro-bold.woff') format('woff');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --brand-brown: #661e08;
  --brand-brown-dark: #4d1606;
  --brand-green: #3d6608;
  --brand-green-dark: #2f5006;
  --brand-cream: #f7f1e8;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--brand-cream);
  -webkit-tap-highlight-color: transparent;
}
main { flex: 1 0 auto; }
a { color: var(--brand-green); }
a:hover { color: var(--brand-green-dark); }
h1, h2, h3, h4, h5, .card-title { color: var(--brand-brown); }

/* ---- Navbar ---- */
.navbar.brand-navbar { background-color: var(--brand-brown) !important; }
.brand-navbar .navbar-brand { display: flex; align-items: center; gap: .5rem; }
.brand-navbar .navbar-brand span {
  font-family: 'ITC Benguiat Pro', 'Playfair Display', Georgia, serif;
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: .4px;
}
.brand-navbar .navbar-logo { height: 42px; width: 42px; border-radius: 50%; object-fit: cover; background: #fff; }

/* ---- Mobile nav: Bootstrap offcanvas bottom sheet ---- */
@media (max-width: 991.98px) {
  .brand-offcanvas.offcanvas-bottom {
    height: auto;
    max-height: 82vh;
    background: linear-gradient(180deg, #7a2a10 0%, var(--brand-brown) 100%);
    color: #fff;
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .brand-offcanvas .offcanvas-header { border-bottom: 1px solid rgba(255,255,255,.12); }
  .brand-offcanvas .offcanvas-title { color: #fff; font-family: 'Playfair Display', Georgia, serif; }
  .brand-offcanvas .navbar-nav { width: 100%; gap: .15rem; }
  .brand-offcanvas .nav-item { width: 100%; }
  .brand-offcanvas .nav-link {
    color: #fff; font-size: 1.12rem; padding: .95rem 1rem;
    border-radius: 14px; text-align: center; transition: background .15s ease;
  }
  .brand-offcanvas .nav-link:hover { background: rgba(255,255,255,.14); color: #fff; }
}

/* ---- Bottom tab bar (mobile) ---- */
.bottom-tabbar { display: none; }
@media (max-width: 991.98px) {
  .bottom-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid #eadfce;
    box-shadow: 0 -3px 12px rgba(0,0,0,.06); z-index: 1035;
  }
  .bottom-tabbar .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 2px; text-decoration: none;
    color: #8a7a6a; font-size: .7rem; position: relative;
  }
  .bottom-tabbar .tab i { font-size: 1.25rem; }
  .bottom-tabbar .tab.active { color: var(--brand-green); }
  .bottom-tabbar .tab-badge {
    position: absolute; top: 2px; right: calc(50% - 22px);
    background: var(--brand-green); color: #fff; font-size: .62rem;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  body:not(.home-bg) { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
}

/* ---- Buttons ---- */
.btn-danger, .btn-brand {
  --bs-btn-bg: var(--brand-green); --bs-btn-border-color: var(--brand-green);
  --bs-btn-hover-bg: var(--brand-green-dark); --bs-btn-hover-border-color: var(--brand-green-dark);
  --bs-btn-active-bg: var(--brand-green-dark); color: #fff;
}
.btn-brand-brown {
  --bs-btn-bg: var(--brand-brown); --bs-btn-border-color: var(--brand-brown);
  --bs-btn-hover-bg: var(--brand-brown-dark); color: #fff;
}
.btn-outline-danger {
  --bs-btn-color: var(--brand-green); --bs-btn-border-color: var(--brand-green);
  --bs-btn-hover-bg: var(--brand-green); --bs-btn-hover-border-color: var(--brand-green);
}

/* ---- Badges ---- */
.bg-success, .badge-veg { background-color: var(--brand-green) !important; }
.bg-danger, .badge-nonveg { background-color: var(--brand-brown) !important; }

/* ---- Menu search bar ---- */
.menu-search {
  position: sticky; top: 62px; z-index: 1021;
  background: var(--brand-cream); padding: .5rem 0;
}
.menu-search input {
  border-radius: 999px; padding-left: 2.5rem; border: 1px solid #ddd;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 10-1.397 1.398h-.001l3.85 3.85a1 1 0 001.415-1.414l-3.85-3.85zm-5.242.156a5 5 0 110-10 5 5 0 010 10z'/%3E%3C/svg%3E") .75rem center no-repeat;
}

/* ---- Menu filter bar (Zomato-style: Filters | Veg | Non-veg) ---- */
.menu-filterbar {
  position: sticky; top: 108px; z-index: 1020;
  background: var(--brand-cream);
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem 0; border-bottom: 1px solid #eadfce;
}
.filter-btn {
  border: 1px solid #ddd; background: #fff; border-radius: 999px;
  padding: .35rem .85rem; font-size: .85rem; font-weight: 600;
  color: #333; cursor: pointer;
}
.filter-btn i { margin-right: .3rem; }
.filter-chip {
  border: 1px solid #ddd; background: #fff; border-radius: 999px;
  padding: .35rem .8rem; font-size: .85rem; font-weight: 600;
  color: #333; cursor: pointer; display: flex; align-items: center; gap: .35rem;
}
.filter-chip.active { border-color: var(--brand-green); background: #e8f5e0; color: var(--brand-green); }
.dot-veg { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-green); display: inline-block; }
.dot-nonveg { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-brown); display: inline-block; }

/* ---- Floating Menu button (bottom-right, Zomato style) ---- */
.floating-menu-btn {
  position: fixed;
  right: 1rem;
  bottom: calc(134px + env(safe-area-inset-bottom)); /* above cart bar + tab bar */
  z-index: 1041;
  background: var(--brand-brown);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: .55rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  cursor: pointer;
}
.floating-menu-btn i { margin-right: .3rem; }
@media (min-width: 992px) {
  .floating-menu-btn { bottom: 80px; }
}

/* ---- Filter/Menu sheets ---- */
.filter-sheet { border-radius: 18px 18px 0 0; height: auto; min-height: 50vh; }
.filter-option-chip {
  border: 1px solid #ddd; background: #fff; border-radius: 999px;
  padding: .4rem .9rem; font-size: .85rem; color: #333; cursor: pointer;
  display: inline-flex; align-items: center; gap: .35rem;
}
.filter-option-chip.active { border-color: var(--brand-green); background: #e8f5e0; color: var(--brand-green); font-weight: 600; }

/* Menu index: centered floating card (not bottom sheet) */
.menu-index-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1060;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  width: 300px;
  max-width: 90vw;
  max-height: 70vh;
  overflow-y: auto;
  padding: 1rem;
  display: none;
}
.menu-index-popup.show { display: block; }
.menu-index-popup .mip-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .75rem;
}
.menu-index-popup .mip-header h5 { margin: 0; color: var(--brand-brown); font-weight: 700; }
.menu-index-popup .mip-close {
  background: var(--brand-brown); color: #fff; border: none;
  border-radius: 999px; padding: .3rem .7rem; font-size: .8rem; cursor: pointer;
}
.menu-index-popup .mip-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: .6rem .5rem; border-bottom: 1px solid #f0ebe4; cursor: pointer;
  color: #333; font-size: .95rem;
}
.menu-index-popup .mip-item:last-child { border-bottom: none; }
.menu-index-popup .mip-item:hover { background: #f7f1e8; }
.menu-index-popup .mip-item .mip-count { color: var(--brand-green); font-weight: 600; }
.menu-index-backdrop {
  position: fixed; inset: 0; z-index: 1059;
  background: rgba(0,0,0,.4); display: none;
}
.menu-index-backdrop.show { display: block; }

.menu-section { scroll-margin-top: 170px; }
.menu-section-title { display: flex; align-items: center; gap: .5rem; margin: 1rem 0 .6rem; }

/* ---- Offers strip ---- */
.offers-strip {
  display: flex; gap: .5rem; overflow-x: auto; padding: .5rem 0; scrollbar-width: none;
}
.offers-strip::-webkit-scrollbar { display: none; }
.offer-chip {
  flex: 0 0 auto; background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border: 1px solid #f0d98e; color: #5a3e06; border-radius: 12px;
  padding: .4rem .8rem; font-size: .82rem; white-space: nowrap;
}

/* ---- Menu cards: Zomato-style horizontal (image right, text left) ---- */
.menu-item-card {
  display: flex; background: #fff; border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06); overflow: hidden;
  margin-bottom: .75rem; position: relative;
}
.menu-item-card .mic-body {
  flex: 1; padding: .75rem 1rem; display: flex; flex-direction: column; justify-content: center;
}
.menu-item-card .mic-badge-inline { font-size: .7rem; font-weight: 700; display: block; margin-bottom: 2px; }
.menu-item-card .mic-name { font-weight: 700; font-size: 1rem; color: #1a1a1a; margin-bottom: 3px; }
.menu-item-card .mic-desc { font-size: .8rem; color: #555; margin-bottom: .4rem; }
.menu-item-card .mic-price { font-weight: 700; font-size: 1rem; color: #1a1a1a; }
.menu-item-card .mic-img {
  width: 120px; min-height: 100px; flex-shrink: 0;
  background: #f5f0eb; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.menu-item-card .mic-img img { width: 100%; height: 100%; object-fit: cover; }
.menu-item-card .mic-img-placeholder { color: #ccc; font-size: 2rem; }

/* Qty stepper */
.qty-stepper {
  display: inline-flex; align-items: center; border: 2px solid var(--brand-green);
  border-radius: 8px; overflow: hidden; background: #fff;
}
.qty-stepper button {
  width: 32px; height: 32px; border: none; background: transparent;
  color: var(--brand-green); font-size: 1.1rem; font-weight: 700; cursor: pointer;
}
.qty-stepper button:active { background: rgba(61,102,8,.1); }
.qty-stepper .qty-val {
  width: 28px; text-align: center; font-weight: 700; font-size: .9rem;
  color: var(--brand-green); border: none; background: transparent;
}
/* Add button (before first add) */
.btn-add-item {
  border: 2px solid var(--brand-green); background: #fff; color: var(--brand-green);
  font-weight: 700; border-radius: 8px; padding: .3rem 1.2rem; font-size: .9rem;
}
.btn-add-item:hover { background: var(--brand-green); color: #fff; }

/* ---- Sticky bottom cart bar (Zomato "X items added → Continue") ---- */
#cartBar {
  position: fixed; left: 0; right: 0; z-index: 1040;
  background: var(--brand-green); color: #fff;
  box-shadow: 0 -4px 16px rgba(0,0,0,.2);
  transform: translateY(120%); transition: transform .25s ease;
}
#cartBar.show { transform: translateY(0); }
#cartBar .cartbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .75rem 1rem; max-width: 960px; margin: 0 auto;
}
#cartBar .cartbar-info { font-weight: 600; font-size: .95rem; }
#cartBar .cartbar-btn {
  background: #fff; color: var(--brand-green); font-weight: 700;
  border: none; border-radius: 8px; padding: .4rem 1.1rem; font-size: .9rem; text-decoration: none;
}
@media (max-width: 991.98px) {
  #cartBar { bottom: calc(58px + env(safe-area-inset-bottom)); }
}
@media (min-width: 992px) {
  #cartBar { bottom: 0; }
}
body.has-cartbar main { padding-bottom: 70px; }
@media (max-width: 991.98px) {
  body.has-cartbar:not(.home-bg) main { padding-bottom: calc(58px + 70px + env(safe-area-inset-bottom)); }
}

/* ---- Toast ---- */
#toastWrap {
  position: fixed; left: 50%; transform: translateX(-50%);
  z-index: 1060; width: auto; max-width: 92vw;
}
@media (max-width: 991.98px) { #toastWrap { bottom: calc(58px + 70px + env(safe-area-inset-bottom)); } }
@media (min-width: 992px) { #toastWrap { bottom: 90px; } }
.a2c-toast {
  background: var(--brand-brown); color: #fff; padding: .5rem 1rem;
  border-radius: 999px; font-size: .85rem; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease; margin-top: .4rem; text-align: center;
}
.a2c-toast.show { opacity: 1; transform: translateY(0); }

/* Footer */
footer { color: var(--brand-brown); background: #fff; }

/* ---- Home page ---- */
body.home-bg {
  background-image: url("../images/bg2.png");
  background-position: center center; background-size: cover;
  background-repeat: no-repeat; background-attachment: fixed;
  height: 100vh; height: 100dvh; min-height: 100vh; min-height: 100dvh; overflow: hidden;
}
body.home-bg main { background: transparent; padding: 0; display: flex; }
.home-hero { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 1rem 1.25rem; }
.home-hero-inner {
  width: 100%; padding: 2.25rem 1.75rem; max-width: 640px;
  background: rgba(255,255,255,.82); border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
@media (max-width: 768px) {
  body.home-bg { background-image: url("../images/mobilebg.png"); background-attachment: scroll; }
  .home-hero-inner { padding: 1.5rem 1rem; }
}

/* Non-home pages solid */
body:not(.home-bg) { background-color: var(--brand-cream); }

/* Slightly larger tap targets on small screens */
@media (max-width: 576px) {
  .btn { padding: .5rem .9rem; }
  h2 { font-size: 1.4rem; }
  .menu-item-card .mic-img { width: 100px; }
}
