@import url("https://fonts.googleapis.com/css2?family=Readex+Pro:wght@200..700&display=swap");
* {
  box-sizing: border-box;
}

:root {
  --sidebar-bg: #22201f;
  --main-bg: #ffffff;
  --menu-content-bg: #1c1c1e;
  --accent: #fecb29;
  --accent-hover: #f37021;
  --yellow-border: #f37021;
  --text-dark: #333333;
  --text-muted: #a0a0a0;
  --card-bg: #ffffff;
  --card-border: #f37021;
  --input-border: #e0e0e0;
  --btn-cancel-bg: #ebe6df;
  --btn-cancel-text: #333;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  direction: rtl;
  min-height: 100vh;
  display: flex;
  color: var(--text-dark);
  background: var(--menu-content-bg);
  width: 100%;
  min-width: 0;
}

#root {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
}

/* Global loading overlay */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--input-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: app-spin 0.8s linear infinite;
}

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

/* Public page splash screen */
.splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity 0.45s ease-out;
}

.splash.splash-out {
  opacity: 0;
  pointer-events: none;
}

.splash-logo {
  max-width: min(280px, 80vw);
  max-height: min(280px, 60vh);
  width: auto;
  height: auto;
  object-fit: contain;
  animation: splash-logo-in 0.7s ease-out;
}

@keyframes splash-logo-in {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Public menu page (base URL) */
body.public-menu {
  background: rgba(255, 248, 246, 1);

  flex-direction: column;
}

.public-menu-top {
  position: relative;
  width: 100%;
}

.public-menu-header {
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  background: rgba(255, 248, 246, 0.8);
  box-shadow: 0px 20px 40px 0px rgba(37, 25, 19, 0.06);
  backdrop-filter: blur(24px);
}

.public-menu-header p {
  width: 193px;
  height: 28px;
  font-family: Epilogue;
  font-weight: 700;
  font-style: Regular;
  font-size: 20px;
  leading-trim: NONE;
  line-height: 28px;
  letter-spacing: -1px;
  vertical-align: middle;
  color: rgba(37, 25, 19, 1);
}

.hero-section {
  /* width: 342px; */
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* padding-right: 24px; */
}
.hero-section img {
  width: 335px;
  height: 118px;
}

.public-menu-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.public-menu-brand .brand-icon {
  margin: 0;
}

.public-menu-dashboard-link {
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.95rem;
}

.public-menu-dashboard-link:hover {
  background: rgba(255, 255, 255, 0.25);
}

.public-menu-main {
  flex: 1;
  /* padding: 0rem 1rem; */
  overflow: auto;
  max-width: 1400px;
  /* margin: 0 auto; */
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

body.public-menu .public-menu-main {
  background: rgba(255, 248, 246, 1);
  color: #e5e5e7;
}

/* Products list header image – full width with soft bottom shadow */
.menu-list-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
}

body.public-menu .menu-list-hero,
.main .menu-list-hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

body.public-menu .menu-list-hero {
  margin-bottom: 0;
}

.main .menu-list-hero {
  margin-bottom: 1.5rem;
}

.menu-list-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0.15),
    transparent
  );
  pointer-events: none;
}

body.public-menu .menu-list-hero::after {
  height: 200px;
  background: linear-gradient(
    to top,
    var(--menu-content-bg) 0%,
    rgba(28, 28, 30, 0.85) 35%,
    rgba(28, 28, 30, 0.3) 65%,
    transparent 100%
  );
}

.menu-list-hero-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2rem 2rem 2.5rem;
  z-index: 1;
  pointer-events: none;
}

.menu-list-hero-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  color: #e6b84d;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.menu-list-hero-subtitle {
  margin: 0;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.menu-list-hero-overlay {
  display: flex;
  align-items: left;
  justify-content: left;
  gap: 1rem;
  flex-wrap: wrap;
}

.menu-list-hero-logo {
  max-height: clamp(48px, 10vw, 72px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
}

.menu-list-hero-img {
  width: 100%;
  display: block;
  max-height: 320px;
  object-fit: cover;
  vertical-align: middle;
}

body.public-menu .menu-list-hero-img {
  max-height: 380px;
}

/* Login screen */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--main-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  direction: rtl;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.login-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  color: var(--text-dark);
  text-align: center;
}

.login-subtitle {
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
}

.login-form .field {
  margin-bottom: 1rem;
}

