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

:root {
  --primary-color: #3b2689;
  --primary-color-dark: #2a1b63;
  --secondary-color: #5a45b8;
  --category-color: #241755;
  --category-color-strong: #1a1140;
  --accent-color: #FFD700;
  --text-dark: #333;
  --text-light: #666;
  --bg-light: #f8f8f8;
  --border-color: #ddd;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --text-color: #333;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #fff;
  color: var(--text-dark);
  line-height: 1.6;
}

.site-brand {
  position: fixed;
  top: 10px;
  left: 14px;
  z-index: 4000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 60px;
  text-decoration: none;
}

.site-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.site-brand:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
}

.portal-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(90deg, #241769 0%, #3b2689 55%, #4c35a0 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 4px 24px rgba(16, 10, 38, 0.38);
}

.portal-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.8rem;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.portal-topbar .site-brand {
  position: static;
  flex: 0 0 auto;
  top: auto;
  left: auto;
  z-index: auto;
  background: transparent;
  border: none;
  box-shadow: none;
}

.portal-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.portal-topbar-inner > .user-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 1 260px;
  min-width: 0;
  max-width: 260px;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  appearance: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-topbar-inner > .user-info:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.portal-topbar-inner > .user-info:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.88);
  outline-offset: 2px;
}

.portal-topbar-inner > .user-info .header-user-avatar {
  width: 30px;
  height: 30px;
  border-color: rgba(255, 255, 255, 0.45);
}

.portal-topbar-inner > .user-info .header-user-avatar--placeholder {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.portal-topbar-inner > .user-info .header-user-label {
  color: inherit;
}

.portal-topbar-actions .portal-cart-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.portal-topbar-actions .portal-cart-btn .cart-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* ── Topbar address bar (portal) ── */
.portal-topbar .portal-address-row {
  flex: 1;
  min-width: 0;
  max-width: 520px;
  position: relative;
  margin-top: 0;
}

.portal-topbar .portal-address-field {
  width: 100%;
}

.portal-topbar .address-input-wrapper {
  gap: 0.45rem;
}

.portal-topbar .portal-address-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 22px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: #fff;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}

.portal-topbar .portal-address-input::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

.portal-topbar .portal-address-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.portal-topbar .portal-address-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 300;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #e0d5f5;
}

.portal-topbar .geolocation-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: #fff;
  padding: 0.42rem 0.55rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.portal-topbar .geolocation-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.portal-signup-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #fff;
  color: var(--primary-color);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.portal-signup-link:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container.app-locked {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.auth-portal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 215, 0, 0.18) 0, rgba(255, 215, 0, 0) 45%),
    radial-gradient(circle at 85% 10%, rgba(59, 38, 137, 0.2) 0, rgba(59, 38, 137, 0) 40%),
    linear-gradient(145deg, #f9f0e4 0%, #f4e1c8 45%, #ecd1ad 100%);
}

.auth-portal-card {
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(42, 27, 99, 0.18);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(60, 28, 8, 0.2);
  padding: 1.5rem;
}

.auth-portal-card h1 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.8rem;
}

.auth-portal-message {
  margin: 0.6rem 0 1.2rem;
  color: #5c3a1b;
}

.auth-portal-form {
  display: grid;
  gap: 0.9rem;
}

.auth-error-message {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #f1b8b8;
  background: #ffecec;
  color: #8f1212;
  font-size: 0.9rem;
}

/* Header */
.header {
  background: #ffffff;
  color: var(--primary-color);
  margin-top: 70px;
  padding: 1.5rem 2rem;
  box-shadow: 0 2px 8px rgba(59, 38, 137, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1 1 400px;
  min-width: 0;
  min-inline-size: 0;
}

.portal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 38, 137, 0.35);
  background: rgba(59, 38, 137, 0.08);
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.portal-back-link:hover {
  transform: translateY(-1px);
  background: rgba(59, 38, 137, 0.14);
}

.portal-back-link:focus-visible {
  outline: 3px solid rgba(59, 38, 137, 0.35);
  outline-offset: 2px;
}

.header-logo-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1 1 auto;
  min-width: 0;
  min-inline-size: 0;
}

.header-text {
  flex: 1 1 auto;
  min-width: 0;
  min-inline-size: 0;
}

