/* ================================
   MONS RESTO - Main Stylesheet
   ================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

:root {
  --primary: #e67e22;
  --primary-dark: #d35400;
  --primary-light: rgba(230,126,34,0.1);
  --secondary: #2c3e50;
  --accent: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
  --light: #f1f3f5;
  --dark: #1a1a2e;
  --gray: #95a5a6;
  --white: #ffffff;
  --bg: #f8f9fa;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
main { flex: 1; }

/* --- Navbar --- */
.navbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}
.navbar-brand span { color: var(--secondary); }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
  font-size: 0.95rem;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--primary);
  color: var(--white);
}
.nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-user-dropdown {
  position: relative;
}
.nav-user-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  padding: 8px 0;
  min-width: 180px;
  z-index: 100;
}
.nav-user-dropdown:hover .dropdown-menu,
.nav-user-dropdown .dropdown-menu.show { display: block; }
.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  font-size: 0.9rem;
}
.dropdown-menu a:hover { background: var(--light); }

.mobile-toggle {
  display: none;
  background: none;
  font-size: 1.5rem;
  color: var(--text);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  border: 2px solid transparent;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(230,126,34,0.3); }
.btn-secondary { background: var(--secondary); color: var(--white); }
.btn-secondary:hover { background: #1a252f; }
.btn-success { background: var(--accent); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.04);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-body { padding: 20px; }
.card-img { width: 100%; height: 200px; object-fit: cover; background: var(--light); }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--white);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(230, 126, 34, 0.1);
}
select.form-control { appearance: none; cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-primary { background: var(--primary); color: white; }
.badge-success { background: var(--accent); color: white; }
.badge-warning { background: var(--warning); color: white; }
.badge-danger { background: var(--danger); color: white; }
.badge-info { background: var(--info); color: white; }
.badge-secondary { background: var(--gray); color: white; }

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--dark) 100%);
  color: var(--white);
  padding: 100px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(230,126,34,0.15) 0%, transparent 60%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 3.2rem; margin-bottom: 16px; font-weight: 800; letter-spacing: -0.5px; }
.hero p { font-size: 1.15rem; opacity: 0.85; margin-bottom: 32px; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* --- Section --- */
.section { padding: 60px 0; }
.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.section-title p { color: var(--text-light); font-size: 1.05rem; }

/* --- Grid --- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Menu Card --- */
.menu-card .card-body { padding: 16px 20px 20px; }
.menu-card .menu-category {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
}
.menu-card .menu-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.menu-card .menu-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.menu-card .menu-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.menu-card .menu-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

/* --- Services --- */
.service-card {
  text-align: center;
  padding: 40px 24px;
}
.service-card .service-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 16px;
}
.service-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.service-card p { color: var(--text-light); font-size: 0.9rem; }

/* --- Category Filter --- */
.category-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  justify-content: center;
}
.category-filter button {
  padding: 8px 20px;
  border-radius: 25px;
  background: var(--white);
  border: 2px solid #e0e0e0;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}
.category-filter button:hover,
.category-filter button.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* --- Cart Table --- */
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.cart-table th {
  background: var(--light);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-light);
}
.cart-item-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.quantity-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.quantity-control button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--light);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.quantity-control button:hover { background: var(--primary); color: white; }
.quantity-control span { font-weight: 700; min-width: 20px; text-align: center; }

/* --- Order Summary --- */
.order-summary {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 90px;
}
.order-summary h3 { font-size: 1.2rem; margin-bottom: 16px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.summary-row.total { font-size: 1.2rem; font-weight: 800; border-top: 2px solid var(--primary); border-bottom: 0; padding-top: 12px; margin-top: 8px; }

/* --- Auth Page --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--secondary), var(--dark));
  padding: 20px;
}
.auth-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 {
  text-align: center;
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 8px;
}
.auth-card .subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 30px;
}

/* --- Status Progress --- */
.status-progress {
  display: flex;
  justify-content: space-between;
  margin: 30px 0;
  position: relative;
}
.status-progress::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 3px;
  background: #e0e0e0;
}
.status-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}
.status-step .step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.status-step.active .step-dot { background: var(--primary); }
.status-step.completed .step-dot { background: var(--accent); }
.status-step .step-label { font-size: 0.75rem; color: var(--text-light); font-weight: 600; }

/* --- Success Page --- */
.success-page {
  text-align: center;
  padding: 60px 0;
}
.success-icon {
  width: 80px;
  height: 80px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 20px;
}

/* --- Alert --- */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 500;
}
.alert-success { background: #d5f5e3; color: #1e8449; }
.alert-error { background: #fadbd8; color: #c0392b; }
.alert-warning { background: #fdebd0; color: #d35400; }
.alert-info { background: #d6eaf8; color: #2471a3; }

/* --- Footer --- */
.footer {
  background: linear-gradient(180deg, var(--secondary) 0%, var(--dark) 100%);
  color: var(--white);
  padding: 48px 0 24px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.footer h4 { font-size: 1.1rem; margin-bottom: 16px; color: var(--primary); }
.footer p { font-size: 0.9rem; color: rgba(255,255,255,0.7); line-height: 1.8; margin-bottom: 4px; }
.footer-links a, .footer-contact p { display: block; font-size: 0.9rem; color: rgba(255,255,255,0.7); line-height: 1.6; padding: 4px 0; transition: var(--transition); }
.footer-links a:hover { color: var(--primary); padding-left: 4px; }
.footer-contact p { margin-bottom: 2px; }
.footer a { font-size: 0.9rem; color: rgba(255,255,255,0.7); }
.footer a:hover { color: var(--primary); }
.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* --- Pagination --- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 30px; }
.pagination button {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid #e0e0e0;
  font-weight: 600;
  transition: var(--transition);
}
.pagination button.active, .pagination button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* --- Loading --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Toast --- */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; }
.toast {
  background: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--accent); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- Two Column Layout --- */
.two-col { display: grid; grid-template-columns: 1fr 380px; gap: 30px; align-items: start; }

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { margin-bottom: 8px; color: var(--text); }

/* --- Search Bar --- */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.search-bar input { flex: 1; }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: var(--transition);
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 1.3rem; }
.modal-close {
  background: none;
  font-size: 1.5rem;
  color: var(--text-light);
  padding: 4px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
  .nav-links.show {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 16px;
    box-shadow: var(--shadow);
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cart-table { font-size: 0.85rem; }
  .cart-table th:nth-child(2), .cart-table td:nth-child(2) { display: none; }
  .status-progress { flex-wrap: wrap; gap: 8px; justify-content: center; }
}

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
}

/* --- Modern Enhancements --- */
::selection {
  background: rgba(230,126,34,0.2);
  color: var(--text);
}