.login-form .field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.login-form .field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 1rem;
  direction: rtl;
}

.login-form .field input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-form #login-error {
  margin-bottom: 1rem;
}

.login-form .btn-primary {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem 1rem;
}

/* Dashboard layout: sidebar and main side by side on desktop */
.dashboard-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: 100%;
  min-height: 100vh;
  min-width: 0;
}

.dashboard-sidebar-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  display: block;
  max-height: 48px;
  width: auto;
  margin-bottom: 0.5rem;
  object-fit: contain;
}

.brand-name {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
}

.brand-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.sidebar-nav {
  padding: 0.75rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.95rem;
  transition:
    background 0.15s,
    color 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: var(--accent);
  color: #000;
}

.nav-icon {
  font-size: 1.1rem;
  opacity: 0.9;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-logout {
  margin-top: 0.5rem;
  color: var(--text-muted);
}

/* Dashboard mobile header (visible only on small screens) */
.dashboard-mobile-header {
  display: none;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--sidebar-bg);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.dashboard-mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.dashboard-mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Animated hamburger icon (3 lines → X when drawer open) */
.hamburger-btn .hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 24px;
  height: 24px;
}

.hamburger-btn .hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition:
    transform 0.3s ease,
    opacity 0.2s ease;
  transform-origin: center;
}

body.sidebar-open .hamburger-btn .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.sidebar-open .hamburger-btn .hamburger-line:nth-child(2) {
  opacity: 0;
}

body.sidebar-open .hamburger-btn .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.dashboard-mobile-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Main content */
.main {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow: auto;
  min-width: 0;
}

.panel-content {
  max-width: 720px;
}

.page-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem 0;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: white;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem 0;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: rgba(255, 222, 0);
  color: #000000;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: rgb(209, 182, 2);
}

.btn-add {
  margin-bottom: 1.5rem;
}

.btn-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: rgba(255, 222, 0);
  color: var(--btn-cancel-text);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}

.btn-secondary:hover {
  background: rgb(209, 182, 2);
}

/* Form card */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1.25rem 0;
  color: var(--text-dark);
}

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

.dashboard-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dashboard-form .field-full {
  grid-column: 1 / -1;
}

.dashboard-form label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
}

.dashboard-form input[type="text"],
.dashboard-form input[type="number"],
.dashboard-form select,
.dashboard-form textarea {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  direction: rtl;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.dashboard-form input:focus,
.dashboard-form select:focus,
.dashboard-form textarea:focus {
  outline: none;
  border-color: var(--yellow-border);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.25);
}

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

.dashboard-form .file-input {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  max-width: 100%;
}

.dashboard-form .file-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.dashboard-form .form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* Toggle switch */
.toggle-wrap {
  margin-bottom: 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  flex-direction: row;
}

.toggle-text {
  font-size: 0.95rem;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--input-border);
  border-radius: 13px;
  transition: background 0.2s;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.toggle-label:has(input:checked) .toggle-switch {
  background: rgba(255, 222, 0);
}

.toggle-label:has(input:checked) .toggle-switch::after {
  transform: translateX(-22px);
}

/* Error */
.error {
  color: #c00;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  min-height: 1.25em;
}

/* Lists */
.list-wrap {
  margin-top: 1.5rem;
}

.list-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 0.75rem 0;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

li.item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.item .info {
  flex: 1;
  min-width: 120px;
}

.item .actions {
  display: flex;
  gap: 0.5rem;
}

.item .actions button {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  background: var(--input-border);
  color: var(--text-dark);
}

.item .actions button:hover {
  background: #d0d0d0;
}

.item .actions button.edit-category,
.item .actions button.edit-product {
  background: #e8f4fd;
  color: #1565c0;
}

.item .actions button.danger {
  background: #fee2e2;
  color: #991b1b;
}

.item img.thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.item .price {
  font-weight: 600;
  color: #059669;
}

.prices-price-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.prices-input {
  width: 120px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-size: 1rem;
  direction: ltr;
  text-align: right;
}

.item .badge {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #e5e7eb;
  color: #374151;
}

.item .badge.available {
  background: #d1fae5;
  color: #065f46;
}

.item .badge.unavailable {
  background: #fee2e2;
  color: #991b1b;
}

/* Products list: desktop grid layout */
#products-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#products-list .item-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--input-border);
}

#products-list .item-thumb .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#products-list .item-thumb:empty {
  background: rgba(0, 0, 0, 0.06);
}