.restaurant-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(59, 38, 137, 0.18);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.header-text h1 {
  font-size: 2rem;
  margin-bottom: 0.3rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.restaurant-title-row {
  display: inline-flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.restaurant-city-postal {
  font-size: 0.82rem;
  opacity: 0.78;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.header-text p {
  font-size: 0.95rem;
  opacity: 0.9;
}
.portal-address-row {
  position: relative;
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  width: 100%;
  max-width: min(100%, 900px);
  margin-left: 0;
  margin-right: 0;
}

.header-left-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.portal-address-label {
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 1;
}

.portal-address-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 780px;
}

.portal-address-input {
  width: 100%;
  min-width: 170px;
  border: 1px solid rgba(59, 38, 137, 0.35);
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  color: #2a1b63;
  background: rgba(255, 255, 255, 0.95);
  font-size: 0.86rem;
}

.address-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.address-input-wrapper .portal-address-input {
  flex: 1;
}

.geolocation-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  padding: 0.38rem 0.55rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.geolocation-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
}

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

.geolocation-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
}

.portal-address-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid #d8c2a8;
  border-radius: 8px;
  background: #fffaf3;
  box-shadow: 0 10px 22px rgba(49, 25, 10, 0.22);
  z-index: 80;
}

.portal-address-suggestion-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid #f0decc;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.62rem;
  font-size: 0.86rem;
  color: #5a3217;
  cursor: pointer;
}

.portal-address-suggestion-item:last-child {
  border-bottom: none;
}

.portal-address-suggestion-item:hover {
  background: #f6e8d8;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex: 0 0 auto;
  align-self: flex-start;
  min-width: 0;
  margin-left: auto;
}

.header-identity {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-admin-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
}

.header-admin-group:not(:has(button:not(.hidden))) {
  display: none;
}

.header-actions .user-info {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 1 340px;
  max-width: min(100%, 340px);
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 2px solid #111;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  appearance: none;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

.header-user-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 69, 19, 0.12);
  color: var(--primary-color);
  font-size: 1.05rem;
}

.header-user-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions .user-info:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.header-actions .user-info:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.88);
  outline-offset: 2px;
}

@media (max-width: 1180px) {
  .header-actions {
    justify-content: flex-end;
  }

  .header-actions .user-info {
    max-width: min(100%, 340px);
  }
}

@media (max-width: 860px) {
  .portal-topbar-inner {
    padding: 0 1rem;
    height: auto;
    min-height: 66px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .portal-topbar-inner > .user-info {
    order: 2;
    flex: 1 1 auto;
    max-width: 100%;
  }

  .portal-topbar .portal-address-row {
    order: 3;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .header {
    flex-wrap: wrap;
    margin-top: 126px;
  }

  .header-content {
    flex: 1 1 100%;
  }

  .header-actions {
    flex: 1 1 100%;
    align-items: flex-start;
  }

  .portal-topbar-inner > .user-info,
  .header-actions .user-info {
    flex: 0 0 auto;
    max-width: none;
    min-width: auto;
    padding: 0.42rem;
    gap: 0;
  }

  .portal-topbar-inner > .user-info .header-user-label,
  .header-actions .user-info .header-user-label {
    display: none;
  }

  .header-identity,
  .header-admin-group {
    justify-content: flex-start;
  }

  .portal-address-row {
    max-width: 100%;
  }
}

.admin-btn {
  background: white;
  color: var(--primary-color);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.admin-btn:hover, .orders-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cart-btn,
.login-btn,
.logout-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.cart-btn:hover,
.login-btn:hover,
.logout-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.55);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.orders-btn {
  background: white;
  color: var(--primary-color);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.orders-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.orders-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

.orders-modal-content {
  max-width: 960px;
}

.orders-public-body {
  padding: 1.5rem;
}

.superadmin-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  display: flex;
  justify-content: center;
  padding: 0.6rem 1rem;
  background: rgba(30, 10, 5, 0.82);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.superadmin-bar.hidden {
  display: none;
}

.superadmin-bar-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.35);
  padding: 0.6rem 2rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.superadmin-bar-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.superadmin-bar-btn:active {
  transform: translateY(0);
}

.site-footer {
  border-top: 1px solid #d8d8d8;
  background: #f1f1f1;
}

.site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.1rem 1.2rem;
  display: grid;
  gap: 0.55rem;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}

.site-footer-links a,
.site-footer-support a {
  color: #3f3f3f;
  font-weight: 600;
  text-decoration: none;
}

.site-footer-links a:hover,
.site-footer-support a:hover {
  text-decoration: underline;
}

.site-footer-support {
  margin: 0;
  color: #5c5c5c;
  font-size: 0.95rem;
}

.orders-preview-banner {
  position: fixed;
  top: 108px;
  right: 20px;
  width: min(360px, calc(100vw - 24px));
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  background: rgba(28, 19, 12, 0.58);
  backdrop-filter: blur(10px);
  color: #fff7eb;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  z-index: 2500;
}

.orders-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  cursor: grab;
}

