/* ===============================
   SIDEBAR BRAND (ZOMATO STYLE)
================================ */

.sidebar-brand{
  padding:18px 14px 20px;
  margin-bottom:10px;
  border-bottom:1px solid #f0f0f0;
}

.brand-link{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
}

.brand-logo-img{
  width:36px;
  height:36px;
  object-fit:contain;
  border-radius:6px;
}

.brand-logo-fallback{
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
}

.brand-text{
  font-size:18px;
  font-weight:800;
  color:#111;
  letter-spacing:0.2px;
}

/* Dark mode */
body.dark {
  border-color:#1f2937;
}
body.dark .brand-text{
  color:#fff;
}


/* =========================================================
   DESIGN TOKENS
========================================================= */
:root{
  --accent:#ff3b30;
  --bg:#f6f7fb;
  --card:#ffffff;
  --muted:#6b7280;
  --text:#111827;
  --success:#16a34a;
  --border:#e5e7eb;
}


/* =========================================================
   PROFESSIONAL DESKTOP SIDEBAR (ZOMATO-STYLE)
========================================================= */


/* Show sidebar only on desktop */
@media(min-width:768px){
  .sidebar{ display:block; }
}

/* ===============================
   BRAND
================================ */
.sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 14px 18px;
  margin-bottom:16px;
  border-bottom:1px solid #f1f5f9;
}

.brand-logo{
  font-size:26px;
  line-height:1;
}

.brand-text{
  font-size:18px;
  font-weight:800;
  letter-spacing:.3px;
  color:#111827;
}

/* ===============================
   NAV STRUCTURE
================================ */
.sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:22px;
}

.nav-section{
  display:flex;
  flex-direction:column;
}

.nav-section-title{
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#9ca3af;
  margin:0 14px 8px;
}

/* ===============================
   NAV ITEMS
================================ */
.nav-item{
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 14px;
  border-radius:14px;
  font-size:14px;
  font-weight:600;
  color:#1f2937;
  text-decoration:none;
  transition:
    background .15s ease,
    color .15s ease,
    transform .12s ease;
}

.nav-item .icon{
  font-size:18px;
  width:22px;
  text-align:center;
}

.nav-item .label{
  line-height:1;
}

/* Hover */
.nav-item:hover{
  background:#f3f4f6;
}

/* Active */
.nav-item.active{
  background:rgba(255,59,48,0.12);
  color:var(--accent);
}

.nav-item.active .icon{
  transform:scale(1.1);
}

/* ===============================
   MAIN CONTENT ALIGNMENT
================================ */
.main-content{
  padding-bottom:90px; /* mobile bottom bar */
}

/* Desktop spacing */
@media(min-width:768px){
  .main-content{
    padding:28px;
    padding-bottom:28px;
  }
}

/* =========================================================
   BASE
========================================================= */
body{
  background:var(--bg);
  color:var(--text);
  font-family:Inter,Arial,sans-serif;
  margin:0;
}

.page-inner{
  width:100%;
  padding:12px;
  margin:0 auto;
  box-sizing:border-box;
}

/* =========================================================
   HEADER
========================================================= */
.header-top{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  margin-bottom:8px;
}
.header-top h2{
  margin:0 0 4px 0;
}

/* =========================================================
   ADDRESS BAR
========================================================= */
.address-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:13px;
  color:var(--muted);
  margin-bottom:10px;
  gap:8px;
}
.address-text{
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.address-change-btn{
  border:none;
  background:transparent;
  color:var(--accent);
  font-size:12px;
  cursor:pointer;
  font-weight:600;
}

/* =========================================================
   CONTROLS (SEARCH + SELECTS)
========================================================= */
.controls-mobile{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:14px;
}

.search-box{ position:relative; }

.search-input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #e6e6e9;
}

.autocomplete-list{
  position:absolute;
  left:0; right:0;
  top:42px;
  background:#fff;
  border-radius:8px;
  border:1px solid #eee;
  z-index:40;
  max-height:240px;
  overflow:auto;
  display:none;
}
.autocomplete-item{
  padding:8px 10px;
  cursor:pointer;
}
.autocomplete-item:hover{ background:#f6f6f6; }

.select-pill{
  padding:10px 14px;
  border-radius:14px;
  border:1px solid #ddd;
  background:#fff;
  font-weight:600;
  cursor:pointer;
  box-shadow:0 4px 14px rgba(0,0,0,0.04);
  width:100%;
}

/* =========================================================
   CATEGORY TABS
========================================================= */
.category-tabs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:8px 0;
  white-space:nowrap;
  margin-bottom:10px;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
}
.cat{
  scroll-snap-align:start;
  padding:10px 16px;
  border-radius:20px;
  background:#f3f4f6;
  cursor:pointer;
  font-size:13px;
}
.cat.active{
  background:var(--accent);
  color:#fff;
  transform:scale(1.08);
  transition:0.18s;
}