#products-list .item-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

#products-list .item-name {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
}

#products-list .item-desc {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#products-list .item-desc:empty {
  display: none;
}

#products-list .item-price {
  font-weight: 600;
  color: #059669;
  white-space: nowrap;
}

#products-list .item-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Desktop: aligned columns for product list */
@media (min-width: 900px) {
  #products-list li.item.product-item {
    display: grid;
    grid-template-columns: 56px minmax(140px, 2fr) minmax(90px, 1fr) 90px 140px;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
  }

  #products-list .item-badge {
    justify-self: start;
  }

  #products-list .item-actions {
    justify-content: flex-end;
  }
}

/* Below desktop: products list stacked layout */
@media (max-width: 899px) {
  #products-list li.item.product-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
  }

  #products-list .item-info {
    flex: 1;
    min-width: 120px;
  }

  #products-list .item-desc {
    white-space: normal;
  }
}

/* Menu view (عرض القائمة) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.public-menu .public-menu-main .menu-toolbar {
  margin-top: 0;
}

.menu-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  /* margin-bottom: 1.5rem; */
  align-items: flex-end;
  margin: 0 16px;
}

.menu-toolbar .search-wrap {
  flex: 1;
  min-width: 200px;
}

.menu-search {
  width: 100%;
  height: 56px;
  padding-top: 19px;
  padding-right: 45px;
  padding-bottom: 19px;
  padding-left: 48px;
  border-radius: 9999px;
  background: rgb(252, 228, 148);

  /* padding: 0.6rem 0.75rem;
  border: 1px solid var(--input-border);
  border-radius: 9999px; */
  font-family: Liberation Serif;
  font-weight: 400;
  font-style: Regular;
  font-size: 16px;
  leading-trim: NONE;
  line-height: 100%;
  letter-spacing: 0px;
  vertical-align: middle;
  color: rgba(140, 113, 102, 1);
  direction: rtl;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.menu-search:focus {
  outline: none;
  border-color: var(--yellow-border);
}

body.public-menu .menu-search {
  /* background: rgba(255, 255, 255, 0.08); */
  border-color: rgba(255, 255, 255, 0.2);
  color: #000000;
}

body.public-menu .menu-search::placeholder {
  color: rgba(140, 113, 102, 1);
}

body.public-menu .menu-search:focus {
  /* border-color: var(--accent); */
  background: rgb(255, 225, 125);
}

.menu-chips-wrap {
  /* margin-bottom: 1.5rem; */
  height: 48px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.menu-chips-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-right: 16px;
}

body.public-menu .menu-chips-label {
  color: rgba(255, 255, 255, 0.55);
}

.menu-chips {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
  min-width: min-content;
}

.menu-chip {
  height: 40px;
  border-radius: 999px;

  padding: 10px 24px;
  border: 1px solid var(--input-border);
  background: rgba(246, 221, 212, 1);

  /* background: var(--card-bg); */
  color: var(--text-dark);
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}

.menu-chip:hover {
  border-color: var(--yellow-border);
  background: rgba(255, 209, 102, 0.1);
}

.menu-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.menu-chip.active:hover {
  background: var(--accent-hover);
  color: #fff;
}

body.public-menu .menu-chip {
  background: rgba(246, 221, 212, 1);

  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(89, 66, 56, 1);
}

body.public-menu .menu-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

body.public-menu .menu-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* Dashboard "View Menu" panel: exactly same layout and look as public menu */
.panel-content-menu.panel-content {
  max-width: none;
  width: 100%;
}

#panel-menu {
  background: var(--menu-content-bg);
  color: #e5e5e7;
  padding: 0;
  margin-left: -2.5rem;
  margin-right: -2.5rem;
  margin-bottom: -2rem;
  min-height: 60vh;
}

/* Hero: same as public (full width, no bottom margin, gradient overlay) */
#panel-menu .menu-list-hero {
  margin-bottom: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

#panel-menu .menu-list-hero::after {
  height: 200px;
  background: linear-gradient(
    to top,
    var(--menu-content-bg) 0%,
    rgba(28, 28, 30, 0.85) 35%,
    rgba(28, 28, 30, 0.3) 65%,
    transparent 100%
  );
}

#panel-menu .menu-list-hero-img {
  max-height: 380px;
}

/* Inner main: same width/max-width as public (no padding; grid has its own) */
#panel-menu .public-menu-main {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 2rem;
  background: rgba(255, 248, 246, 1);
  color: #e5e5e7;
}