.orders-preview-header:active {
  cursor: grabbing;
}

.orders-preview-actions {
  display: flex;
  gap: 0.45rem;
}

.orders-preview-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.orders-preview-action-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.orders-preview-body {
  max-height: 240px;
  overflow-y: auto;
  padding: 0.7rem 0.75rem 0.8rem;
}

.orders-preview-item {
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.55rem;
  background: rgba(255, 255, 255, 0.08);
}

.orders-preview-item:last-child {
  margin-bottom: 0;
}

.orders-preview-item p {
  margin: 0;
  font-size: 0.86rem;
}

.orders-preview-item p + p {
  margin-top: 0.15rem;
}

.orders-preview-empty {
  margin: 0;
  color: rgba(255, 247, 235, 0.9);
}

.orders-preview-banner.is-minimized .orders-preview-body {
  display: none;
}

.orders-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.orders-summary-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px dashed #d8b089;
  border-radius: 10px;
  background: #fff6ec;
  color: #6b3410;
  font-size: 0.95rem;
}

.orders-summary-card {
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  background: #fffaf4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.orders-summary-filter-btn {
  width: 100%;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.orders-summary-filter-btn.is-active {
  border-color: #7a4019;
  box-shadow: 0 0 0 2px rgba(122, 64, 25, 0.2);
}

.orders-summary-label {
  text-transform: capitalize;
  font-weight: 700;
}

.orders-summary-count {
  font-size: 1.4rem;
}


.cart-icon-svg {
  width: 1.22rem;
  height: 1.22rem;
  display: block;
  color: #fff;
}
.orders-public-list {
  display: grid;
  gap: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.orders-status-section {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem;
}

.orders-status-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.orders-status-heading span {
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #f4e3d4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.public-order-card {
  background: linear-gradient(180deg, #fff 0%, #fcf7f1 100%);
}

.public-order-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.public-order-meta p {
  margin: 0;
  color: var(--text-dark);
}

.order-products-block {
  margin-top: 0.8rem;
}

.order-products-block p {
  margin: 0 0 0.3rem;
}

.order-products-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--text-dark);
}

.order-products-empty {
  margin: 0;
  color: var(--text-light);
}

.cart-count {
  background: var(--accent-color);
  color: var(--primary-color);
  border-radius: 999px;
  min-width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: bold;
  padding: 0 0.28rem;
}

.portal-cart-btn .cart-count {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  margin-left: 0;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.zone-alert-banner {
  max-width: 1200px;
  margin: 0.75rem auto 0;
  padding: 0.85rem 1rem;
  border: 2px solid #b71c1c;
  border-radius: 10px;
  background: #ffebeb;
  color: #7a0e0e;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 6px 16px rgba(183, 28, 28, 0.2);
}

/* Filter Section */
.filter-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-input {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.search-input {
  width: 100%;
  min-width: 200px;
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 0 1.5rem;
}

.category-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.category-scroll-btn {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(59, 38, 137, 0.08);
  border: 1px solid rgba(59, 38, 137, 0.15);
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-scroll-btn:hover:not(:disabled) {
  background: rgba(59, 38, 137, 0.14);
  border-color: rgba(59, 38, 137, 0.3);
}

.category-scroll-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.category-filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: scroll;
  overflow-y: hidden;
  flex: 1;
  scroll-behavior: smooth;
  padding: 0.25rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 38, 137, 0.2) transparent;
}

.category-filter-bar::-webkit-scrollbar {
  height: 6px;
}

.category-filter-bar::-webkit-scrollbar-track {
  background: transparent;
}

.category-filter-bar::-webkit-scrollbar-thumb {
  background: rgba(59, 38, 137, 0.25);
  border-radius: 999px;
}

.category-filter-bar::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 38, 137, 0.4);
}

.category-filter-btn {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--text-dark);
  border-radius: 0;
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
}

.category-filter-btn:hover {
  background: #e8e8e8;
}

.category-filter-btn.active {
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  box-shadow: none;
}