/* Sticky categories */
.category-tabs.sticky{
  position:sticky;
  top:0;
  z-index:50;
  background:var(--bg);
  padding:10px 0;
  box-shadow:0 4px 20px rgba(0,0,0,0.06);
}

/* =========================================================
   MENU LIST
========================================================= */
.menu-item{
  display:flex;
  gap:12px;
  background:var(--card);
  padding:12px;
  border-radius:10px;
  margin-bottom:12px;
  box-shadow:0 4px 14px rgba(2,6,23,0.05);
}

.menu-thumb{
  width:96px;
  height:80px;
  border-radius:8px;
  object-fit:cover;
  background:#e8e8e8;
  flex-shrink:0;
}

.menu-main{
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.menu-title{
  font-weight:800;
  font-size:15px;
  display:flex;
  align-items:center;
  gap:6px;
  margin-bottom:4px;
}

.badge-veg{ width:12px;height:12px;border-radius:50%; }
.badge-veg.veg{ background:var(--success); }
.badge-veg.nonveg{ background:#c21b1b; }

.menu-desc{
  font-size:12px;
  color:#6b7280;
  max-height:32px;
  overflow:hidden;
  text-overflow:ellipsis;
}

.menu-meta{
  margin-top:6px;
  font-weight:700;
  font-size:14px;
}

.tag{
  padding:2px 6px;
  border-radius:8px;
  border:1px solid #eee;
  font-size:11px;
  margin-left:6px;
  color:var(--muted);
}

/* =========================================================
   QUANTITY CONTROLS
========================================================= */
.menu-right{
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  align-items:flex-end;
  gap:6px;
}
.qty-box{
  display:flex;
  align-items:center;
  gap:8px;
}
.qty-btn{
  width:34px;
  height:34px;
  border:none;
  border-radius:8px;
  font-size:18px;
  font-weight:800;
  color:#fff;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.qty-btn.plus{ background:var(--success); }
.qty-btn.minus{ background:var(--accent); }
.qty-value{
  min-width:32px;
  text-align:center;
  font-weight:800;
  font-size:15px;
}

/* =========================================================
   LOADING SKELETON
========================================================= */
.skeleton{
  background:linear-gradient(90deg,#eee 0%,#f5f5f5 50%,#eee 100%);
  background-size:200% 100%;
  animation:shimmer 1.2s infinite;
}
@keyframes shimmer{
  0%{background-position:200% 0;}
  100%{background-position:-200% 0;}
}
.skeleton-card{
  height:90px;
  border-radius:10px;
  margin-bottom:12px;
}

/* =========================================================
   STICKY CART
========================================================= */
.sticky-cart{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:86px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:10px 16px;
  min-width:240px;
  background:var(--accent);
  color:#fff;
  border-radius:999px;
  box-shadow:0 12px 30px rgba(0,0,0,0.28);
  font-weight:700;
  font-size:14px;
  z-index:210;
  cursor:pointer;
}
.sticky-cart:active{
  transform:translateX(-50%) scale(0.97);
}

/* =========================================================
   FLOATING ACTIONS
========================================================= */
.fab-dark{
  position:fixed;
  right:16px;
  bottom:82px;
  width:42px;
  height:42px;
  border-radius:50%;
  border:none;
  background:#ffffff;
  box-shadow:0 8px 26px rgba(15,23,42,0.25);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:220;
  font-size:18px;
}

/* =========================================================
   SHEETS & MODALS
========================================================= */
.sheet-overlay{
  position:fixed;
  inset:0;
  background:rgba(2,6,23,0.45);
  display:none;
  align-items:flex-end;
  justify-content:center;
  z-index:300;
}
.sheet-overlay.active{ display:flex; }

.sheet{
  background:#fff;
  border-radius:16px 16px 0 0;
  padding:12px;
  width:100%;
  max-width:1100px;
  box-shadow:0 -10px 30px rgba(2,6,23,0.2);
  transform:translateY(100%);
  transition:transform .22s ease;
}
.sheet.active{ transform:translateY(0); }

.center-modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.55);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:400;
}
.center-modal-overlay.active{ display:flex; }

.center-modal{
  background:#fff;
  width:95%;
  max-width:560px;
  border-radius:16px;
  padding:16px 18px;
  box-shadow:0 18px 50px rgba(0,0,0,0.35);
}

/* =========================================================
   VARIANT MODAL (CENTERED)
========================================================= */
#variantSheet.sheet-overlay{
  align-items:center;
  justify-content:center;
}
#variantSheet .sheet{
  width:92%;
  max-width:520px;
  max-height:80vh;
  border-radius:16px;
  transform:none;
  display:flex;
  flex-direction:column;
}
#variantSheet .variant-list{
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}

