@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Regular.e8e9648f5b8f.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Medium.24d05392e628.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-SemiBold.a11a0c156bba.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Bold.4ac4426bc38f.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-ExtraBold.891f7f4608b4.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --brown: #2c1d0c;
  --brown-burnt: #1a1008;
  --brown-deep: #0d0905;
  --brown-lift: #3f2c14;
  --red: #a30000;
  --red-deep: #6a0000;
  --red-soft: #d46a6a;
  --green: #8fbe6c;
  --green-deep: #5e8643;
  --cream: #fff3df;
  --cream-muted: rgba(255, 243, 223, 0.58);
  --cream-faint: rgba(255, 243, 223, 0.44);
  --cream-soft: rgba(255, 243, 223, 0.74);
  --cream-dim: rgba(255, 243, 223, 0.38);
  --price-gold: #ffd166;
  --price-amber: #f5b942;
  --price-deep: #e08918;
  --price-unit: rgba(245, 185, 66, 0.78);
  --chevron: rgba(143, 190, 108, 0.78);
  --glass: rgba(255, 248, 236, 0.055);
  --glass-strong: rgba(255, 248, 236, 0.09);
  --glass-border: rgba(255, 230, 190, 0.14);
  --glass-border-strong: rgba(255, 230, 190, 0.22);
  --unavailable-text: #8a7b70;
  --unavailable-dot: #5c4e45;
  --unavailable-label: #b5a89a;
  --image-fallback: #2a211c;
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.16);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 230, 190, 0.05) inset;
  --shadow-card-hover: 0 6px 18px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(255, 180, 100, 0.06);
  --max: 430px;
  --radius-card: 22px;
  --radius-ctl: 16px;
  --font: "Vazirmatn", Tahoma, sans-serif;
}

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

html,
body {
  margin: 0;
  height: 100%;
}

body {
  direction: rtl;
  font-family: var(--font);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(163, 0, 0, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(80, 40, 10, 0.35), transparent 50%),
    var(--brown-deep);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
}

/* Full-page boot loader */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 45% at 50% 35%, rgba(163, 0, 0, 0.28), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 90%, rgba(80, 40, 10, 0.45), transparent 55%),
    #0d0905;
  transition: opacity 0.38s ease, visibility 0.38s ease;
}

.app-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loader-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.app-loader-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 168px;
  height: 168px;
  margin: -98px 0 0 -84px;
  border-radius: 50%;
  border: 2px solid rgba(255, 209, 102, 0.12);
  border-top-color: rgba(255, 209, 102, 0.85);
  border-right-color: rgba(212, 106, 106, 0.45);
  animation: loader-spin 1.05s linear infinite;
}

.app-loader-logo {
  width: min(168px, 46vw);
  height: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.4));
  animation: loader-breathe 1.8s ease-in-out infinite;
}

.app-loader-text {
  margin: 8px 0 0;
  position: relative;
  z-index: 1;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255, 243, 223, 0.55);
  letter-spacing: 0.01em;
}

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

@keyframes loader-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