.category-filter-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Menu Section */
.plats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.plat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.plat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.plat-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  overflow: hidden;
}

.plat-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.plat-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.plat-content h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.plat-content .categorie {
  font-size: 0.85rem;
  color: var(--category-color);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.plat-content p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  flex: 1;
}

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

.plat-prix {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--secondary-color);
}

.add-to-cart-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
}
.add-to-cart-btn.is-disabled-zone,
.add-to-cart-btn.is-disabled-conflict,
.add-to-cart-btn:disabled {
  background: #c9c2b9;
  color: #7a7269;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.zone-alert-content {
  max-width: 560px;
}

.zone-alert-body {
  padding: 1.2rem 1.4rem 1.4rem;
}

.zone-alert-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.zone-alert-actions .submit-btn,
.zone-alert-actions .cancel-btn {
  width: 100%;
  min-width: 220px;
  flex: 1 1 220px;
  padding: 0.72rem 1.1rem;
  border-radius: 10px;
  font-weight: 700;
  border: none;
  background: var(--primary-color);
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.zone-alert-actions .cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.zone-alert-actions .submit-btn:hover,
.zone-alert-actions .cancel-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.zone-alert-actions .submit-btn:focus-visible,
.zone-alert-actions .cancel-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.add-to-cart-btn.adding {
  animation: addToCartPress 0.38s ease;
}

.cart-btn.cart-bump {
  animation: cartBump 0.5s ease;
}

.cart-fly-item {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1200;
  width: 2.1rem;
  height: 2.1rem;
  margin-left: -1.05rem;
  margin-top: -1.05rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-color) 0%, #ffb700 100%);
  color: var(--primary-color-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  animation: flyToCart 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@keyframes addToCartPress {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1.05);
  }
}

@keyframes cartBump {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.12);
  }
  55% {
    transform: scale(0.96);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes flyToCart {
  0% {
    transform: translate3d(0, 0, 0) scale(0.85);
    opacity: 0.95;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--cart-fly-x), var(--cart-fly-y), 0) scale(0.35);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .add-to-cart-btn.adding,
  .cart-btn.cart-bump,
  .cart-fly-item {
    animation: none;
  }
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.admin-user-section {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 8px;
  background: #fff;
}

.admin-user-section .secondary-btn {
  background: #fff;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  cursor: pointer;
}

.create-user-form {
  margin-top: 0.8rem;
  padding: 0.7rem;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  background: #f7f7f7;
}

.user-list {
  margin-top: 0.8rem;
}

.user-item {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #000; /* Texte en noir */
}

.user-list .user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #000; /* Texte en noir */
}

.user-name {
  font-weight: bold;
  color: #000; /* Texte en noir */
}

.admin-badge {
  background: var(--primary-color);
  color: white;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
}

.user-actions {
  display: flex;
  gap: 0.5rem;
}

.user-actions {
  display: flex;
  gap: 0.5rem;
}

