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

:root {
  --bg-color: #f8fafc;
  --bg-panel: rgba(255, 255, 255, 0.85);
  --bg-panel-hover: rgba(241, 245, 249, 0.95);
  --accent-color: #f97316;
  --accent-hover: #ea580c;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: rgba(0, 0, 0, 0.08);
  --success-color: #10b981;
  --warning-color: #eab308;
  --danger-color: #ef4444;
  --info-color: #3b82f6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography & Utilities */
h1, h2, h3 { font-weight: 600; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; outline: none; transition: all 0.3s ease; }

.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(0,0,0,0.05);
}

/* Navbar */
header {
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo span {
  color: var(--text-main);
}

header nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.cart-icon-wrapper {
  position: relative;
  cursor: pointer;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger-color);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero Section */
.hero {
  padding: 80px 40px;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 16px;
  background: linear-gradient(to right, #f97316, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 30px auto;
}

/* Menu Grid */
.menu-section {
  padding: 40px;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.food-card {
  padding: 20px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.food-card:hover {
  transform: translateY(-5px);
  background: var(--bg-panel-hover);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.food-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 20px;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.food-title {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.food-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

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

.price {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-color);
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: var(--bg-color);
  border-left: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

.cart-sidebar.open {
  right: 0;
}

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

.close-btn {
  background: transparent;
  color: var(--text-main);
  font-size: 1.5rem;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.cart-item-info h4 {
  margin-bottom: 5px;
}

.cart-item-price {
  color: var(--accent-color);
  font-weight: 500;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  background: var(--bg-panel);
  color: var(--text-main);
  width: 25px;
  height: 25px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-panel);
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* Map / Checkout Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.checkout-modal {
  width: 90%;
  max-width: 600px;
  padding: 30px;
  border-radius: 20px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.form-input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  font-size: 1rem;
}
.form-input:focus {
  border-color: var(--accent-color);
  outline: none;
}
.map-container {
  height: 250px;
  background: #e2e8f0;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  overflow: hidden;
  position: relative;
}

#googleMap {
  width: 100%;
  height: 100%;
}

.territory-status {
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-ok { color: var(--success-color); }
.status-bad { color: var(--danger-color); }

.cod-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-color);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-bottom: 20px;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Admin Dashboard Specific */
.admin-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  padding: 30px 20px;
}

.admin-menu {
  margin-top: 40px;
  list-style: none;
}
.admin-menu li { margin-bottom: 10px; }
.admin-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: background 0.2s;
}
.admin-menu a:hover, .admin-menu a.active {
  background: rgba(255,255,255,0.05);
  color: var(--text-main);
}

.admin-main {
  padding: 40px;
  overflow-y: auto;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-card h3 { color: var(--text-muted); font-size: 1rem; }
.stat-card .val { font-size: 2rem; font-weight: 700; color: var(--accent-color); }

.orders-table-wrapper {
  overflow-x: auto;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
}

.orders-table th, .orders-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.orders-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  background: rgba(0,0,0,0.03);
}

.status-badge {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-pending { background: rgba(234, 179, 8, 0.2); color: var(--warning-color); }
.status-accepted { background: rgba(59, 130, 246, 0.2); color: var(--info-color); }
.status-on-way { background: rgba(147, 51, 234, 0.2); color: #c084fc; }
.status-delivered { background: rgba(16, 185, 129, 0.2); color: var(--success-color); }

.action-select {
  background: var(--bg-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: 4px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--bg-panel);
  border-left: 4px solid var(--accent-color);
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