/* Bootstrap cafe theme tokens */
:root,
[data-bs-theme="dark"] {
  --bs-primary: #a30000;
  --bs-primary-rgb: 163, 0, 0;
  --bs-success: #8fbe6c;
  --bs-body-font-family: var(--font);
  --bs-body-bg: transparent;
  --bs-body-color: #fff3df;
  --bs-border-color: rgba(255, 230, 190, 0.14);
  --bs-border-radius: 16px;
  --bs-border-radius-lg: 22px;
  --bs-modal-bg: #24170c;
  --bs-modal-color: #fff3df;
  --bs-modal-border-color: rgba(255, 230, 190, 0.12);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.app-shell {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100dvh;
  height: 100dvh;
  background:
    linear-gradient(180deg, rgba(255, 220, 160, 0.04) 0%, transparent 18%),
    linear-gradient(165deg, #342012 0%, var(--brown) 42%, #221508 100%);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 220, 170, 0.05),
    0 12px 36px rgba(0, 0, 0, 0.28);
}

.app-shell:has(.menu-page) {
  height: 100dvh;
}

.app-shell:not(:has(.menu-page)) {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}

.ambient-glow {
  position: absolute;
  top: -100px;
  right: -40px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(163, 0, 0, 0.32) 0%,
    rgba(163, 0, 0, 0.08) 42%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  filter: blur(2px);
}

.app-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-shell:not(:has(.menu-page)) .app-content {
  height: auto;
  min-height: 100dvh;
}

/* Menu page layout: fixed header + scroll products */
.menu-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.menu-header {
  flex-shrink: 0;
  z-index: 5;
  padding: 8px 0 12px;
  background:
    linear-gradient(
      180deg,
      rgba(26, 16, 8, 0.94) 0%,
      rgba(26, 16, 8, 0.82) 72%,
      rgba(26, 16, 8, 0) 100%
    );
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.menu-logo {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.28))
    drop-shadow(0 0 10px rgba(163, 0, 0, 0.12));
}

.category-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-pill {
  flex: 0 0 auto;
  border: none !important;
  background: linear-gradient(
    145deg,
    rgba(255, 240, 210, 0.12) 0%,
    rgba(255, 240, 210, 0.04) 100%
  ) !important;
  color: var(--cream-soft) !important;
  border-radius: 999px !important;
  padding: 0.5rem 0.95rem !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.category-pill:hover {
  color: var(--cream) !important;
  transform: translateY(-1px);
}

.category-pill.active,
.category-pill.is-active {
  border: none !important;
  color: var(--cream) !important;
  background: linear-gradient(135deg, var(--red-soft) 0%, var(--red) 55%, var(--red-deep) 100%) !important;
  box-shadow: 0 4px 12px rgba(163, 0, 0, 0.28);
}

.menu-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 220, 170, 0.25) transparent;
}

.menu-scroll::-webkit-scrollbar {
  width: 4px;
}

.menu-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 220, 170, 0.22);
  border-radius: 999px;
}

.product-card {
  display: block;
  height: 136px;
  min-height: 136px;
  max-height: 136px;
  border-radius: var(--radius-card) !important;
  background:
    linear-gradient(
      135deg,
      rgba(255, 240, 210, 0.11) 0%,
      rgba(255, 240, 210, 0.035) 45%,
      rgba(0, 0, 0, 0.14) 100%
    ) !important;
  border: none !important;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: inherit !important;
  padding: 0 !important;
  appearance: none;
  position: relative;
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    rgba(255, 230, 180, 0.09) 0%,
    transparent 38%,
    transparent 100%
  );
  z-index: 1;
}

.product-card:hover,
.product-card:focus-visible {
  transform: translateY(-2px);
  outline: none;
  box-shadow: var(--shadow-card-hover);
}

.product-card:active {
  transform: scale(0.985);
}

.product-card.is-unavailable {
  opacity: 0.62;
  filter: saturate(0.75);
}

.product-card-image {
  width: 136px;
  height: 136px;
  flex: 0 0 136px;
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at 30% 20%, rgba(163, 0, 0, 0.18), transparent 55%),
    var(--image-fallback);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  z-index: 0;
  box-shadow: inset -6px 0 12px rgba(0, 0, 0, 0.1);
}

.product-emoji {
  font-size: 1.75rem;
}

.product-fallback-logo {
  width: 62%;
  height: 62%;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
}

.sheet-image .product-fallback-logo {
  width: 38%;
  height: 38%;
}

