/* Component-Specific Layouts & Styles */

/* 1. Food Visual Cards (75% Image Area, 25% Info/Actions) */
.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 520px) {
  .food-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
}

.food-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 330px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

@media (max-width: 520px) {
  .food-card {
    height: 275px;
    border-radius: 12px;
  }
}

.food-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.food-card-img-wrapper {
  position: relative;
  height: 70%;
  width: 100%;
  overflow: hidden;
  background-color: var(--bg-tertiary);
}

@media (max-width: 520px) {
  .food-card-img-wrapper {
    height: 60%;
  }
}

.food-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.food-card:hover .food-card-img {
  transform: scale(1.08);
}

.food-card-badge {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  z-index: 2;
  backdrop-filter: blur(8px);
}

@media (max-width: 520px) {
  .food-card-badge {
    top: 0.4rem;
    right: 0.4rem;
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
  }
}

.food-card-unavailable-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f87171;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 3;
}

@media (max-width: 520px) {
  .food-card-unavailable-overlay {
    font-size: 0.85rem;
  }
}

.food-card-body {
  height: 30%;
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
}

@media (max-width: 520px) {
  .food-card-body {
    height: 40%;
    padding: 0.5rem 0.6rem;
  }
}

.food-card-title {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 520px) {
  .food-card-title {
    font-size: 0.825rem;
    line-height: 1.25;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.3em;
  }
}

.food-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.food-card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold);
}

@media (max-width: 520px) {
  .food-card-price {
    font-size: 0.95rem;
  }
}

.qty-control {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.qty-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
  transition: background var(--transition-fast);
}

@media (max-width: 520px) {
  .qty-btn {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }
}

.qty-btn:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
}

.qty-val {
  padding: 0 0.6rem;
  font-weight: 800;
  font-size: 0.95rem;
  min-width: 24px;
  text-align: center;
}

@media (max-width: 520px) {
  .qty-val {
    padding: 0 0.35rem;
    font-size: 0.85rem;
    min-width: 18px;
  }
}

/* 2. Category Pills Slider */
.category-slider {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  padding-top: 0.25rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.category-slider::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.category-pill {
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: pointer;
  scroll-snap-align: start;
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .category-pill {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
  }
}

.category-pill:hover,
.category-pill.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--shadow-accent);
}

/* 3. Visual Table Grid */
.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.1rem;
}

.table-card {
  position: relative;
  padding: 1.35rem 1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.table-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.table-card.available {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.06);
}

.table-card.occupied {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.table-card.waiting {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.table-number {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* 4. KPI Summary Metric Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.kpi-card {
  padding: 1.35rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.kpi-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}

/* 5. POS Layout Split View */
.pos-container {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 1.35rem;
  height: calc(100vh - 95px);
}

@media (max-width: 992px) {
  .pos-container {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.pos-catalog-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.pos-cart-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  height: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.pos-cart-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  font-weight: 800;
}

.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.pos-cart-summary {
  padding: 1.35rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* 6. Customer Mobile App Sticky Navigation & Floating Cart */
.customer-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-item.active {
  color: #818cf8;
  font-weight: 800;
}

.nav-item-icon {
  font-size: 1.35rem;
  position: relative;
  line-height: 1;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -10px;
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
}

#floating-view-cart-btn {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 1.5rem);
  max-width: 440px;
  z-index: 95;
  animation: floatCartPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes floatCartPop {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Kitchen Order Visual Step Stepper */
.order-stepper-wrapper {
  margin: 0.85rem 0;
  padding: 0.75rem 0.5rem 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.order-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  z-index: 2;
  flex: 1;
  text-align: center;
}

.step-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.step-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.step-node.completed .step-icon {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
  color: #34d399;
}

.step-node.completed .step-label {
  color: #34d399;
}

.step-node.active .step-icon {
  background: var(--accent-gradient);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.6);
  animation: pulseIcon 1.5s infinite;
}

.step-node.active .step-label {
  color: #818cf8;
  font-weight: 800;
}

@keyframes pulseIcon {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* 7. Professional Screen Receipt Preview Cards */
.receipt-paper {
  background: #ffffff !important;
  color: #0f172a !important;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  margin: 0 auto;
  font-family: 'Outfit', 'Inter', -apple-system, sans-serif !important;
}

.receipt-logo-wrapper {
  text-align: center;
  margin-bottom: 0.5rem;
}

.receipt-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
}

.receipt-header {
  text-align: center;
  padding-bottom: 0.5rem;
}

.receipt-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a !important;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.receipt-subtext {
  font-size: 0.8rem;
  color: #475569 !important;
  line-height: 1.35;
}

.receipt-divider {
  border-top: 2px dashed #94a3b8 !important;
  margin: 0.875rem 0;
}

.receipt-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.825rem;
  color: #334155 !important;
}

.receipt-meta-row {
  display: flex;
  justify-content: space-between;
}

/* Standardized Data Table Styling for Admin & Manager Panels */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.data-table th,
.data-table td {
  text-align: center !important;
  vertical-align: middle !important;
  padding: 0.85rem 0.75rem;
}

.data-table th {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.data-table td {
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table td .flex,
.data-table th .flex {
  justify-content: center !important;
  text-align: center !important;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
}

.receipt-table th {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #0f172a !important;
  border-bottom: 2px solid #0f172a !important;
  padding: 0.5rem 0.25rem;
}

.receipt-table td {
  font-size: 0.875rem;
  color: #1e293b !important;
  border-bottom: 1px dashed #cbd5e1 !important;
  padding: 0.5rem 0.25rem;
  vertical-align: middle;
}

.receipt-totals-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #334155 !important;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
}

.receipt-grand-total {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a !important;
  border-top: 2px solid #0f172a !important;
  border-bottom: 2px solid #0f172a !important;
  padding: 0.6rem 0;
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.receipt-footer {
  text-align: center;
  margin-top: 0.875rem;
  font-size: 0.775rem;
  color: #475569 !important;
}

/* 8. Responsive Sidebar & Navigation for Admin & Manager */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-normal);
  z-index: 10;
}

.sidebar-header {
  padding: 1.35rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 1.2rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-menu {
  flex: 1;
  padding: 1.1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  user-select: none;
}

.sidebar-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
  transform: translateX(3px);
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.08) 100%);
  color: #a5b4fc;
  border: 1px solid var(--border-hover);
  border-left: 4px solid var(--accent-primary);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background-color: var(--bg-primary);
}

.top-navbar {
  height: 68px;
  padding: 0 1.75rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
