/* css/menu.css */

/* Menu Layout & Navigation */
.menu-main-page {
  padding-bottom: 80px;
  background-color: var(--bg-black);
}

/* Filter controls toolbar */
.menu-filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  background-color: var(--bg-charcoal);
  padding: 15px 25px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-search-wrap {
  flex-grow: 1;
  max-width: 400px;
  position: relative;
}

.menu-diet-filters {
  display: flex;
  gap: 10px;
}

.diet-filter-btn {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1.5px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  transition: all var(--transition-fast);
}

.diet-filter-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
}

.diet-filter-btn.active {
  background-color: var(--primary-yellow);
  color: var(--text-dark);
  border-color: var(--primary-yellow);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.badge-dot.veg { background-color: var(--color-veg); }
.badge-dot.nonveg { background-color: var(--color-nonveg); }
.badge-dot.egg { background-color: var(--color-egg); }

/* Category Scrolling Bar */
.category-nav-scroll {
  overflow-x: auto;
  margin-bottom: 40px;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-card) var(--bg-black);
}

/* Custom scrollbar for horizontal category list */
.category-nav-scroll::-webkit-scrollbar {
  height: 4px;
}

.category-nav-pills {
  display: flex;
  gap: 12px;
  min-width: max-content;
}

.category-pill {
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all var(--transition-fast);
}

.category-pill:hover {
  color: var(--text-white);
  border-color: rgba(255, 208, 0, 0.3);
}

.category-pill.hidden {
  display: none;
}

.category-pill.active {
  background-color: var(--primary-yellow);
  color: var(--text-dark);
  border-color: var(--primary-yellow);
  box-shadow: 0 4px 12px rgba(255, 208, 0, 0.2);
}

/* noscript warning styling */
.noscript-alert {
  background-color: rgba(211, 47, 47, 0.15);
  border: 2px solid var(--accent-red);
  color: var(--text-white);
  padding: 15px 20px;
  border-radius: 4px;
  margin-bottom: 30px;
  font-size: 14px;
}

/* Sections & Grids */
.menu-section {
  display: none;
}

.menu-section.active {
  display: block;
}

.menu-category-title {
  font-family: var(--font-logo);
  font-size: 36px;
  color: var(--primary-yellow);
  text-shadow: 2px 2px 0 #000;
  text-transform: uppercase;
  margin-bottom: 25px;
  letter-spacing: 1px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

/* Menu Item Card */
.menu-card {
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  display: flex;
  overflow: hidden;
  position: relative;
  transition: all var(--transition-normal);
}

.menu-card:hover {
  border-color: rgba(255, 208, 0, 0.15);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.menu-card-img-wrap {
  width: 180px;
  height: 100%;
  min-height: 180px;
  position: relative;
  flex-shrink: 0;
}

.menu-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1f1f1f 0%, #121212 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 208, 0, 0.05);
}

.menu-card-placeholder svg {
  width: 50%;
  height: 50%;
  fill: currentColor;
}

.menu-card-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.menu-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.menu-card-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-white);
  line-height: 1.2;
}

.menu-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.menu-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 15px;
}

.menu-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.menu-card-price {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 900;
  color: var(--primary-yellow);
}

/* Quantity Control Widgets */
.quantity-control {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-black);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.qty-btn {
  background: transparent;
  border: none;
  color: var(--text-white);
  width: 32px;
  height: 32px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.qty-btn:hover {
  background-color: var(--primary-yellow);
  color: var(--text-dark);
}

.qty-val {
  width: 32px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
}

/* Sticky Sidebar Cart Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background-color: var(--bg-charcoal);
  border-left: 2px solid var(--primary-yellow);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  transition: right var(--transition-normal);
}

.cart-drawer.active {
  right: 0;
}

.cart-drawer-header {
  height: var(--header-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-drawer-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--primary-yellow);
}

.cart-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-white);
  font-size: 32px;
  cursor: pointer;
}

.cart-drawer-close:hover {
  color: var(--primary-yellow);
}

.cart-drawer-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 30px;
}

/* Cart Items inside Drawer */
.cart-empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 40px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 15px;
  margin-bottom: 15px;
}

.cart-item-details {
  flex-grow: 1;
}