.product-card-image img,
.object-fit-cover {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-image img {
  transition: transform 0.35s ease;
}

.product-card-body {
  padding: 10px 12px 10px 26px;
  min-width: 0;
  min-height: 0;
  z-index: 1;
  text-align: right;
  overflow: hidden;
}

.badge-row {
  min-height: 18px;
  flex-shrink: 0;
  align-items: center;
}

.badge-spacer {
  display: block;
  height: 18px;
  width: 1px;
  opacity: 0;
}

.badge.rounded-pill,
.badge-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px !important;
  padding: 0.28rem 0.55rem !important;
  font-size: 0.625rem !important;
  font-weight: 700 !important;
  line-height: 1.3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

/* Tag colors: each tag-color-* class sets --tag-bg / --tag-fg */
.tag-color-red {
  --tag-bg: linear-gradient(135deg, #d46a6a, #a30000);
  --tag-fg: var(--cream);
}
.tag-color-crimson {
  --tag-bg: linear-gradient(135deg, #a30000, #5a0000);
  --tag-fg: var(--cream);
}
.tag-color-orange {
  --tag-bg: linear-gradient(135deg, #f0a35e, #d2691e);
  --tag-fg: var(--brown);
}
.tag-color-yellow {
  --tag-bg: linear-gradient(135deg, #f7dc7a, #d9a91c);
  --tag-fg: var(--brown);
}
.tag-color-lime {
  --tag-bg: linear-gradient(135deg, #b6d89a, #8fbe6c);
  --tag-fg: var(--brown);
}
.tag-color-green {
  --tag-bg: linear-gradient(135deg, #8fbe6c, #5e8643);
  --tag-fg: var(--brown);
}
.tag-color-blue {
  --tag-bg: linear-gradient(135deg, #7fb3e0, #3d78b5);
  --tag-fg: var(--cream);
}
.tag-color-purple {
  --tag-bg: linear-gradient(135deg, #b892d9, #7a4fa8);
  --tag-fg: var(--cream);
}
.tag-color-pink {
  --tag-bg: linear-gradient(135deg, #f2a7c3, #d6638e);
  --tag-fg: var(--brown);
}
.tag-color-cream {
  --tag-bg: linear-gradient(135deg, #fff3df, #e8d0a8);
  --tag-fg: var(--brown);
}

.badge[class*="tag-color-"],
.badge-pill[class*="tag-color-"] {
  background: var(--tag-bg) !important;
  color: var(--tag-fg) !important;
}

.product-name {
  margin: 0;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  line-height: 1.25;
  color: var(--cream) !important;
}

.product-desc {
  margin: 2px 0 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--cream-muted);
  line-height: 1.45;
  max-height: calc(0.75rem * 1.45 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  flex: 0 1 auto;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--green);
}

.availability.is-off {
  color: var(--unavailable-label);
}

.availability-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(132, 176, 97, 0.55);
  animation: pulse-dot 1.6s ease-out infinite;
}

.availability.is-off .availability-dot {
  background: var(--unavailable-dot);
  animation: none;
  box-shadow: none;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(132, 176, 97, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(132, 176, 97, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(132, 176, 97, 0);
  }
}

.price {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 4px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  direction: rtl;
  unicode-bidi: isolate;
  filter: drop-shadow(0 1px 3px rgba(224, 137, 24, 0.16));
}

.price.price-lg {
  font-size: 1.35rem;
}

.price .amount,
.price .unit {
  background: linear-gradient(125deg, #ffd166 0%, #f5b942 45%, #e08918 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.price .unit {
  font-size: 0.8em;
  font-weight: 800;
}

.price.is-discounted {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  filter: none;
}

.price .price-old {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.55;
  font-size: 0.72em;
  font-weight: 700;
}

.price .price-old .amount,
.price .price-old .unit {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--cream-muted);
  -webkit-text-fill-color: var(--cream-muted);
}

.price .price-sale {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.price .price-sale .amount,
.price .price-sale .unit {
  background: linear-gradient(125deg, #ffd166 0%, #f5b942 45%, #e08918 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.discount-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, #d46a6a, #a30000);
  color: var(--cream);
  box-shadow: 0 2px 6px rgba(163, 0, 0, 0.28);
}

.price.price-lg.is-discounted {
  gap: 8px;
}

.price.price-lg .price-old {
  font-size: 0.62em;
}

.price.price-lg .discount-badge {
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
}

.panel-price-old {
  text-decoration: line-through;
  opacity: 0.55;
  margin-inline-end: 0.25rem;
}

.panel-discount-badge {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 0.35rem;
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, #d46a6a, #a30000);
  color: var(--cream);
}

.card-chevron {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--chevron);
  font-size: 18px;
  direction: ltr;
  opacity: 0.85;
}

.text-cream-muted {
  color: var(--cream-muted) !important;
}

/* Bootstrap modal — bottom sheet */
#productModal.modal {
  padding: 0 !important;
}

#productModal.modal.show {
  display: flex !important;
  align-items: flex-end;
  justify-content: center;
}

#productModal .cafe-modal-dialog,
#productModal .cafe-modal-bottom {
  position: relative !important;
  top: auto !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: var(--max) !important;
  margin: 0 !important;
  height: auto !important;
  max-height: min(88dvh, 720px) !important;
  transform: none !important;
}

#productModal.modal.fade .cafe-modal-bottom {
  transform: translateY(110%) !important;
  transition: transform 0.28s ease-out !important;
}

#productModal.modal.show .cafe-modal-bottom {
  transform: translateY(0) !important;
}

#productModal .cafe-modal-content {
  background:
    linear-gradient(180deg, rgba(255, 220, 170, 0.08) 0%, transparent 28%),
    linear-gradient(to bottom, #322214, #1a1008) !important;
  border-radius: 1.5rem 1.5rem 0 0 !important;
  box-shadow:
    0 -6px 22px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 220, 170, 0.08);
  color: var(--cream);
  max-height: min(88dvh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-backdrop.show {
  opacity: 0.72;
  background: #000;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.sheet-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 1.25rem;
  overflow: hidden;
  background: var(--image-fallback);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.sheet-title {
  color: var(--cream) !important;
}

.sheet-en {
  color: var(--cream-faint);
  direction: ltr;
  text-align: right;
}

.sheet-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--cream-muted);
}

.btn-cafe-glass {
  color: var(--cream) !important;
  background: var(--glass) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-ctl) !important;
}

.btn-cafe-glass:hover {
  background: var(--glass-strong) !important;
  border-color: var(--glass-border-strong) !important;
  color: var(--cream) !important;
}

.is-hidden {
  display: none !important;
}

/* Panel / form buttons — keep Bootstrap .btn usable */
.btn-primary,
.btn.btn-primary {
  color: var(--cream) !important;
  background: linear-gradient(135deg, var(--red-soft), var(--red)) !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(163, 0, 0, 0.22);
  border-radius: var(--radius-ctl) !important;
  font-weight: 800;
  padding: 0.85rem 1.1rem;
}

.btn-glass,
.btn.btn-glass {
  color: var(--cream) !important;
  background: var(--glass) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-ctl) !important;
  font-weight: 800;
  padding: 0.85rem 1.1rem;
}

.btn-danger,
.btn.btn-danger {
  color: var(--cream) !important;
  background: linear-gradient(135deg, #c45c5c, #6a0000) !important;
  border: none !important;
  border-radius: var(--radius-ctl) !important;
  font-weight: 800;
  padding: 0.85rem 1.1rem;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.messages {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.messages li {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(196, 92, 92, 0.18);
  color: var(--red-soft);
  font-size: 13px;
  margin-bottom: 8px;
}

/* Panel */
.panel-pad {
  padding: 24px 24px 32px;
}

.panel-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
  margin: 12px auto 18px;
}

.panel-title {
  margin: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.panel-subtitle {
  margin: 8px 0 24px;
  text-align: center;
  font-size: 13px;
  color: var(--cream-faint);
}

.form-label,
.form-check-label {
  color: var(--cream-soft) !important;
  font-size: 0.8rem;
  font-weight: 600;
}

.form-control,
.form-select {
  background: var(--glass) !important;
  border: 1px solid var(--glass-border) !important;
  color: var(--cream) !important;
  border-radius: var(--radius-ctl) !important;
  padding: 0.75rem 0.9rem;
}

.form-control:focus,
.form-select:focus {
  background: rgba(255, 248, 236, 0.08) !important;
  border-color: var(--red) !important;
  box-shadow: 0 0 0 0.2rem rgba(163, 0, 0, 0.25) !important;
  color: var(--cream) !important;
}

.form-control::placeholder {
  color: var(--cream-dim);
}

.form-check-input {
  background-color: rgba(255, 248, 236, 0.08);
  border-color: var(--glass-border);
}

.form-check-input:checked {
  background-color: var(--red);
  border-color: var(--red);
}

.form-text,
.help-text {
  color: var(--cream-faint) !important;
  font-size: 0.75rem;
}

.alert {
  border-radius: 14px;
  border: 1px solid var(--glass-border);
}

.alert-danger {
  background: rgba(196, 92, 92, 0.18);
  color: var(--red-soft);
  border-color: rgba(196, 92, 92, 0.35);
}

.invalid-feedback {
  color: var(--red-soft);
}

.form-page .current-image {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
  background: var(--image-fallback);
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cream-soft);
}

.admin-input,
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%;
  border-radius: var(--radius-ctl);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--cream);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}

.admin-input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(153, 0, 0, 0.25);
}

.field-error,
.errorlist {
  color: var(--red-soft);
  font-size: 12px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.panel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  gap: 10px;
}

.panel-topbar-start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-topbar h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.tab-bar {
  margin: 8px 16px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}

.tab-bar a {
  text-align: center;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cream-soft);
}

.tab-bar a.is-active {
  color: var(--cream);
  background: linear-gradient(135deg, var(--red-soft), var(--red));
}

.panel-list {
  list-style: none;
  margin: 0;
  padding: 16px 16px 110px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-tile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 20px;
  background: var(--glass);
  border: none;
  box-shadow: var(--shadow-soft);
}

.drag-hint {
  font-size: 0.78rem;
  color: var(--cream-faint);
}

.drag-handle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 248, 236, 0.08);
  color: var(--cream-soft);
  cursor: grab;
  font-size: 0.95rem;
  letter-spacing: -2px;
  line-height: 1;
  touch-action: none;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.category-drag-item {
  touch-action: manipulation;
  user-select: none;
}

.category-drag-item.is-chosen,
.category-drag-item.is-drag-active {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.category-drag-item.is-dragging {
  opacity: 0.45;
}

.product-drag-item.is-chosen,
.product-drag-item.is-drag-active {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.product-drag-item.is-dragging {
  opacity: 0.45;
}

.sortable-fallback {
  opacity: 0.95 !important;
}

.admin-thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--image-fallback);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 28px;
}

.admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-thumb .product-fallback-logo {
  width: 58%;
  height: 58%;
  object-fit: contain;
}

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

.admin-tile-body h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.admin-tile-body p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--cream-muted);
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.status-chip {
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
}

