/* ========================================
   رستوران ایتالیایی رومانو - Restaurant Menu Styles
   Mobile-first | RTL | Premium
   ======================================== */

:root {
  --cream: #FDF8F0;
  --cream-dark: #F5EDE0;
  --black: #1A1A1A;
  --gold: #CC0000;
  --gold-light: #FF3333;
  --gold-dark: #990000;
  --white: #FFFFFF;
  --gray: #888888;
  --gray-light: #CCCCCC;
  --gray-bg: #F0EBE3;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --header-h: 56px;
  --nav-h: 50px;
  --font: 'Vazirmatn', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--black);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
}

.menu-card, .category-tab, .hero-cta, .hero-burger, .particle {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ========================================
   HEADER
   ======================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: #000000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), height 0.3s ease;
}

.site-header.visible {
  opacity: 1;
  transform: translateY(0);
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.site-header.scrolled {
  height: 48px;
}

.header-inner {
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo-icon {
  font-size: 22px;
  line-height: 1;
}

.logo-text {
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.5px;
}

.logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.header-subtitle {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  line-height: 1.2;
}

/* ========================================
   CATEGORY NAV
   ======================================== */

.category-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 72px;
  background: rgba(0, 0, 0, 0.95);
  border-left: 1px solid rgba(255,255,255,0.06);
  box-shadow: -2px 0 12px rgba(0,0,0,0.15);
  z-index: 99;
  transform: translateX(100%); /* Start hidden in CSS to prevent loading flash */
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.category-nav:not(.header-hidden) {
  transform: translateX(0); /* Slide in when not hidden */
}

.category-nav.header-hidden {
  transform: translateX(100%); /* Slide out to the right */
}

.category-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--header-h) 0 80px 0;
  height: 100%;
  align-items: stretch;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-nav-inner::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 72px; /* Perfect square matching sidebar width */
  padding: 8px 4px;
  border-radius: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.category-tab:last-child {
  border-bottom: none;
}

.category-tab .tab-icon {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.category-tab .tab-icon svg {
  width: 100%;
  height: 100%;
  color: inherit;
  display: block;
}

.category-tab .tab-label {
  font-size: 10.5px;
  font-weight: 700;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.category-tab.active {
  background: var(--gold);
  color: var(--white);
  font-weight: 800;
  border-bottom-color: var(--gold);
}

/* ========================================
   HERO - Premium Dark
   ======================================== */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 48px 28px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(204, 0, 0, 0.07) 0%, transparent 60%),
    linear-gradient(180deg, #2D1A0A 0%, #1A0F08 100%);
}

/* -------- Hero Image -------- */

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroFadeIn 0.8s ease both;
}

/* -------- CTA Button -------- */

.hero-cta {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 38px;
  border-radius: 50px;
  border: 2px solid #fff;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #FF3333, #CC0000);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(204, 0, 0, 0.35);
  transition: transform 0.2s ease, filter 0.2s ease;
  animation: heroFadeIn 0.7s ease both 0.7s;
}

.hero-cta:active {
  transform: scale(0.92) translateY(2px);
  filter: brightness(0.85);
}

/* -------- Entrance Animations -------- */

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   MENU CONTAINER
   ======================================== */

.menu-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 84px 40px 16px;
}

/* ========================================
   SECTION HEADER
   ======================================== */

.menu-section {
  padding-top: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.section-icon {
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}

.section-icon svg {
  width: 100%;
  height: 100%;
  color: var(--gold);
  display: block;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--black);
  white-space: nowrap;
}

.section-divider {
  flex: 1;
  height: 1px;
  position: relative;
}

.section-divider span {
  display: block;
  height: 2px;
  width: 100%;
  background: linear-gradient(to left, var(--gold), transparent);
  border-radius: 2px;
}

/* ========================================
   MENU CARDS
   ======================================== */

.items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease;
  min-height: 100px;
}

.menu-card:active {
  transform: scale(0.99);
}

.card-image {
  width: 90px;
  height: 90px;
  min-width: 90px;
  border-radius: 10px;
  margin: 10px;
  overflow: hidden;
  position: relative;
  align-self: center;
}

.card-unavailable-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 5px;
  z-index: 2;
}

.price-unavailable {
  text-decoration: line-through;
  opacity: 0.5;
}

