/* =================== MENU PAGE SPECIFIC STYLES =================== */

/* Body override */
.menu-page-body { background: #100000; }

/* ===== MENU PAGE HERO ===== */
.menu-page-hero {
  padding: 7rem 0 3rem;
  background: linear-gradient(180deg, #1a0000 0%, #2e0000 100%);
  border-bottom: 1px solid rgba(212,175,55,0.25);
  text-align: center;
}

.menu-page-hero-content { max-width: 700px; margin: 0 auto; padding: 0 2rem; }
.menu-page-hero-content h1 { font-size: clamp(2rem,5vw,3rem); margin: 0.3rem 0 0.8rem; }
.menu-page-hero-content p { color: rgba(244,224,161,0.7); font-size: 1rem; margin-bottom: 1.8rem; }

/* Search bar */
.menu-search-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(212,175,55,0.4);
  border-radius: 50px;
  padding: 0.6rem 1.5rem;
  max-width: 520px;
  margin: 0 auto;
  transition: border-color 0.3s;
}
.menu-search-wrap:focus-within { border-color: var(--gold); }
.search-icon { font-size: 1rem; margin-right: 0.6rem; color: var(--gold); flex-shrink: 0; }
.menu-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
}
.menu-search-input::placeholder { color: rgba(244,224,161,0.35); }
.search-clear {
  background: none;
  border: none;
  color: rgba(244,224,161,0.5);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  padding: 0 0.3rem;
}

/* ===== MENU LAYOUT ===== */
.menu-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* ===== ENHANCED SIDEBAR ===== */
.menu-sidebar {
  position: sticky;
  top: 80px;
  background: rgba(20,0,0,0.85);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 18px;
  overflow: hidden;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(212,175,55,0.05);
}

.menu-sidebar::-webkit-scrollbar { width: 4px; }
.menu-sidebar::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 2px; }

.sidebar-title {
  padding: 1rem 1.2rem;
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(212,175,55,0.15);
  background: linear-gradient(to right, rgba(212,175,55,0.08), transparent);
}

.sidebar-nav { padding: 0.4rem 0; }

.sidebar-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1.2rem;
  text-decoration: none;
  color: rgba(244,224,161,0.6);
  font-size: 0.85rem;
  font-family: 'Lato', sans-serif;
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
  position: relative;
}
.sidebar-link:hover {
  background: rgba(212,175,55,0.06);
  color: var(--sand);
  border-left-color: rgba(212,175,55,0.3);
  padding-left: 1.4rem;
}
.sidebar-link.active {
  background: rgba(212,175,55,0.1);
  color: var(--gold);
  font-weight: 700;
  border-left-color: var(--gold);
  box-shadow: inset 0 0 20px rgba(212,175,55,0.04);
}
.sidebar-link.active::before {
  content: '▸';
  position: absolute;
  right: 0.8rem;
  color: var(--gold);
  font-size: 0.7rem;
  opacity: 0.6;
}
.sidebar-cat-name { flex: 1; line-height: 1.3; }
.sidebar-count {
  font-size: 0.7rem;
  background: rgba(212,175,55,0.12);
  color: var(--gold);
  padding: 0.12rem 0.4rem;
  border-radius: 50px;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 0.4rem;
  transition: all 0.2s;
}
.sidebar-link.active .sidebar-count {
  background: rgba(212,175,55,0.25);
  box-shadow: 0 0 10px rgba(212,175,55,0.1);
}

/* ===== FILTER BAR ===== */
.menu-filter-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 0.45rem 1.2rem;
  border-radius: 50px;
  border: 1.5px solid rgba(212,175,55,0.25);
  background: rgba(212,175,55,0.05);
  color: rgba(244,224,161,0.65);
  font-family: 'Lato', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}
.filter-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,175,55,0.1);
}
.filter-pill.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--maroon-deep);
  border-color: transparent;
  font-weight: 800;
  box-shadow: 0 3px 14px rgba(212,175,55,0.3);
}

/* ===== CATEGORY SECTION ===== */
.cat-section { margin-bottom: 4rem; scroll-margin-top: 110px; }
.cat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(212,175,55,0.15);
  position: relative;
}
.cat-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(to right, var(--gold), transparent);
  border-radius: 2px;
}
.cat-title {
  font-size: 1.5rem;
  color: var(--gold);
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.cat-count {
  color: rgba(244,224,161,0.35);
  font-size: 0.82rem;
  font-weight: 500;
  margin-left: auto;
}

/* ===== DISH GRID ===== */
.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.3rem;
}