.status-chip.on {
  background: rgba(132, 176, 97, 0.2);
  color: var(--green);
}

.status-chip.off {
  background: rgba(138, 123, 112, 0.2);
  color: var(--unavailable-label);
}

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--cream);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.icon-btn.danger {
  color: var(--red-soft);
}

.fab {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(calc(-50% - min(50vw, 215px) + 72px));
  z-index: 20;
  border: none;
  border-radius: 18px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 800;
  color: var(--cream);
  background: var(--red);
  box-shadow: 0 6px 16px rgba(153, 0, 0, 0.28);
  cursor: pointer;
}

@media (min-width: 430px) {
  .fab {
    left: calc(50% + 140px);
    transform: none;
  }
}

.form-page {
  padding: 16px 16px 32px;
}

.form-page h1 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 800;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--cream-soft);
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.badge-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.help-text {
  font-size: 12px;
  color: var(--cream-faint);
  margin-top: 6px;
}

.current-image {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  margin-bottom: 10px;
  background: var(--image-fallback);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.confirm-box {
  padding: 24px 16px 32px;
}

.confirm-box p {
  color: var(--cream-muted);
  line-height: 1.7;
  font-size: 14px;
}

/* Product editor: switches + choice boxes */
.switch-stack {
  background: var(--glass);
  border-radius: 18px;
  padding: 0.85rem 1rem;
}

.switch-row {
  padding: 0.35rem 0;
}

.switch-row .form-check {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2rem;
  padding: 0;
  margin: 0;
}

.switch-row .form-check-input {
  width: 2.6rem;
  height: 1.35rem;
  margin: 0;
  cursor: pointer;
  background-color: rgba(255, 248, 236, 0.12);
  border: none;
}

.switch-row .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(163, 0, 0, 0.22);
}