.item-overlay-unavailable {
  display: inline-block;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 24px;
  border-radius: 6px;
  margin: 16px auto;
  text-align: center;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.card-image img.loaded {
  opacity: 1;
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  position: absolute;
  inset: 0;
}

.card-image-placeholder svg {
  width: 38px;
  height: 38px;
  color: var(--white);
  display: block;
}

.card-body {
  flex: 1;
  padding: 12px 4px 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 6px;
}

.card-name {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.4;
}

.card-ingredients {
  font-size: 12.5px;
  color: #555555;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-pricing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 85px;
  padding: 12px 8px;
  background: linear-gradient(to bottom, rgba(204, 0, 0, 0.06), transparent);
  border-right: 1px solid rgba(204, 0, 0, 0.1);
  position: relative;
}

.price-value {
  font-size: 17.5px;
  font-weight: 800;
  color: var(--gold-dark);
  line-height: 1.2;
  text-align: center;
}

.price-currency {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  margin-top: 2px;
}

/* -------- Variant Pricing in Card -------- */
.card-pricing-variants {
  gap: 6px;
  padding: 10px 8px;
}

.card-variant-row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  font-size: 13px;
  line-height: 1.2;
}

.variant-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray);
  min-width: 36px;
  text-align: left;
}

.variant-price-value {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--gold-dark);
  direction: ltr;
}

.variant-currency {
  font-size: 10px;
  color: var(--gold);
  font-weight: 500;
}

.note-add-variant {
  margin-top: 4px;
}

/* ========================================
   CARD MODE (1-column square)
   ======================================== */

body.layout-card .items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.layout-card .menu-card {
  flex-direction: column;
  min-height: 0;
}

body.layout-card .card-image {
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 0;
  align-self: stretch;
}

body.layout-card .card-image img,
body.layout-card .card-image-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

body.layout-card .card-image-placeholder {
  font-size: 48px;
}

body.layout-card .card-image-placeholder svg {
  width: 56px;
  height: 56px;
}

body.layout-card .card-body {
  padding: 12px 14px 8px;
  text-align: center;
  gap: 6px;
  border-bottom: 1px solid rgba(204, 0, 0, 0.08);
}

body.layout-card .card-name {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.layout-card .card-ingredients {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  color: #555555;
}

body.layout-card .card-pricing {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  min-width: 0;
  padding: 10px 14px;
  gap: 6px;
  background: none;
  border-right: none;
}

body.layout-card .card-pricing .price-value {
  font-size: 17.5px;
}

body.layout-card .card-pricing .price-currency {
  font-size: 11px;
}

body.layout-card .note-add {
  margin-right: 4px;
  margin-top: 0;
}

body.layout-card .card-pricing-variants {
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px 12px;
  align-items: stretch;
  border-right: none;
}

body.layout-card .card-variant-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  font-size: 13px;
}

.variant-row-spacer {
  flex: 1;
}

body.layout-card .variant-label {
  min-width: unset;
  width: 60px;
  text-align: right;
  font-size: 11px;
}

body.layout-card .variant-price-value {
  font-size: 17.5px;
}

body.layout-card .note-add-variant {
  margin-top: 0;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
  text-align: center;
  padding: 24px 88px 32px 16px;
  font-size: 12px;
  color: var(--gray-light);
  border-top: 1px solid rgba(0,0,0,0.04);
}

.footer-copyright {
  margin-top: 6px;
  font-size: 11px;
  color: var(--gray);
}

.footer-link {
  color: #CC0000;
  text-decoration: underline;
  font-weight: 600;
}

.footer-link:hover {
  color: #990000;
}



/* ========================================
   ITEM DETAIL OVERLAY
   ======================================== */

.item-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.item-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.item-overlay-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  background: var(--white);
  border-radius: 20px;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.item-overlay.open .item-overlay-content {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* -------- Close Button -------- */

.item-overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 14px;
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.item-overlay-close:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 1);
}

/* -------- Image Area (55%) -------- */

.item-overlay-image {
  flex-shrink: 0;
  max-height: 40vh;
  overflow: hidden;
  position: relative;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.item-overlay-image .overlay-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
}

/* -------- Details Area (45%) -------- */

.item-overlay-details {
  flex-shrink: 0;
  padding: 24px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  direction: rtl;
}

.item-overlay-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--black);
  line-height: 1.3;
}

.item-overlay-divider {
  border-top: 1px solid rgba(204, 0, 0, 0.12);
  margin: 4px 0 0;
}

.item-overlay-ingredients-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 1px;
  margin-top: 2px;
  text-align: right;
}