#panel-menu .menu-toolbar {
  margin-top: 0;
}

#panel-menu .menu-search {
  /* background: rgba(255, 255, 255, 0.08); */
  border-color: rgba(255, 255, 255, 0.2);
  color: #000000;
}

#panel-menu .menu-search::placeholder {
  color: rgba(0, 0, 0, 0.45);
}

#panel-menu .menu-search:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
}

#panel-menu .menu-chips-label {
  color: rgba(255, 255, 255, 0.55);
}

#panel-menu .menu-chip {
  background: rgba(246, 221, 212, 1);

  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(89, 66, 56, 1);
}

/* #panel-menu .menu-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
} */

#panel-menu .menu-chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

#panel-menu .menu-product-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

#panel-menu .menu-product-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#panel-menu .menu-card-name,
#panel-menu .menu-card-desc {
  color: #000000;
}

#panel-menu .menu-card-category {
  color: rgba(0, 0, 0, 0.55);
}

#panel-menu .menu-card-img {
  background: rgba(255, 255, 255, 0.08);
}

#panel-menu .menu-pagination .page-info {
  color: rgba(255, 255, 255, 0.6);
}

#panel-menu .menu-pagination .page-btn {
  background: rgb(0, 0, 0);
  border-color: rgba(255, 255, 255, 0.25);
  color: #000000;
}

#panel-menu .menu-pagination .page-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Grid: same as public (padding already on .menu-products) */
#panel-menu .menu-products {
  padding: 0 1rem;
}

.menu-products {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  padding: 0 1rem;
}