.user-actions button {
  background: var(--primary-color);
  color: white;
  border: 1px solid var(--primary-color);
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

.user-actions button:hover {
  background: var(--primary-color-dark, #d44a3f);
  border-color: var(--primary-color-dark, #d44a3f);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-actions button:first-child {
  background: #007bff;
  border-color: #007bff;
}

.user-actions button:first-child:hover {
  background: #0056b3;
  border-color: #0056b3;
}

.edit-user-form {
  margin-top: 0.8rem;
  padding: 0.7rem;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  background: #f7f7f7;
}

.edit-user-form h4 {
  margin-bottom: 0.8rem;
  color: var(--primary-color);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.cancel-btn {
  background: #666;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.cancel-btn:hover {
  background: #555;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-height: 90vh;
  overflow-y: auto;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

.modal-content.modal-large {
  max-width: 900px;
}

.profile-modal-content {
  max-width: 560px;
}

.profile-form {
  padding: 1.2rem 1.5rem 1.6rem;
}

.profile-photo-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.profile-photo-preview {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.profile-photo-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.profile-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--primary-color);
  background: #fff;
  color: var(--primary-color);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

.profile-photo-file {
  display: none;
}

.profile-photo-actions small {
  font-size: 0.82rem;
  color: var(--text-light);
}

.profile-address-group {
  position: relative;
}

.profile-address-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid #e0c9ae;
  border-radius: 10px;
  background: #fffdf9;
  box-shadow: 0 10px 22px rgba(73, 37, 14, 0.16);
  z-index: 30;
}

.profile-address-suggestion-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid #f1e7da;
  background: transparent;
  text-align: left;
  padding: 0.62rem 0.75rem;
  color: #5a3217;
  cursor: pointer;
}

.profile-address-suggestion-item:last-child {
  border-bottom: none;
}

.profile-address-suggestion-item:hover {
  background: #fff3e5;
}

@keyframes slideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.modal-header h2 {
  color: var(--primary-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: var(--primary-color);
}

/* Cart Section */
.cart-items {
  padding: 1.5rem;
  min-height: 100px;
}

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

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.cart-item-price {
  color: var(--text-light);
  font-size: 0.95rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.quantity-btn:hover {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.remove-btn {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  background: #ff5252;
}

.cart-summary {
  padding: 1.5rem;
  border-top: 2px solid var(--border-color);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--primary-color);
}

.total {
  color: var(--secondary-color);
}

.checkout-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.checkout-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.empty-cart-message {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

/* Admin Section */
.admin-content {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.admin-form-section, .admin-list-section, .admin-restaurant-section {
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 8px;
}

.admin-form-section h3, .admin-list-section h3, .admin-restaurant-section h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: bold;
  color: var(--primary-color);
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

.phone-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.phone-country {
  width: 170px;
  min-width: 150px;
  padding: 0.72rem 2.5rem 0.72rem 0.9rem;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  font-size: 0.94rem;
  font-weight: 600;
  font-family: inherit;
  color: #273142;
  background-color: #fff;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(247, 249, 252, 0.92) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235b6472' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m1 1 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, right 0.85rem center;
  background-size: auto, 12px 8px;
  box-shadow: 0 6px 16px rgba(25, 37, 62, 0.08);
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.phone-country:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(25, 37, 62, 0.1);
}

.phone-country:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(90, 69, 184, 0.14);
}

.phone-number {
  flex: 1;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 5px rgba(210, 105, 30, 0.3);
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-light);
  font-size: 0.85rem;
}

.logo-preview {
  width: 100%;
  max-width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  margin: 1rem 0;
  display: none;
}

.submit-btn, .reset-btn {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.submit-btn {
  background: var(--primary-color);
  color: white;
}

.submit-btn.is-loading {
  position: relative;
  cursor: wait;
  opacity: 0.94;
  padding-right: 2.9rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  box-shadow: 0 10px 24px rgba(139, 69, 19, 0.2);
  animation: save-button-pulse 0.9s ease-in-out infinite alternate;
}

.submit-btn.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: save-button-spin 0.72s linear infinite;
}

.submit-btn:hover {
  background: var(--secondary-color);
}

.submit-btn:disabled {
  cursor: not-allowed;
}

.save-feedback {
  margin-top: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.save-feedback.success {
  background: #e9f9ef;
  border: 1px solid #9bd3ac;
  color: #17663a;
}

.save-feedback.error {
  background: #ffecec;
  border: 1px solid #efb4b4;
  color: #9b1c1c;
}

@keyframes save-button-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes save-button-pulse {
  from {
    box-shadow: 0 8px 18px rgba(139, 69, 19, 0.18);
  }

  to {
    box-shadow: 0 14px 28px rgba(210, 105, 30, 0.28);
  }
}

.reset-btn {
  background: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.reset-btn:hover {
  background: var(--border-color);
}

/* Admin Plats List */
.admin-plats-list {
  max-height: 500px;
  overflow-y: auto;
}

.admin-plat-item {
  background: var(--bg-light);
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.admin-plat-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 72px;
  border: 1px solid var(--border-color);
  background: #f1ece4;
}

.admin-plat-info {
  flex: 1;
}

.admin-plat-info h4 {
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.admin-plat-info p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0.1rem 0;
}

.admin-plat-actions {
  display: flex;
  gap: 0.5rem;
}

.edit-btn, .delete-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

.edit-btn {
  background: var(--secondary-color);
  color: white;
}

.edit-btn:hover {
  background: var(--primary-color);
}

.delete-btn {
  background: #ff6b6b;
  color: white;
}

.delete-btn:hover {
  background: #ff5252;
}

/* Admin Redesign (scoped) */
#admin-modal .modal-content.modal-large {
  max-width: 1200px;
  width: min(96vw, 1200px);
  border-radius: 16px;
  border: 1px solid #e7d9c8;
  background: linear-gradient(180deg, #fffdfa 0%, #fff9f2 100%);
}

#admin-modal .modal-header {
  padding: 1.2rem 1.4rem;
  background: linear-gradient(135deg, #fff3e2 0%, #ffe7c8 100%);
  border-bottom: 1px solid #efd9ba;
}

#admin-modal .modal-header h2 {
  margin: 0;
  color: #6f3713;
  letter-spacing: 0.01em;
}

#admin-modal .admin-content {
  padding: 1.2rem;
  gap: 1rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

#admin-modal .admin-user-section,
#admin-modal .admin-orders-section,
#admin-modal .admin-restaurant-section,
#admin-modal .admin-form-section,
#admin-modal .admin-list-section {
  background: #fff;
  border: 1px solid #eadfce;
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(66, 35, 12, 0.08);
}

#admin-modal .admin-user-section {
  grid-column: span 6;
}

#admin-modal .admin-orders-section {
  grid-column: span 6;
}

#admin-modal .admin-restaurant-section {
  grid-column: span 6;
}

#admin-modal .admin-form-section {
  grid-column: span 6;
}

#admin-modal .admin-list-section {
  grid-column: span 6;
}