.cart-item-name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.cart-item-price-calc {
  font-size: 13px;
  color: var(--text-muted);
}

.cart-item-total {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-yellow);
}

.cart-drawer-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 30px;
  background-color: rgba(0, 0, 0, 0.3);
}

.cart-totals {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.cart-subtotal-label {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cart-subtotal-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  color: var(--primary-yellow);
}

.cart-footer-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-align: center;
}

/* Floating Mobile Cart Trigger Button */
.mobile-cart-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-yellow);
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
  box-shadow: 4px 4px 0px var(--text-dark);
  display: none; /* Injected dynamically or enabled in responsive */
  align-items: center;
  justify-content: center;
  z-index: 999;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-cart-float:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--text-dark);
}

.mobile-cart-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--accent-red);
  color: var(--text-white);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--text-white);
}

/* Search Autocomplete Dropdown */
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--bg-charcoal);
  border: 1px solid rgba(255, 208, 0, 0.25);
  border-radius: 4px;
  z-index: 500;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.search-dropdown.visible {
  display: block;
}

.search-suggestion {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: background var(--transition-fast);
}

.search-suggestion:last-child {
  border-bottom: none;
}

.search-suggestion:hover {
  background-color: rgba(255, 208, 0, 0.08);
}

.search-suggestion-name {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
  text-transform: uppercase;
}

.search-suggestion-cat {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Card highlight flash on jump-to */
@keyframes flashHighlight {
  0%   { box-shadow: 0 0 0 3px rgba(255, 208, 0, 0.8); }
  100% { box-shadow: none; }
}

.highlight-flash {
  animation: flashHighlight 1.2s ease-out forwards;
}

/* Variant Size / Quantity Dropdown */
.variant-selector {
  margin-top: 10px;
  margin-bottom: 4px;
}

.variant-select {
  width: 100%;
  background-color: var(--bg-black);
  border: 1.5px solid rgba(255, 208, 0, 0.25);
  border-radius: 4px;
  color: var(--text-white);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FFD000'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
  transition: border-color var(--transition-fast);
}

.variant-select:focus {
  outline: none;
  border-color: var(--primary-yellow);
}

.variant-select option {
  background-color: var(--bg-charcoal);
  color: var(--text-white);
}

.variant-action-wrap {
  display: flex;
  align-items: center;
}

/* Responsive Overrides */
@media (max-width: 992px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .menu-filters-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 15px;
    gap: 15px;
  }
  .menu-search-wrap {
    max-width: 100%;
  }
  .menu-diet-filters {
    justify-content: space-between;
  }
  .diet-filter-btn {
    flex-grow: 1;
    justify-content: center;
  }
  .mobile-cart-float {
    display: flex;
  }
  .cart-drawer {
    width: 100%;
    right: -100%;
  }
}

@media (max-width: 576px) {
  .menu-category-title {
    font-size: 28px;
  }

  /* Stack card vertically so info panel has full width */
  .menu-card {
    flex-direction: column;
  }

  .menu-card-img-wrap {
    width: 100%;
    height: 200px;
    min-height: unset;
  }

  .menu-card-info {
    padding: 14px;
  }

  .menu-card-title {
    font-size: 15px;
  }

  /* Footer: stack price above controls on very small screens */
  .menu-card-footer {
    flex-wrap: wrap;
    gap: 10px;
  }

  .menu-card-price {
    font-size: 16px;
    flex: 1 0 100%;
  }

  /* Quantity controls and ADD button take full row */
  .quantity-control,
  .variant-action-wrap {
    width: 100%;
    justify-content: space-between;
  }

  .qty-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .qty-val {
    width: 40px;
    font-size: 15px;
  }

  /* Variant dropdown full width (already 100% but reinforce) */
  .variant-select {
    font-size: 13px;
    padding: 10px 35px 10px 12px;
  }

  /* ADD button full width */
  .add-to-cart-btn,
  .variant-action-wrap .btn {
    width: 100% !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    text-align: center;
  }

  /* Cart drawer items */
  .cart-item {
    flex-wrap: wrap;
    gap: 8px;
  }

  .cart-item-details {
    flex: 1 0 100%;
  }
}