/* ===== PREMIUM DISH CARD ===== */
.dish-card {
  background: rgba(20,0,0,0.7);
  border: 1px solid rgba(212,175,55,0.18);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease, border-color 0.3s ease;
  position: relative;
  will-change: transform;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(212,175,55,0.05);
}
.dish-card:hover {
  border-color: rgba(212,175,55,0.5);
  transform: translateY(-7px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px rgba(212,175,55,0.12), 0 0 0 1px rgba(212,175,55,0.15);
}
.dish-card.unavailable {
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(80%);
}

.dish-img-wrap {
  position: relative;
  width: 100%;
  height: 170px;
  overflow: hidden;
  background: #100000;
}
.dish-img-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(16,0,0,0.6) 0%, transparent 100%);
  z-index: 3;
  pointer-events: none;
}
.dish-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
  will-change: transform;
}
.dish-card:hover .dish-img {
  transform: scale(1.08);
  filter: brightness(1.1) saturate(1.08);
}

.dish-veg-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  z-index: 5;
  transition: transform 0.25s ease;
  letter-spacing: 0.5px;
}
.dish-card:hover .dish-veg-badge {
  transform: scale(1.12);
}
.dish-veg-badge.veg { background: rgba(0,80,0,0.85); color: #69f0ae; text-shadow: 0 0 8px rgba(105,240,174,0.3); }
.dish-veg-badge.nonveg { background: rgba(100,0,0,0.85); color: #ff8a80; text-shadow: 0 0 8px rgba(255,138,128,0.3); }

.unavailable-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sand);
  font-weight: 700;
  font-size: 1.1rem;
  z-index: 5;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.dish-quick-add {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--maroon-deep);
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  transform: scale(0.6) translateY(6px);
  z-index: 6;
}
.dish-card:hover .dish-quick-add { opacity: 1; transform: scale(1) translateY(0); }
.dish-quick-add:hover { transform: scale(1.15) !important; background: var(--gold-light) !important; box-shadow: 0 6px 20px rgba(0,0,0,0.6); }

.dish-info {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.dish-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.02rem;
  color: var(--gold-light);
  line-height: 1.3;
  font-weight: 600;
}
.dish-desc {
  font-size: 0.78rem;
  color: rgba(244,224,161,0.45);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.dish-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.15rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(212,175,55,0.08);
}
.dish-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dish-stars { color: #fbbc05; font-size: 0.75rem; letter-spacing: 1px; }

/* ===== LOADING ===== */
.menu-loading { text-align: center; padding: 4rem; color: var(--sand); }

/* ===== SPINNER ===== */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(212,175,55,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ITEM DETAIL MODAL ===== */
.item-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 3000;
  display: none;
  backdrop-filter: blur(5px);
}
.item-modal-overlay.open { display: block; }

.item-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -55%) scale(0.9);
  z-index: 3100;
  width: min(520px, 94vw);
  background: linear-gradient(160deg, #1c0000 0%, #2a0000 100%);
  border: 1px solid rgba(212,175,55,0.5);
  border-radius: 20px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34,1.4,0.64,1);
  box-shadow: 0 30px 80px rgba(0,0,0,0.9);
}
.item-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.item-modal-close {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(212,175,55,0.3);
  color: var(--gold);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}
.item-modal-close:hover { background: rgba(212,175,55,0.2); }

.item-modal-img-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
}
.item-modal-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.item-modal-img-wrap::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to top, #1c0000, transparent);
}
.item-modal-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
}
.item-modal-badge .dish-veg-badge { position: static; }

.item-modal-body { padding: 1.5rem; }
.item-modal-cat { font-size: 0.75rem; color: var(--gold); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 0.5rem; }
.item-modal-name { font-size: clamp(1.3rem,3vw,1.7rem); color: var(--gold-light); margin-bottom: 0.6rem; }
.item-modal-stars { color: #fbbc05; font-size: 0.9rem; margin-bottom: 0.8rem; }
.modal-rating-text { color: rgba(244,224,161,0.5); font-size: 0.8rem; font-family: 'Lato',sans-serif; }
.item-modal-desc { color: rgba(244,224,161,0.75); font-size: 0.92rem; line-height: 1.7; margin-bottom: 1.5rem; }
.item-modal-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.item-modal-price { font-size: 1.5rem; font-weight: 800; color: var(--gold); flex: 1; }
.item-modal-qty {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 50px;
  padding: 0.3rem 0.8rem;
}
#itemModal .qty-btn { width: 28px; height: 28px; font-size: 1rem; }
#itemModal .qty-num { min-width: 24px; text-align: center; font-weight: 700; color: var(--gold-light); }
#modalAddBtn { padding: 0.7rem 1.5rem; font-size: 0.9rem; white-space: nowrap; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .menu-layout { grid-template-columns: 1fr; }
  .menu-sidebar {
    position: static;
    max-height: none;
    border-radius: 12px;
    margin-bottom: 0;
    overflow: hidden;
  }
  .sidebar-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; padding: 0.5rem; gap: 0.3rem; }
  .sidebar-link {
    flex-direction: column;
    align-items: center;
    text-align: center;
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    min-width: max-content;
  }
  .sidebar-link.active { border-left: none; border-bottom-color: var(--gold); }
  .sidebar-title { display: none; }
}