#admin-modal .admin-user-section h3,
#admin-modal .admin-orders-section h3,
#admin-modal .admin-restaurant-section h3,
#admin-modal .admin-form-section h3,
#admin-modal .admin-list-section h3 {
  margin: 0 0 0.9rem;
  padding-bottom: 0.55rem;
  color: #7a4019;
  border-bottom: 2px solid #ffd49a;
}

#admin-modal .admin-user-section .secondary-btn,
#admin-modal .admin-orders-section .secondary-btn {
  border-radius: 10px;
  border: 1px solid #d9b38f;
  background: #fff7ee;
  color: #7a4019;
  font-weight: 700;
  padding: 0.58rem 0.9rem;
}

#admin-modal .admin-user-section .secondary-btn:hover,
#admin-modal .admin-orders-section .secondary-btn:hover {
  background: #ffedd8;
}

#admin-modal .create-user-form,
#admin-modal .edit-user-form {
  margin-top: 0.7rem;
  border: 1px solid #efdfcc;
  border-radius: 12px;
  padding: 0.85rem;
  background: #fffaf3;
}

#admin-modal .form-group label {
  color: #7a4019;
  font-weight: 700;
}

#admin-modal .form-group input,
#admin-modal .form-group textarea {
  border: 1px solid #e0c9ae;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}

#admin-modal .admin-address-field {
  position: relative;
}

#admin-modal .admin-address-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #e0c9ae;
  border-radius: 10px;
  background: #fffdf9;
  box-shadow: 0 10px 22px rgba(73, 37, 14, 0.16);
  z-index: 20;
}

#admin-modal .admin-address-suggestion-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid #f1e7da;
  background: transparent;
  text-align: left;
  padding: 0.62rem 0.75rem;
  color: #5a3217;
  cursor: pointer;
}

#admin-modal .admin-address-suggestion-item:last-child {
  border-bottom: none;
}

#admin-modal .admin-address-suggestion-item:hover {
  background: #fff3e5;
}

#admin-modal .form-group input:focus,
#admin-modal .form-group textarea:focus {
  border-color: #d6893a;
  box-shadow: 0 0 0 3px rgba(214, 137, 58, 0.18);
}

#admin-modal .user-list {
  margin-top: 0.75rem;
  border: 1px solid #efdfcc;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

#admin-modal .user-item {
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid #f1e7da;
}

#admin-modal .user-item:last-child {
  border-bottom: none;
}

#admin-modal .user-actions button {
  border-radius: 8px;
  padding: 0.35rem 0.68rem;
}

#admin-modal .admin-plats-list {
  border: 1px solid #efdfcc;
  border-radius: 12px;
  padding: 0.7rem;
  background: #fffaf4;
}

#admin-modal .admin-plat-item {
  border: 1px solid #f0e4d4;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 0.65rem;
}

#admin-modal .submit-btn,
#admin-modal .reset-btn,
#admin-modal .cancel-btn {
  border-radius: 10px;
}

/* Login Form */
.login-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.login-form .form-group {
  margin-bottom: 1.5rem;
}

.login-form .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.login-form .form-group input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fafbfc;
}

.login-form .form-group input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(212, 74, 63, 0.1);
  background: white;
  outline: none;
}

.login-form .submit-btn {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, #d44a3f 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  box-shadow: 0 2px 4px rgba(212, 74, 63, 0.2);
}

