@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: #f37021;
  --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 {
  flex-direction: column;
}

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

.public-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--sidebar-bg);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.public-menu .public-menu-top .public-menu-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    transparent 100%
  );
  border-bottom: none;
  z-index: 2;
}

.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: 2rem 2.5rem; */
  overflow: auto;
  max-width: 1400px;
  /* margin: 0 auto; */
  width: 100%;
}

body.public-menu .public-menu-main {
  background: var(--menu-content-bg);
  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: #fff;
}

.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: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

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

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

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

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

.btn-secondary:hover {
  background: #e0d9cf;
}

/* 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;
  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: var(--accent);
}

.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;
}

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

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

.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: #e5e5e7;
}

body.public-menu .menu-search::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

body.public-menu .menu-search:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

.menu-chips-wrap {
  margin-bottom: 1.5rem;
  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;
}

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

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

.menu-chip {
  padding: 0.5rem 1rem;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  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(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e5e5e7;
}

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: var(--menu-content-bg);
  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: #e5e5e7;
}

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

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

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

#panel-menu .menu-chip {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e5e5e7;
}

#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: #e5e5e7;
}

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

#panel-menu .menu-card-price {
  color: var(--accent);
}

#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: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #e5e5e7;
}

#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(4, 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-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(255, 255, 255, 0.6);
}

body.public-menu .menu-pagination .page-btn {
  background: rgba(255, 255, 255, 0.1);
  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 {
  background: var(--card-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.menu-card-img {
  width: 100%;
  height: 80%;
  object-fit: contain;
  background: var(--input-border);
}

.menu-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.menu-card-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-dark);
}

.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-weight: 600;
  color: var(--accent);
  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: #e5e5e7;
}

body.public-menu .menu-card-category {
  color: rgba(255, 255, 255, 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;
  max-height: 85vh;
  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;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--input-border);
  direction: ltr;
}

.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;
  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: 220px;
  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 {
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.menu-detail-name {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--text-dark);
}

.menu-detail-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-dark);
  margin: 0 0 1rem 0;
  white-space: pre-wrap;
}

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

.menu-detail-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.menu-detail-available {
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.menu-detail-available.available {
  background: #d1fae5;
  color: #065f46;
}

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

.menu-detail-category {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  background: var(--input-border);
  border-radius: 6px;
}

.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(2, 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(2, 1fr);
    gap: 0.75rem;
  }

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

  .menu-card-img {
    height: 140px;
  }

  .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;
  }
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(243, 112, 33, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 999;
}
.welcome-overlay h1 {
  font-family: "Readex Pro", sans-serif;
  padding-bottom: 20px;
  font-size: 40px;
}
.welcome-overlay p {
  font-family: "Readex Pro", sans-serif;
  font-size: 25px;
  margin-bottom: 0;
}

.welcome-overlay button {
  font-family: "Readex Pro", sans-serif;
  font-size: 18px;
  font-weight: 600;

  padding: 14px 28px;
  width: 250px;

  border: none;
  border-radius: 30px;

  background-color: rgb(255, 221, 0);
  color: #ffffff;

  margin-top: 100px;
  cursor: pointer;
  transition: 0.3s ease;

  animation: pulse 2s infinite;

  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
}

@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);
  }
}
