@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary-bg: #ffffff;
  --body-bg: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --maroon-accent: #991b1b;
  --maroon-hover: #7f1d1d;
  --maroon-light: #fef2f2;
  --veg-color: #16a34a;
  --nonveg-color: #dc2626;
  --navy-dark: #1e293b;
  --card-radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f1f5f9;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.app-wrapper {
  width: 100%;
  max-width: 480px;
  background-color: var(--primary-bg);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

/* Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--primary-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
}

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

.brand-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #334155;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.hotel-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-badge {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background-color: #fff;
}

.table-label {
  color: var(--text-muted);
}

.table-value {
  font-weight: 700;
  color: var(--text-main);
}

.search-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #475569;
  font-size: 16px;
}

/* Search bar expand */
.search-bar-container {
  display: none;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.search-bar-container.active {
  display: block;
}

.search-input-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 38px 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}

.search-input:focus {
  border-color: var(--maroon-accent);
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

/* Sub header info bar */
.sub-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  background-color: #ffffff;
}

.mode-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-icon {
  width: 24px;
  height: 24px;
  color: #475569;
}

.mode-text {
  display: flex;
  flex-direction: column;
}

.mode-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.1;
}

.mode-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

/* Filter Toggles (Veg / Non Veg) */
.filter-toggles {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.switch-track {
  width: 36px;
  height: 20px;
  background-color: #cbd5e1;
  border-radius: 20px;
  position: relative;
  transition: background-color 0.25s ease;
}

.switch-thumb {
  width: 16px;
  height: 16px;
  background-color: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-group.active-veg .switch-track {
  background-color: var(--veg-color);
}

.toggle-group.active-veg .switch-thumb {
  transform: translateX(16px);
}

.toggle-group.active-nonveg .switch-track {
  background-color: var(--nonveg-color);
}

.toggle-group.active-nonveg .switch-thumb {
  transform: translateX(16px);
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

/* Main Content Area */
.menu-content {
  flex: 1;
  padding: 16px;
  padding-bottom: 120px;
}

.category-section {
  margin-bottom: 24px;
}

.category-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 14px;
}

/* Menu Item Card */
.item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--card-radius);
  padding: 16px;
  margin-bottom: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.item-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.item-main-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Veg & Non-Veg Icons */
.type-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.veg-icon {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--veg-color);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.veg-dot {
  width: 8px;
  height: 8px;
  background-color: var(--veg-color);
  border-radius: 50%;
}

.nonveg-icon {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--nonveg-color);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.nonveg-dot {
  width: 8px;
  height: 8px;
  background-color: var(--nonveg-color);
  border-radius: 50%;
}

.item-name {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.item-price {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

.item-bottom-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* Initial Add + Button */
.add-btn {
  background: #ffffff;
  border: 1.5px solid var(--maroon-accent);
  color: var(--maroon-accent);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.add-btn:hover, .add-btn:active {
  background-color: var(--maroon-light);
  transform: scale(1.02);
}

/* Quantity Control Box (- 1 +) */
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--maroon-accent);
  border-radius: 8px;
  background-color: #ffffff;
  overflow: hidden;
  height: 34px;
}

.qty-btn {
  background: transparent;
  border: none;
  color: var(--maroon-accent);
  font-weight: 700;
  font-size: 16px;
  width: 32px;
  height: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
  font-family: inherit;
}

.qty-btn:hover, .qty-btn:active {
  background-color: var(--maroon-light);
}

.qty-val {
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
  padding: 0 10px;
  user-select: none;
  min-width: 24px;
  text-align: center;
}

/* Floating Bottom Bar (Cart Summary) */
.cart-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  z-index: 150;
  background-color: var(--maroon-accent);
  color: #ffffff;
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 25px rgba(153, 27, 27, 0.4);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.cart-info {
  display: flex;
  flex-direction: column;
}

.cart-count-label {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.9;
}

.cart-total-price {
  font-size: 17px;
  font-weight: 700;
}

.cart-action-btn {
  background-color: #ffffff;
  color: var(--maroon-accent);
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease;
  font-family: inherit;
}

.cart-action-btn:hover {
  transform: scale(1.03);
}

/* Floating Menu Button */
.floating-menu-btn {
  position: fixed;
  bottom: 24px;
  right: calc(50% - 220px + 16px);
  z-index: 90;
  background-color: var(--navy-dark);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, bottom 0.2s ease;
  font-family: inherit;
}

/* Adjust floating menu button when cart bar is active */
body.has-active-cart .floating-menu-btn {
  bottom: 82px;
}

@media (max-width: 480px) {
  .floating-menu-btn {
    right: 20px;
  }
}

.floating-menu-btn:active {
  transform: scale(0.95);
}

/* Modal Overlay & Drawer */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-drawer {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-drawer {
  transform: translateY(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.drawer-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.close-drawer-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.category-list {
  list-style: none;
  overflow-y: auto;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: #334155;
  transition: background 0.15s ease;
}

.category-item:hover {
  color: var(--maroon-accent);
  background-color: #f8fafc;
}

.category-count {
  font-size: 13px;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

/* Order Summary Table in Modal */
.order-summary-list {
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 16px;
}

.order-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.order-item-detail {
  display: flex;
  flex-direction: column;
}

.order-item-name {
  font-weight: 600;
  font-size: 14px;
}

.order-item-qty {
  font-size: 12px;
  color: var(--text-muted);
}

.order-item-price {
  font-weight: 700;
  font-size: 14px;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 2px solid var(--border-color);
  font-size: 16px;
  font-weight: 700;
}

.place-order-btn {
  width: 100%;
  background-color: var(--maroon-accent);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: inherit;
}

.place-order-btn:hover {
  background-color: var(--maroon-hover);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.empty-state-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-main);
  margin-bottom: 4px;
}