.login-form .submit-btn:hover {
  background: linear-gradient(135deg, #d44a3f 0%, #b83c32 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(212, 74, 63, 0.3);
}

.login-modal-content {
  max-width: 450px;
  animation: loginSlideIn 0.4s ease-out;
}

@keyframes loginSlideIn {
  from {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.login-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #d44a3f 100%);
  color: white;
  border-bottom: none;
}

.login-header h2 {
  color: white;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.login-header .close-btn {
  color: white;
  font-size: 2rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.login-header .close-btn:hover {
  opacity: 1;
}

/* Delivery Form */
.delivery-modal-content {
  max-width: 600px;
}

.delivery-header {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border-bottom: none;
}

.delivery-header h2 {
  color: white;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.delivery-header .close-btn {
  color: white;
  font-size: 2rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.delivery-header .close-btn:hover {
  opacity: 1;
}

.delivery-form {
  padding: 2rem 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.delivery-form .form-group {
  margin-bottom: 1.5rem;
}

.delivery-form .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.delivery-form .form-group input,
.delivery-form .form-group textarea,
.delivery-form .form-group select {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fafbfc;
}

.delivery-form .form-group input:focus,
.delivery-form .form-group textarea:focus,
.delivery-form .form-group select:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
  background: white;
  outline: none;
}

.delivery-form .form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.delivery-payment-note {
  margin: 0;
  padding: 0.8rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  background: #fafbfc;
  color: var(--text-color);
  font-size: 1rem;
}

.delivery-address-group {
  position: relative;
}

.delivery-address-group::after {
  content: none;
}

#delivery-adresse[readonly] {
  background: #eceff3;
  border-color: #cfd6dd;
  color: #5c6670;
  cursor: not-allowed;
  padding-right: 2.2rem;
}

#delivery-adresse[readonly]:focus {
  border-color: #cfd6dd;
  box-shadow: none;
  background: #eceff3;
}

.delivery-form .form-group select {
  cursor: pointer;
}

.delivery-form .phone-field {
  display: grid;
  grid-template-columns: minmax(104px, 132px) minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
}

.delivery-form .phone-country {
  width: 100%;
  min-width: 0;
}

.delivery-form .phone-number {
  width: 100%;
  min-width: 0;
}

.delivery-address-group .portal-address-suggestions {
  z-index: 120;
}

.order-summary {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.order-summary h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

#order-items {
  margin-bottom: 1rem;
}

#order-items .order-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

#order-items .order-item:last-child {
  border-bottom: none;
}

.order-total {
  text-align: right;
  font-size: 1.2rem;
  color: var(--primary-color);
  padding-top: 1rem;
  border-top: 2px solid var(--border-color);
}

.delivery-submit-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.delivery-submit-btn:hover {
  background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.delivery-submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

/* Checkout Auth Gate Modal */
.checkout-auth-content {
  max-width: 440px;
  width: 90%;
  border-radius: 16px;
  overflow: hidden;
}

.checkout-auth-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: #fff;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkout-auth-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.checkout-auth-header .close-btn {
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

.checkout-auth-header .close-btn:hover {
  background: rgba(255,255,255,0.32);
}

.checkout-auth-body {
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
}

.checkout-auth-message {
  font-size: 1rem;
  color: #4a3728;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.checkout-auth-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.checkout-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.checkout-auth-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.checkout-auth-btn--primary {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.checkout-auth-btn--secondary {
  background: #fff;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkout-auth-hint {
  margin-top: 1.25rem;
  font-size: 0.82rem;
  opacity: 0.6;
  color: #4a3728;
}

.login-info {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.login-info p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.login-info code {
  background: #f1f1f1;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

/* Responsive */
@media (max-width: 1024px) {
  .admin-content {
    grid-template-columns: 1fr;
  }

  #admin-modal .admin-content {
    grid-template-columns: 1fr;
  }

  #admin-modal .admin-user-section,
  #admin-modal .admin-orders-section,
  #admin-modal .admin-restaurant-section,
  #admin-modal .admin-form-section,
  #admin-modal .admin-list-section {
    grid-column: 1 / -1;
  }

  .plats-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    text-align: center;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .portal-back-link {
    align-self: flex-start;
  }

  .header-logo-section {
    flex-direction: column;
    justify-content: center;
  }

  .restaurant-logo {
    width: 70px;
    height: 70px;
  }

  .header-text h1 {
    font-size: 1.5rem;
  }

  .restaurant-title-row {
    justify-content: center;
  }

  .restaurant-city-postal {
    font-size: 0.76rem;
  }

  .portal-address-row {
    justify-content: center;
    max-width: 100%;
  }

  .portal-address-field {
    min-width: 0;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }

  .header-actions .user-info {
    flex-basis: min(92vw, 340px);
    max-width: min(92vw, 340px);
  }

  .orders-preview-banner {
    top: 84px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .filter-section {
    flex-direction: column;
  }

  .category-filter-wrapper {
    gap: 0.35rem;
  }

  .category-scroll-btn {
    flex: 0 0 34px;
    height: 34px;
    font-size: 1rem;
  }

  .search-input,
  .category-filter-bar {
    width: 100%;
  }

  .category-filter-btn {
    padding: 0.68rem 1rem;
    font-size: 0.88rem;
  }

  .plats-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    max-width: 100%;
  }

  .modal-content.modal-large {
    max-width: 100%;
  }
}

/* Orders Modal Styles */
.orders-content {
  padding: 1.5rem;
}

.orders-filter {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.orders-filter label {
  font-weight: bold;
  color: var(--primary-color);
}

.status-filter {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: white;
}

.orders-list {
  max-height: 60vh;
  overflow-y: auto;
}

.orders-day-group {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 1rem;
  overflow: hidden;
}

.orders-day-group summary {
  list-style: none;
  cursor: pointer;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f6eee7;
  color: var(--primary-color);
  font-weight: 700;
}

.orders-day-group summary::-webkit-details-marker {
  display: none;
}

.orders-day-group summary::after {
  content: '▾';
  font-size: 0.9rem;
  margin-left: 0.6rem;
  transition: transform 0.2s ease;
}

.orders-day-group:not([open]) summary::after {
  transform: rotate(-90deg);
}

.day-count {
  min-width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: rgba(139, 69, 19, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.orders-day-content {
  padding: 0.9rem;
}

.admin-order-item {
  background: #fcfcfc;
}

.order-admin-actions {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.order-admin-actions label {
  font-weight: 600;
  color: var(--primary-color);
}

.order-status-select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.order-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fafafa;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.order-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.order-print-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.order-print-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

.order-print-btn:focus-visible {
  outline: 3px solid rgba(139, 69, 19, 0.35);
  outline-offset: 2px;
}

.order-header h4 {
  color: var(--primary-color);
  margin: 0;
}

.order-status {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  text-transform: uppercase;
}

.order-status-control {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
}

.order-status-clickable {
  border: 1px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.order-status-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.order-status-clickable:focus-visible {
  outline: 3px solid rgba(139, 69, 19, 0.35);
  outline-offset: 2px;
}

.order-status-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 69, 19, 0.28);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.14);
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.order-status-control.is-open .order-status-options {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.order-status-option {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.order-status-option.is-current {
  box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.2) inset;
}

.status-confirmé {
  background: #d4edda;
  color: #155724;
}

.status-en-attente-client {
  background: #fff3cd;
  color: #856404;
}

.status-en-traitement {
  background: #fff3cd;
  color: #856404;
}

.status-en-préparation {
  background: #fff3cd;
  color: #856404;
}

.status-annulé {
  background: #f8d7da;
  color: #721c24;
}

.status-livré {
  background: #d1ecf1;
  color: #0c5460;
}

.order-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.order-info p {
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.order-items {
  border-left: 2px solid var(--accent-color);
  padding-left: 1rem;
}

.order-items h5 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.order-items ul {
  list-style: none;
  margin-bottom: 1rem;
}

.order-items li {
  padding: 0.25rem 0;
  border-bottom: 1px solid #eee;
}

.order-total {
  font-size: 1.1rem;
  color: var(--secondary-color);
  text-align: right;
  margin-top: 1rem;
}

.no-orders {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-style: italic;
}

@media (max-width: 768px) {
  .orders-public-body {
    padding: 1rem;
  }

  .public-order-meta {
    grid-template-columns: 1fr;
  }

  .orders-status-heading {
    gap: 0.75rem;
  }

  .order-details {
    grid-template-columns: 1fr;
  }

  .order-admin-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}

.error {
  color: #dc3545;
  text-align: center;
  padding: 1rem;
}

@media (max-width: 768px) {
  .site-footer-inner {
    padding: 0.9rem 0.9rem 1rem;
  }

  .site-footer-links {
    gap: 0.45rem 0.75rem;
  }
}