/* =========================================================
   DISH DETAIL MODAL
========================================================= */
#dish_title{ font-size:16px;font-weight:800; }
#dish_desc{ font-size:13px;color:#6b7280;margin-top:6px;line-height:1.5; }
#dish_price{ font-size:18px;font-weight:800; }

#dish_tax{
  margin-top:14px;
  padding:10px 12px;
  background:#f9fafb;
  border-radius:10px;
  font-size:12px;
  color:#374151;
}
#dish_tax div{ margin-bottom:4px; }

.dish-footer{
  margin-top:16px;
  padding-top:12px;
  border-top:1px solid #e5e7eb;
}

/* =========================================================
   DARK MODE
========================================================= */
body.dark{ background:#0b0b0d;color:#fff; }
body.dark .menu-item,
body.dark .sheet,
body.dark .center-modal{ background:#0f1720;color:#e5e7eb; }
body.dark .search-input,
body.dark .input{
  background:#0b1220;
  color:#fff;
  border-color:#1f2937;
}
body.dark .select-pill{
  background:#0b1220;
  color:#fff;
  border-color:#1f2937;
}
body.dark .cat{ background:#111827;color:#fff; }
body.dark .cat.active{ background:#ff6b5f; }
body.dark .sticky-cart{ background:#ff6b30;color:#111; }
body.dark .fab-dark{ background:#1f2937;color:#fbbf24; }
body.dark #dish_tax{ background:#0b1220;color:#e5e7eb; }


/* =========================================================
   ADDRESSES — CLEAN LAYOUT
========================================================= */

.addr-loading,
.addr-empty{
  font-size:13px;
  color:var(--muted);
  padding:12px;
}

/* Address card */
.addr-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  margin-bottom:12px;
}

/* Header */
.addr-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.addr-label{
  font-weight:800;
  font-size:14px;
}

/* Default dot */
.addr-default-dot{
  color:var(--accent);
  font-size:12px;
  margin-left:6px;
}

/* Body */
.addr-body{
  margin-top:6px;
}

.addr-address{
  font-size:13px;
  color:#374151;
}

.addr-landmark{
  margin-top:4px;
  font-size:12px;
  color:#6b7280;
}

/* Actions */
.addr-actions{
  display:flex;
  gap:12px;
  margin-top:10px;
}

.addr-btn{
  background:none;
  border:none;
  font-size:12px;
  font-weight:700;
  color:var(--accent);
  cursor:pointer;
  padding:0;
}

.addr-btn.primary{
  color:var(--accent);
}

.addr-btn.danger{
  color:#dc2626;
}

/* Dark mode */
body.dark .addr-card{
  background:#0f1720;
  border-color:#1f2937;
}
body.dark .addr-address{
  color:#e5e7eb;
}
body.dark .addr-landmark{
  color:#9ca3af;
}

/* =========================================
   ADDRESSES MODAL — CENTERED LAYOUT
   ========================================= */

#addressesModal.sheet-overlay{
  align-items: center;     /* center vertically */
  justify-content: center; /* center horizontally */
}

/* Modal sizing */
#addressesModal .sheet{
  width: 94%;
  max-width: 620px;
  max-height: 80vh;

  border-radius: 16px;     /* full modal */
  transform: none;         /* cancel bottom-sheet animation */

  display: flex;
  flex-direction: column;
}

/* Header stays fixed */
#addressesModal .sheet > div:first-child{
  flex-shrink: 0;
}

/* Address list scrolls internally */
#addresses_container{
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

/* Mobile tightening */
@media(max-width:767px){
  #addressesModal .sheet{
    max-height: 75vh;
  }
}



/* =========================================================
   RESPONSIVE
========================================================= */
@media(max-width:767px){
  #dish_title{ font-size:15px; }
  #dish_price{ font-size:16px; }
  #variantSheet .sheet{ max-height:75vh; }
}

@media(min-width:768px){
  .page-inner{ max-width:1100px; }

  .header-top{
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
  }

  .controls-mobile{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
  }

  .search-box{ grid-column:1 / span 2; }

  .menu-thumb{
    width:110px;
    height:90px;
  }

  .sticky-cart{
    bottom:24px;
  }
}