.switch-row .form-check-input:checked {
  background-color: var(--red);
  border-color: var(--red);
}

.switch-row .form-check-label {
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: var(--cream) !important;
  cursor: pointer;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.choice-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    rgba(255, 240, 210, 0.1),
    rgba(255, 240, 210, 0.03)
  );
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: none;
}

.choice-box:hover {
  transform: translateY(-1px);
  background: rgba(255, 240, 210, 0.12);
}

.choice-box input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-box-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cream-soft);
  line-height: 1.35;
}

.choice-box.is-selected {
  background: linear-gradient(135deg, rgba(212, 106, 106, 0.35), rgba(163, 0, 0, 0.55));
  box-shadow: 0 4px 14px rgba(163, 0, 0, 0.28);
}

.choice-box.is-selected .choice-box-text {
  color: var(--cream);
}

.choice-box[class*="tag-color-"].is-selected {
  background: var(--tag-bg);
}
.choice-box[class*="tag-color-"].is-selected .choice-box-text {
  color: var(--tag-fg);
}

.color-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.color-choice {
  justify-content: flex-start;
  gap: 0.6rem;
}

.color-swatch {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--tag-bg);
  box-shadow: 0 0 0 2px rgba(255, 248, 236, 0.18);
}

.color-choice.is-selected .color-swatch {
  box-shadow: 0 0 0 2px var(--tag-fg);
}