.item-overlay-ingredients {
  font-size: 15px;
  color: var(--gray);
  line-height: 1.5;
  margin: 0;
  text-align: right;
}

.item-overlay-price {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(204, 0, 0, 0.12);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.item-overlay-price .price-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold-dark);
}

.item-overlay-price .price-currency {
  font-size: 14px;
  color: var(--gold);
  font-weight: 500;
}

/* -------- Body scroll lock -------- */

body.overlay-open {
  overflow: hidden;
}

body.note-open {
  overflow: hidden;
}

/* ========================================
   ADMIN PANEL STYLES
   ======================================== */

body.admin-body {
  padding-top: 0;
  background: #f5f3ef;
  direction: rtl;
  font-family: var(--font);
  padding-bottom: 80px;
  -webkit-user-select: none;
  user-select: none;
}

body.admin-body.scroll-lock {
  overflow: hidden;
}

/* ----- Admin Header ----- */
.admin-header {
  background: var(--black);
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 56px;
  position: relative;
}

.admin-header h1 {
  font-size: 15px;
  font-weight: 700;
}

.admin-header-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  height: 48px;
  width: auto;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user {
  font-size: 12px;
  opacity: 0.6;
}

.admin-logout {
  color: var(--gold-light);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
}

/* ----- Admin Login ----- */
.admin-login-wrapper {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-login-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.admin-login-box h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.admin-login-box p {
  color: var(--gray);
  font-size: 13px;
  margin-bottom: 24px;
}

/* ----- Form Controls ----- */
.admin-form-group {
  margin-bottom: 16px;
  text-align: right;
}

.admin-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 6px;
}

.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font);
  direction: rtl;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--cream);
  -webkit-appearance: none;
  appearance: none;
}

.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.12);
}

.admin-form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.admin-form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-form-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--cream);
  border-radius: 10px;
  border: 1.5px solid #eee;
}

.admin-form-toggle label:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
}

.admin-image-preview {
  margin-top: 8px;
}

.admin-image-preview img {
  max-width: 120px;
  border-radius: 8px;
  border: 1px solid #eee;
}

.admin-image-preview p {
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  font-family: var(--font);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
  gap: 8px;
  flex: 1;
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
  border: none;
}

.btn-primary:active {
  background: var(--gold-dark);
  transform: scale(0.97);
}

.btn-danger {
  background: #dc3545;
  color: var(--white);
  border: none;
}

.btn-danger:active {
  background: #c82333;
}

.btn-secondary {
  background: var(--gray-bg);
  color: var(--black);
  border: none;
}

.btn-secondary:active {
  background: #ddd;
}

.btn-block {
  width: 100%;
}

/* ----- Dashboard Layout ----- */
.admin-dashboard {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 8px 0;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 0 14px;
  margin-bottom: 20px;
  transition: border-color 0.15s;
}

.admin-search:focus-within {
  border-color: var(--gold);
}

.admin-search svg {
  flex-shrink: 0;
  color: var(--gray-light);
}

.admin-search-input {
  flex: 1;
  height: 44px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  color: var(--black);
}

.admin-search-input::placeholder {
  color: var(--gray-light);
}

.admin-search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  background: var(--gray-bg);
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: var(--gray);
  flex-shrink: 0;
}

.admin-section {
  margin-bottom: 24px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.admin-section-header h2 {
  font-size: 17px;
  font-weight: 800;
}

.admin-count {
  font-size: 12px;
  color: var(--gray);
  background: var(--gray-bg);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.admin-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--gray);
  font-size: 13px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ----- Category Group Label ----- */
.admin-category-group {
  margin-bottom: 12px;
}

.admin-category-label {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 4px 6px;
  color: var(--gray);
}

/* ----- Admin List (card-style) ----- */
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.15s;
  min-height: 52px;
  cursor: pointer;
}

.admin-item:active {
  transform: scale(0.99);
}

.admin-item-body {
  cursor: pointer;
}

.admin-item-drag {
  font-size: 18px;
  color: #ccc;
  cursor: grab;
  padding: 4px;
  line-height: 1;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.admin-item-drag:active {
  cursor: grabbing;
}

.admin-item-body {
  flex: 1;
  min-width: 0;
}

.admin-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-item-icon {
  font-size: 22px;
  line-height: 1;
}

.admin-label-icon-svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-left: 4px;
}

.admin-item-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--gray-bg);
}