@media (max-width: 600px) {
  .dish-grid { grid-template-columns: repeat(2, 1fr); }
  .dish-img-wrap { height: 130px; }
  .item-modal-img-wrap { height: 180px; }
  .item-modal-footer { flex-direction: column; align-items: flex-start; }
  #modalAddBtn { width: 100%; text-align: center; }
}

@media (max-width: 380px) {
  /* Fix Mobile Layout for 375px screens */
  .dish-grid { grid-template-columns: 1fr; }
  .dish-img-wrap { height: 180px; }
  .cat-title { font-size: 1.3rem; }
  .filter-pill { padding: 0.35rem 0.9rem; font-size: 0.8rem; }
}

/* ===== POPULAR BADGE ===== */
.popular-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #ff6b35, #ff1744);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  z-index: 5;
  box-shadow: 0 3px 12px rgba(255, 23, 68, 0.5), 0 0 20px rgba(255, 107, 53, 0.25);
  letter-spacing: 0.5px;
  white-space: nowrap;
  animation: popularPop 2.5s ease-in-out infinite;
}
@keyframes popularPop {
  0%, 100% { transform: scale(1); box-shadow: 0 3px 12px rgba(255, 23, 68, 0.5); }
  50% { transform: scale(1.08); box-shadow: 0 4px 18px rgba(255, 23, 68, 0.7), 0 0 25px rgba(255, 107, 53, 0.35); }
}

/* ===== ANIMATIONS & UX (Feature 6) ===== */

/* Cart Icon Bounce */
@keyframes cartBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.3) translateY(-5px); }
  70% { transform: scale(0.9) translateY(2px); }
  100% { transform: scale(1) translateY(0); }
}
.cart-bounce {
  animation: cartBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Floating +1 */
.floating-plus-one {
  position: fixed;
  color: var(--gold);
  font-weight: 800;
  font-size: 1.2rem;
  pointer-events: none;
  z-index: 9999;
  animation: floatUpFade 0.8s forwards;
  text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}
@keyframes floatUpFade {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1.5); }
}

/* ===== VARIANT GROUP CARD ===== */
.variant-card {
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease, border-color 0.3s ease;
}
.variant-card:hover {
  border-color: rgba(212,175,55,0.5);
  transform: translateY(-7px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px rgba(212,175,55,0.12), 0 0 0 1px rgba(212,175,55,0.15);
}

.variant-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--gold-light);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  z-index: 5;
  border: 1px solid rgba(212,175,55,0.3);
  letter-spacing: 0.5px;
}

.variant-expand-hint {
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 600;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.variant-card:hover .variant-expand-hint {
  opacity: 1;
}

.variant-options-wrap {
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  padding: 0 1.1rem;
}

.variant-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.4rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.variant-option:hover {
  background: rgba(212,175,55,0.1);
  border-color: rgba(212,175,55,0.4);
  transform: translateX(4px);
}
.variant-option:last-child {
  margin-bottom: 0.7rem;
}

.variant-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.variant-name {
  font-size: 0.85rem;
  color: var(--sand);
  font-weight: 600;
}
.variant-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--gold);
  white-space: nowrap;
}
.variant-add {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.variant-add:hover {
  transform: scale(1.2);
}

.ov-veg { background: #4CAF50; }
.ov-nonveg { background: #ff6b6b; }

/* Veg/Non-veg indicator circles for variant list */
.veg-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Mobile Sticky Cart Bar */
.mobile-sticky-cart {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gold);
  color: var(--maroon-deep);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2000;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.5);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
}
.mobile-sticky-cart.visible {
  transform: translateY(0);
}
.mobile-sticky-cart-left {
  display: flex;
  flex-direction: column;
}
.mobile-sticky-cart-items {
  font-size: 0.8rem;
  opacity: 0.9;
}
.mobile-sticky-cart-total {
  font-size: 1.1rem;
}
.mobile-sticky-cart-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

@media (min-width: 769px) {
  .mobile-sticky-cart { display: none !important; }
}