.tag-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  border-radius: 14px;
  background: var(--glass);
}

.tag-preview-box .badge {
  font-size: 0.8rem !important;
  padding: 0.4rem 0.85rem !important;
}

.tag-thumb {
  background: var(--tag-bg);
}

.status-box.is-selected {
  background: linear-gradient(135deg, rgba(146, 196, 111, 0.35), rgba(94, 134, 67, 0.65));
  box-shadow: 0 4px 14px rgba(94, 134, 67, 0.28);
}

.status-box.is-selected .choice-box-text {
  color: var(--cream);
}

.form-section-line {
  border: 0;
  border-top: 1px solid rgba(255, 220, 170, 0.16);
  opacity: 1;
  margin: 1.15rem 0;
}

.form-section .form-label {
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  color: var(--cream) !important;
}

/* Product order page */
.order-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.order-header {
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--cream-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.order-back:hover {
  color: var(--cream);
  background: var(--glass-strong);
}

.order-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--cream);
  line-height: 1.4;
}

.order-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(163, 0, 0, 0.22);
  border: 1px solid rgba(212, 106, 106, 0.28);
  color: var(--cream);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
}

.order-category-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.order-hint {
  margin: 0 16px 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 248, 236, 0.05);
  color: var(--cream-faint);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
}

.order-list {
  padding-top: 10px;
}

.order-index {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 9px;
  background: rgba(255, 209, 102, 0.14);
  color: var(--price-gold);
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.product-drag-item.is-chosen,
.product-drag-item.is-drag-active {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.product-drag-item.is-dragging {
  opacity: 0.55;
}

.order-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 28px 72px;
  gap: 10px;
}

.order-empty-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 4px;
  opacity: 0.9;
}

.order-empty-title {
  margin: 0;
  color: var(--cream);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.7;
  letter-spacing: 0;
  word-spacing: normal;
  white-space: normal;
}

.order-empty-text {
  margin: 0;
  max-width: 260px;
  color: var(--cream-muted);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: 0;
}

.order-empty-btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red-soft), var(--red));
  color: var(--cream);
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(163, 0, 0, 0.28);
}

.order-empty-btn:hover {
  color: var(--cream);
}

.empty-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 56px 24px;
  color: var(--cream-muted);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: 0;
}

.empty-menu .icon {
  font-size: 2.2rem;
  line-height: 1;
  opacity: 0.85;
}

.panel-section {
  display: flex;
  flex-direction: column;
  min-height: calc(100% - 120px);
}

.tile-meta {
  direction: ltr;
  unicode-bidi: plaintext;
  opacity: 0.85;
  font-size: 0.75rem !important;
}

.category-thumb {
  font-size: 1.35rem;
  line-height: 1;
}

.order-hint.form-hint {
  margin: 0;
  text-align: right;
}

.order-form {
  padding-top: 0 !important;
}

.order-form .form-page,
.form-page.order-form {
  padding-top: 4px;
}

/* Product image crop modal */
.product-image-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.product-image-preview-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cream-faint);
}

.image-field-hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: var(--cream-faint);
  line-height: 1.6;
}

.current-image-wide {
  width: 100%;
  max-width: 280px;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.btn-image-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(196, 92, 92, 0.35);
  background: rgba(163, 0, 0, 0.18);
  color: #ffb4b4;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-image-clear:hover {
  background: rgba(163, 0, 0, 0.32);
  color: #ffd0d0;
}

.cropper-stage.is-wide {
  height: min(42vw, 240px);
  max-height: 260px;
}