.admin-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-item-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-item-price {
  font-size: 11px;
  color: var(--gray);
}

.admin-item-toggles {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-toggle-label {
  font-size: 12px;
  color: var(--gray);
  user-select: none;
}

.admin-btn-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border: 1.5px solid var(--gold);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-dark);
  transition: all 0.18s;
  white-space: nowrap;
  font-family: inherit;
}

.admin-btn-price:hover {
  background: var(--gold);
  color: #fff;
}

.admin-btn-price:active {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: #fff;
}

.admin-item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.admin-btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.admin-btn-icon:active {
  background: rgba(0,0,0,0.05);
}

.admin-btn-danger:active {
  background: rgba(220,53,69,0.1);
}

.admin-item-ghost {
  opacity: 0.4;
  background: #eee;
}

/* ----- Item States ----- */
.admin-item-unavailable {
  border-right: 3px solid #dc3545;
}

.admin-item-hidden {
  opacity: 0.65;
}

/* ----- Badges ----- */
.admin-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

.admin-badge-danger {
  background: #fef2f2;
  color: #dc2626;
}

.admin-badge-ghost {
  background: #f0f0f0;
  color: #888;
}

/* ----- Toggle Switch ----- */
.admin-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
  cursor: pointer;
}

.admin-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-switch-slider {
  position: absolute;
  inset: 0;
  background: #ddd;
  border-radius: 24px;
  transition: background 0.2s;
}

.admin-switch-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.admin-switch input:checked + .admin-switch-slider {
  background: #22c55e;
}

.admin-switch input:checked + .admin-switch-slider::before {
  transform: translateX(16px);
}

.admin-switch-ghost.admin-switch-slider {
  background: #ddd;
}

.admin-switch input:checked + .admin-switch-ghost {
  background: #a0a0a0;
}

/* ----- Modal ----- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  overscroll-behavior: contain;
}

@media (min-width: 500px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.modal-overlay.open {
  display: flex;
}

#itemPrice {
  direction: ltr;
  text-align: left;
}

.modal-content {
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 20px 24px 32px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.12);
  animation: modalSlideUp 0.3s ease;
}

@media (min-width: 500px) {
  .modal-content {
    border-radius: 20px;
    animation: modalIn 0.25s ease;
  }
}

@keyframes modalSlideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--gray-bg);
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  color: var(--gray);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-bg);
}

.modal-actions .btn {
  flex: 1;
  padding: 14px;
}

/* ----- Toast ----- */
.admin-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  width: 90%;
  max-width: 400px;
  display: none;
}

.msg {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.msg-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.msg-success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* Inline icon + name (legacy) */
.cat-icon-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.cat-icon-name .icon {
  font-size: 18px;
}

/* Sort badge (legacy) */
.sort-badge {
  display: inline-block;
  background: var(--gray-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--gray);
}

/* Image preview (legacy) */
.img-preview {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--gray-bg);
}

/* ========================================
   ORDER NOTE FAB + PANEL
   ======================================== */

/* --- Add button inside card --- */
.note-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold-dark);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}
.note-add:active {
  background: var(--gold);
  color: #fff;
}

.note-add svg {
  display: block;
}

/* --- Add button inside item overlay --- */
.overlay-note-add {
  margin-top: 12px;
  padding: 10px 20px;
  border-radius: 24px;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold-dark);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}
.overlay-note-add:active {
  background: var(--gold);
  color: #fff;
}

.overlay-note-add svg {
  display: block;
}

/* --- Loading-spin animation (overlay button only) --- */
@keyframes spinLoading {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.overlay-note-add.is-adding svg {
  animation: spinLoading 0.6s linear infinite;
}

/* --- Floating action button --- */
.note-fab {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 16px;
  z-index: 90;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: linear-gradient(135deg, #CC0000, #990000);
  color: #fff;
  box-shadow: 0 4px 20px rgba(153, 0, 0, 0.55), 0 0 0 3px rgba(204, 0, 0, 0.25);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}
.note-fab.show {
  display: flex;
}
.note-fab:active {
  transform: scale(0.9);
}
.note-fab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.note-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* --- Backdrop --- */
.note-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.note-overlay.open {
  opacity: 1;
  visibility: visible;
}

.note-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 400;
  background: var(--black);
  color: var(--white);
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.note-toast.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Bottom sheet panel --- */
.note-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 111;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-width: 480px;
  margin: 0 auto;
}
.note-panel.open {
  transform: translateY(0);
}
.note-panel-inner {
  background: var(--white);
  border-radius: 16px 16px 0 0;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
}
.note-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}
.note-panel-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--black);
}
.note-panel-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--gray-bg);
  color: var(--gray);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.note-panel-close:active {
  background: var(--gray-light);
}
.note-ack {
  font-size: 11px;
  color: var(--gray-light);
  padding: 6px 20px 10px;
  line-height: 1.4;
}