.menu-pagination {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.menu-pagination .page-btn {
  min-width: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--input-border);
  background: var(--card-bg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.menu-pagination .page-btn:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.menu-footer {
  height: 100px;
  margin: 2rem 1rem 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.menu-footer-text {
  font-size: 1.5rem;
  color: rgba(0, 0, 0, 0.75);
}

.menu-footer-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.menu-footer-link {
  font-size: 1.5rem;
  color: #000000;
  text-decoration: none;
  font-weight: 600;
  text-decoration: underline;
}

.menu-pagination .page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.menu-pagination .page-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.menu-pagination .page-info {
  margin: 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted, #666);
}

body.public-menu .menu-pagination .page-info {
  color: rgba(0, 0, 0, 0.6);
}

body.public-menu .menu-pagination .page-btn {
  background: rgb(0, 0, 0);
  border-color: rgba(255, 255, 255, 0.25);
  color: #e5e5e7;
}

body.public-menu .menu-pagination .page-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.menu-product-card {
  height: 248px;
  width: 163px;
  background: var(--card-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.menu-card-img {
  width: 163px;
  height: 163px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.menu-card-body {
  background: rgba(255, 241, 236, 1);

  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 30%;
}

.menu-card-name {
  font-family: "Readex Pro", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: rgba(37, 25, 19, 1);
}

.menu-card-category {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.menu-card-desc {
  font-size: 0.9rem;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-card-price {
  font-family: "Readex Pro", sans-serif;
  font-weight: 700;
  font-style: Bold;
  font-size: 14px;
  leading-trim: NONE;
  line-height: 20px;
  letter-spacing: 0px;
  vertical-align: middle;
  color: rgba(0, 0, 0);
  margin-top: 0.25rem;
}

.menu-product-card:hover {
  border-color: var(--yellow-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

body.public-menu .menu-product-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

body.public-menu .menu-product-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.public-menu .menu-card-name,
body.public-menu .menu-card-desc {
  color: #000000;
}

body.public-menu .menu-card-category {
  color: rgba(0, 0, 0, 0.55);
}

/* Product detail – bottom sheet */
.menu-product-detail {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.menu-product-detail[aria-hidden="false"],
.menu-product-detail.is-open {
  pointer-events: auto;
}

.menu-product-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.menu-product-detail.is-open .menu-product-detail-backdrop {
  opacity: 1;
}

.menu-product-detail-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: var(--card-bg);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.menu-product-detail.is-open .menu-product-detail-sheet {
  transform: translateY(0);
}

.menu-product-detail-close {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.menu-product-detail-close:hover {
  background: #fff;
}

.menu-product-detail-header {
  position: relative;
  flex-shrink: 0;
  /* height: 220px; */
  height: 400ox;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: #000000;
  direction: ltr;
  display: flex;
  justify-content: center;
  align-items: center;
}

.menu-detail-gallery-dots {
  position: absolute;
  bottom: 0.5rem;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.25rem 0;
  pointer-events: none;
}

.menu-detail-gallery-dots.is-hidden {
  display: none;
}

.menu-detail-gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transition: background 0.2s ease;
}

.menu-detail-gallery-dot.is-active {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.menu-detail-gallery-strip {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  min-height: 100%;
  padding: 0;
  width: 100%;
  position: relative;
  z-index: 1;
}

.menu-detail-gallery-strip .menu-detail-gallery-img {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  border: none;
}

.menu-detail-no-photos {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin: 0;
  padding: 2rem;
}

.menu-product-detail-body {
  background: #ffffff;
  margin-top: -24px; /* يطلع فوق الصورة شوي */
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 24px;
  position: relative;
  z-index: 2;

  /* ظل ناعم لفصل أنيق */
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
  border-top: 1px solid #f1f1f1;
}

.menu-product-detail-body > div:first-child {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem !important;
  margin-bottom: 0.9rem;
}

.menu-detail-name {
  font-family: "Readex Pro", sans-serif;
  font-weight: 800;
  font-style: Regular;
  font-size: 30px;
  leading-trim: NONE;
  line-height: 37.5px;
  letter-spacing: -1.5px;
  vertical-align: middle;

  margin: 0 0 0.5rem 0;
  color: var(--text-dark);
  font-size: clamp(2rem, 5.8vw, 2.9rem);
  line-height: 1.03;
  letter-spacing: -1.2px;
}

.menu-detail-description {
  font-family: "Readex Pro", sans-serif;
  font-weight: 400;
  font-style: Regular;
  font-size: 14px;
  leading-trim: NONE;
  line-height: 22.75px;
  letter-spacing: 0px;
  vertical-align: middle;

  color: var(--text-dark);
  margin: 0 0 1.25rem 0;
  white-space: pre-wrap;
  font-size: 1.08rem;
  line-height: 1.8;
  color: #5b514c;
}

.menu-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
}

.menu-detail-meta::before {
  content: "الأحجام";
  display: block;
  width: 100%;
  margin-bottom: 0.35rem;
  color: #3b302b;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.menu-detail-meta-card {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  min-height: unset;
  padding: 4px 0 2px;
}

.menu-detail-price {
  width: 106px;
  min-width: 106px;
  height: 83px;
  padding: 10px 8px 12px;
  background: #fff3ee;
  text-align: center;
  border-radius: 12px;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
width: 106;
height: 83;

.menu-detail-price:first-child {
  border-color: #d6692e;
  background: #fff8f3;
}

.menu-detail-price p {
  font-family: "Readex Pro", sans-serif;
  font-weight: 700;
  font-style: Regular;
  font-size: 10px;
  leading-trim: NONE;
  line-height: 15px;
  letter-spacing: 1px;
  text-align: center;
  vertical-align: middle;
  text-transform: uppercase;
  color: rgba(89, 66, 56, 1);
  margin: 0 0 4px;
}
.menu-detail-price span {
  font-family: "Readex Pro", sans-serif;
  font-weight: 700;
  font-style: Regular;
  font-size: 18px;
  leading-trim: NONE;
  line-height: 28px;
  letter-spacing: 0px;
  text-align: center;
  vertical-align: middle;
  color: rgba(37, 25, 19, 1);
}
.menu-detail-available {
  min-height: 28px;
  width: auto;
  min-width: 112px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 10px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.menu-detail-available.available {
  background: rgba(209, 250, 229, 1);
  color: #065f46;
}

.menu-detail-available.unavailable {
  background: #fee2e2;
  color: #991b1b;
}

.menu-detail-category {
  width: auto;
  min-width: 112px;
  min-height: 28px;
  text-align: center;
  font-size: 10px;
  color: rgba(105, 64, 0, 1);
  padding: 6px 12px;
  background: rgba(254, 165, 32, 1);
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.menu-detail-gallery-img {
  display: block;
}

.menu-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

@media (max-width: 900px) {
  .menu-products {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tablet: sidebar becomes overlay drawer, mobile header visible, full-width adaptive layout */
@media (max-width: 768px) {
  body:not(.public-menu) {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-layout {
    flex-direction: column;
  }

  .dashboard-sidebar-wrap {
    min-height: 0;
  }

  .dashboard-mobile-header {
    display: flex;
    flex-shrink: 0;
    width: 100%;
    min-width: 0;
  }

  .sidebar-backdrop {
    display: block;
    pointer-events: none;
  }

  body.sidebar-open .sidebar-backdrop {
    pointer-events: auto;
    opacity: 1;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 85vw);
    min-height: 100vh;
    z-index: 901;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 1rem 1rem 2rem;
    overflow-x: hidden;
  }

  #panel-menu {
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: -2rem;
  }

  .panel-content {
    max-width: 100%;
    width: 100%;
  }

  .menu-toolbar .search-wrap {
    min-width: 0;
    flex: 1;
  }

  .menu-search {
    width: 100%;
    box-sizing: border-box;
  }

  .dashboard-form .form-row {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .btn-add,
  .btn-primary,
  .btn-secondary {
    min-height: 44px;
    padding: 0.7rem 1rem;
  }

  .form-actions .btn-primary,
  .form-actions .btn-secondary {
    min-height: 44px;
    flex: 1;
    min-width: 0;
  }

  li.item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }

  .item .info {
    min-width: 0;
  }

  .item .actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .item .actions button {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }

  .menu-products {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .menu-product-card {
    border-radius: 10px;
  }

  .menu-card-img {
    height: 85%;
  }

  .menu-card-body {
    padding: 0.75rem;
  }

  .menu-card-name {
    font-size: 1rem;
  }

  .menu-detail-sheet {
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
  }
}

/* Mobile: single column products, tighter spacing */
@media (max-width: 640px) {
  .main {
    padding: 0.75rem 0.75rem 1.5rem;
  }

  .menu-list-hero-img {
    object-fit: fill;
  }

  #panel-menu {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    margin-bottom: -1.5rem;
  }

  .menu-products {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .menu-toolbar .search-wrap {
    min-width: 0;
  }

  .menu-chips {
    padding-bottom: 0.25rem;
  }

  .menu-chip {
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  .list-title {
    font-size: 0.95rem;
  }

  .form-card {
    padding: 1.25rem;
  }

  .form-card-title {
    font-size: 1rem;
  }
}

/* Small mobile: product detail full height */
@media (max-width: 480px) {
  .menu-detail-sheet {
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .menu-detail-gallery-strip {
    min-height: 200px;
  }

  .login-card {
    margin: 1rem;
    padding: 1.5rem;
  }
  .menu-card-price {
    font-size: 80%;
  }
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  /* background: linear-gradient(180deg, #fff8f6 0%, #fff1ec 100%); */
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 999;
}
.welcome-overlay img {
  width: 225px;
  height: 192px;
}
.welcome-overlay h1 {
  width: 342px;
  height: 96px;
  padding: 0 28px;
  font-family: "Readex Pro", sans-serif;
  font-weight: 900;
  font-style: Regular;
  font-size: 48px;
  leading-trim: NONE;
  line-height: 48px;
  letter-spacing: -2.4px;
  text-align: center;
  vertical-align: middle;
  color: rgb(255, 255, 255);
}
.welcome-overlay p {
  width: 220px;
  font-family: "Readex Pro", sans-serif;
  font-weight: 600;
  font-style: Regular;
  font-size: 21px;
  leading-trim: NONE;
  line-height: 28px;
  letter-spacing: 2.4px;
  text-align: center;
  vertical-align: middle;
  text-transform: uppercase;
  color: rgb(255, 255, 255);
}
.welcome-overlay div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.welcome-overlay button {
  width: 234px;
  height: 68px;
  border: none;
  border-radius: 9999px;
  padding: 20px 48px;
  background: linear-gradient(135deg, #fecb29 0%, #cda41f 100%);
  box-shadow: 0px 20px 40px 0px rgba(158, 61, 0, 0.15);

  font-family: "Readex Pro", sans-serif;
  font-weight: 700;
  font-style: Regular;
  font-size: 15px;
  leading-trim: NONE;
  line-height: 28px;
  letter-spacing: -0.45px;
  text-align: center;
  vertical-align: middle;

  color: rgba(255, 255, 255, 1);
  margin-top: 100px;
  /* 
  cursor: pointer;
  transition: 0.3s ease;

  animation: pulse 2s infinite; */
}

/* @keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 222, 0, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 222, 0, 0.9);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 222, 0, 0.7);
  }
} */

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #ccc;
  border-top: 3px solid #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

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