.crop-modal-dialog {
  max-width: min(420px, calc(100vw - 24px));
  margin: 0.75rem auto;
}

.crop-modal-content {
  background:
    linear-gradient(180deg, rgba(255, 220, 170, 0.08) 0%, transparent 30%),
    linear-gradient(to bottom, #322214, #1a1008) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 1.25rem !important;
  overflow: hidden;
  color: var(--cream);
}

.crop-modal-header {
  border-bottom: 1px solid rgba(255, 220, 170, 0.12) !important;
  padding: 14px 16px;
}

.crop-modal-body {
  position: relative;
  padding: 12px 16px 8px;
}

.crop-modal-hint {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--cream-faint);
  line-height: 1.6;
  text-align: center;
}

.cropper-stage {
  width: 100%;
  height: min(58vw, 320px);
  max-height: 360px;
  background: #120c07;
  border-radius: 14px;
  overflow: hidden;
}

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

.crop-modal-footer {
  border-top: 1px solid rgba(255, 220, 170, 0.12) !important;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px 16px;
}

.crop-modal-footer .btn {
  margin: 0 !important;
  padding: 0.7rem 0.5rem;
}

.crop-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(13, 9, 5, 0.72);
  backdrop-filter: blur(4px);
  z-index: 5;
  padding: 16px;
}

.crop-loading.is-visible {
  display: flex;
}

.crop-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(255, 248, 236, 0.08);
  border: 1px solid var(--glass-border);
  max-width: 240px;
}

.crop-loading-card p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.7;
}

.crop-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 243, 223, 0.2);
  border-top-color: var(--price-gold);
  animation: crop-spin 0.75s linear infinite;
}

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

#imageCropModal .cropper-view-box,
#imageCropModal .cropper-face {
  border-radius: 0;
}

#imageCropModal .cropper-dashed {
  border-color: rgba(255, 209, 102, 0.35);
}

#imageCropModal .cropper-line,
#imageCropModal .cropper-point {
  background-color: var(--price-gold);
}

/* Panel help / tutorial sheet */
.help-trigger {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 209, 102, 0.35);
  background: rgba(255, 209, 102, 0.12);
  color: var(--price-gold);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.help-trigger:hover {
  background: rgba(255, 209, 102, 0.22);
  color: #ffe4a3;
}

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

.help-title-row h1,
.help-title-row .h4 {
  margin: 0;
}

body.help-open {
  overflow: hidden;
}

.help-sheet {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.help-sheet[hidden] {
  display: none !important;
}

.help-sheet.is-open {
  pointer-events: auto;
}

.help-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 5, 2, 0.62);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.help-sheet.is-open .help-sheet-backdrop {
  opacity: 1;
}

.help-sheet-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max);
  max-height: min(86dvh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 1.4rem 1.4rem 0 0;
  background:
    linear-gradient(180deg, rgba(255, 220, 170, 0.1) 0%, transparent 28%),
    linear-gradient(to bottom, #322214, #1a1008);
  border: 1px solid rgba(255, 230, 190, 0.14);
  border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(110%);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.help-sheet.is-open .help-sheet-panel {
  transform: translateY(0);
}

.help-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin: 10px auto 0;
  flex-shrink: 0;
}

.help-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 8px;
}

.help-sheet-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--cream);
  line-height: 1.5;
}

.help-sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--cream-soft);
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.help-sheet-body {
  padding: 4px 16px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.help-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: help-step;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-steps li {
  counter-increment: help-step;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 248, 236, 0.05);
  border: 1px solid rgba(255, 230, 190, 0.1);
}

.help-steps li::before {
  content: counter(help-step);
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(163, 0, 0, 0.35);
  color: var(--price-gold);
  font-size: 0.78rem;
  font-weight: 800;
  grid-row: 1 / span 2;
}

.help-steps li strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--cream);
  line-height: 1.5;
  grid-column: 2;
}

.help-steps li span {
  display: block;
  grid-column: 2;
  margin-top: 2px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--cream-muted);
  line-height: 1.75;
}

.help-foot {
  margin: 14px 0 4px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--cream-faint);
  line-height: 1.6;
}

.help-sheet-footer {
  padding: 10px 16px 16px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 220, 170, 0.1);
}