/* --- List --- */
.note-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
  -webkit-overflow-scrolling: touch;
}
.note-empty {
  text-align: center;
  padding: 24px 0;
  font-size: 13px;
  color: var(--gray-light);
}

/* --- Item row --- */
.note-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-bg);
}
.note-item:last-child {
  border-bottom: none;
}
.note-item-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.note-item-icon svg {
  width: 20px;
  height: 20px;
  display: block;
  color: var(--gold);
}
.note-item-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

/* --- Quantity controls --- */
.note-qty-group {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.note-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}
.note-qty-btn.minus {
  background: var(--gray-bg);
  color: var(--gray);
}
.note-qty-btn.plus {
  background: rgba(204, 0, 0, 0.12);
  color: var(--gold-dark);
}
.note-qty-btn:active {
  opacity: 0.6;
}
.note-qty-value {
  width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
}

/* --- Remove button --- */
.note-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--gray-light);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
}
.note-remove:active {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

/* ========================================
   SIZE PICKER POPOVER
   ======================================== */

.size-picker-popover {
  position: fixed;
  z-index: 200;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
  min-width: 200px;
  max-width: 240px;
  overflow: hidden;
  animation: popoverIn 0.2s ease;
}

@keyframes popoverIn {
  from { opacity: 0; transform: translateY(6px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.size-picker-arrow {
  display: none;
}

.size-picker-body {
  display: flex;
  flex-direction: column;
}

.size-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  font-family: var(--font);
  cursor: pointer;
  text-align: right;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--gray-bg);
}

.size-picker-option:last-child {
  border-bottom: none;
}

.size-picker-option:active {
  background: var(--cream-dark);
}

.spo-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
}

.spo-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-dark);
  direction: ltr;
}

.spo-currency {
  font-size: 9px;
  color: var(--gold);
  font-weight: 500;
}

/* ========================================
   OVERLAY VARIANT PILLS
   ======================================== */

.overlay-variant-section {
  margin: 12px 0 8px;
}

.overlay-variant-pills {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.variant-pill {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold-dark);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.variant-pill:active {
  transform: scale(0.95);
}

.variant-pill.active {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(204, 0, 0, 0.3);
}

/* ========================================
   ADMIN VARIANT SECTION
   ======================================== */

.admin-variant-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-bg);
}

.admin-variant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.admin-variant-header label {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
}

.admin-variant-hint {
  font-size: 11px;
  color: var(--gray-light);
  margin-bottom: 12px;
  line-height: 1.4;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.variant-row {
  margin-bottom: 8px;
}

.variant-row-inner {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  background: var(--cream);
  border-radius: 10px;
  padding: 8px;
  border: 1px solid rgba(204, 0, 0, 0.1);
}

.variant-field {
  flex: 1;
  min-width: 0;
}

.variant-field input,
.variant-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font);
  direction: rtl;
  transition: border-color 0.2s;
  background: var(--white);
}

.variant-field input:focus,
.variant-field textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.variant-field-price {
  max-width: 100px;
  flex-shrink: 0;
}

.variant-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--gray-light);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.variant-remove:active {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

/* ========================================
   ADMIN ICON GRID SELECTOR
   ======================================== */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
  background: var(--cream);
  padding: 10px;
  border-radius: 12px;
  border: 1.5px solid #ddd;
  max-height: 200px;
  overflow-y: auto;
}

.icon-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px;
  background: var(--white);
  border-radius: 10px;
  border: 1.5px solid #eee;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--black);
}

.icon-grid-item:active {
  transform: scale(0.95);
}

.icon-grid-item.selected {
  border-color: var(--gold);
  background: rgba(204, 0, 0, 0.08);
  color: var(--gold-dark);
}

.icon-grid-item .icon-svg {
  width: 24px;
  height: 24px;
  color: inherit;
  display: block;
}

.icon-grid-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--black);
  text-align: center;
}

.icon-grid-item.selected .icon-grid-label {
  color: var(--gold-dark);
}
