/* ============================================
   MENU PAGE - Modern Light Theme 2026
   ============================================ */

.menu-page {
  padding: 0;
  margin: 0;
  text-align: start;
}

#ajax-messages {
  position: fixed;
  top: calc(var(--nav-height, 70px) + var(--space-md, 1rem));
  right: max(var(--space-md, 1rem), env(safe-area-inset-right, 0px));
  z-index: var(--z-toast, 300);
  width: min(360px, calc(100vw - 2rem));
  display: grid;
  gap: var(--space-sm, 0.5rem);
}

#ajax-messages .ajax-message {
  padding: var(--space-md, 1rem) var(--space-lg, 1.5rem);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 12px 30px rgba(45, 41, 38, 0.18);
}

/* ============================================
   SUB-NAVIGATION (Category Pills)
   ============================================ */

.menu-page .sub-nav {
  position: sticky;
  top: 70px;
  z-index: 10;
  width: 100%;
  background: rgba(253, 251, 247, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--bg-tertiary, #EDE6DA);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px 10px;
  margin: 0 0 24px 0;
  box-shadow: 0 4px 16px rgba(45, 41, 38, 0.06);
}

.menu-page .sub-nav .sub-nav-item {
  flex: 1 1 auto;
  min-width: 82px;
}

/* Hebrew RTL */
html[lang="he"] .sub-nav {
  direction: rtl;
}

.sub-nav .sub-nav-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  flex: 1 1 auto;
  min-width: 78px;
  text-decoration: none;
  color: var(--text-secondary, #5C5550);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  text-transform: lowercase;
  border-radius: 12px;
  background: transparent;
  transition: background var(--transition-fast, 150ms ease);
  border: none;
  text-shadow: none;
}

.sub-nav .sub-nav-item:hover {
  background: var(--bg-secondary, #F5F0E8);
  color: var(--brand-gold-dark, #A68736);
}

.sub-nav .sub-nav-item:hover span {
  color: var(--brand-gold-dark, #A68736);
}

.sub-nav .sub-nav-item.active,
.sub-nav .sub-nav-item.active span {
  color: var(--brand-gold-dark, #A68736);
}

/* Design's .cat .disc — styled directly on .section-image */
.sub-nav .sub-nav-item .section-image {
  width: 62px;
  height: 62px;
  object-fit: contain;
  margin-bottom: 0;
  border-radius: 9999px;
  background: var(--bg-secondary, #F5F0E8);
  border: 2px solid transparent;
  padding: 4px;
  box-shadow: none;
  transition: border-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sub-nav .sub-nav-item:hover .section-image,
.sub-nav .sub-nav-item.active .section-image {
  border-color: var(--brand-gold, #C9A456);
  box-shadow: 0 6px 20px rgba(201, 164, 86, 0.3);
  transform: translateY(-2px);
}

/* ============================================
   MENU CONTENT
   ============================================ */

.menu-page .menu-content {
  margin-top: 0;
  text-align: start;
}

.menu-page .menu-content section {
  padding: 0 0 16px;
  scroll-margin-top: 100px;
  text-align: start;
}

/* Section header — round category photo + title + description */
.section-flex {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 36px 0 18px;
  text-align: start;
}

.menu-page .menu-content section:first-of-type .section-flex {
  margin-top: 12px;
}

.section-flex .section-image {
  width: 72px;
  height: 72px;
  object-fit: contain;
  padding: 8px;
  background: var(--brand-gold-light, #E5D4A4);
  border-radius: 9999px;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(201, 164, 86, 0.2);
  transition: border-color 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  margin: 0;
}

.section-flex:hover .section-image {
  border-color: var(--brand-gold, #C9A456);
  transform: scale(1.05);
  box-shadow: 0 8px 22px rgba(201, 164, 86, 0.35);
}

.section-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.section-text p {
  color: var(--text-secondary, #5C5550);
  font-size: 14px;
  max-width: 600px;
  margin: 0;
  line-height: 1.5;
}

.cat-name {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-primary, #2D2926);
  margin: 0;
  line-height: 1.2;
  text-transform: lowercase;
}

/* ============================================
   DISHES CONTAINER
   ============================================ */

.dishes-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  padding: 0;
  margin: 0 auto;
  text-align: start;
}

/* ============================================
   DISH CARD (design system 1:1)
   ============================================ */

.dish {
  box-sizing: border-box;
  background: var(--bg-primary, #FDFBF7);
  border: 1px solid var(--bg-tertiary, #EDE6DA);
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow-soft, rgba(45, 41, 38, 0.08));
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.dish::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-gold, #C9A456), var(--accent-terracotta, #C67B5C));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
  z-index: 2;
}

.dish:hover {
  transform: translateY(-6px);
  border-color: var(--brand-gold-light, #E5D4A4);
  box-shadow: 0 12px 40px var(--shadow-medium, rgba(45, 41, 38, 0.15));
}

.dish:hover::before {
  transform: scaleX(1);
}

/* Image block — full width, bg-secondary background tile */
.dish .dish-img,
.dish .dish-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 160px;
  background: var(--bg-secondary, #F5F0E8);
  overflow: hidden;
  cursor: zoom-in;
  flex-shrink: 0;
}

.dish .dish-image {
  width: 80%;
  height: 80%;
  object-fit: contain;
  transition: transform 0.4s ease;
  margin: 0;
}

.dish:hover .dish-image {
  transform: scale(1.08);
}

/* Body block */
.dish .dish-body {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}

.dish .dish-name {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.25;
  color: var(--text-primary, #2D2926);
  margin: 0;
}

.dish .dish-description {
  font-size: 13px;
  color: var(--text-secondary, #5C5550);
  line-height: 1.45;
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish .dish-meta {
  font-size: 12px;
  color: var(--text-muted, #8B857D);
  margin-top: 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dish .dish-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  gap: 12px;
}

.dish .dish-price,
.dish .price {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-weight: 700;
  font-size: 22px;
  color: var(--brand-gold-dark, #A68736);
  margin: 0;
  line-height: 1;
}

/* Inline add-to-cart form (single "add" button, no quantity input) */
.dish .add-to-cart-inline {
  margin: 0;
  padding: 0;
  display: inline-flex;
}

.dish .add-btn,
.dish .order-button {
  background: linear-gradient(135deg, var(--brand-gold, #C9A456), var(--brand-gold-dark, #A68736));
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(201, 164, 86, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 38px;
}

.dish .add-btn:hover:not(:disabled),
.dish .order-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(201, 164, 86, 0.4);
}

.dish .add-btn:disabled,
.dish .order-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-tertiary, #EDE6DA);
  color: var(--text-muted, #8B857D);
  box-shadow: none;
}

/* Unavailable Dish */
.dish-unavailable {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.dish-unavailable::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg, 12px);
  z-index: 1;
}

.dish-unavailable:hover {
  transform: none;
  box-shadow: 0 4px 20px var(--shadow-soft, rgba(45, 41, 38, 0.08));
}

.dish-unavailable .order-button {
  background: var(--text-muted, #8B857D) !important;
  cursor: not-allowed;
  pointer-events: auto;
}

.dish-unavailable .order-button:hover {
  transform: none;
  box-shadow: none;
}

/* Quantity input focus ring */
.dish .quantity-input:focus {
  border-color: var(--brand-gold, #C9A456);
  box-shadow: 0 0 0 3px var(--brand-gold-light, #E5D4A4);
  outline: none;
}

/* ============================================
   DISH LIGHTBOX (rich preview on image tap)
   ============================================ */

.dish-image-link {
  cursor: zoom-in;
}

.dish-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 210);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(45, 41, 38, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.dish-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.dish-lightbox-card {
  background: transparent;
  border-radius: 0;
  max-width: min(1200px, 96vw);
  width: auto;
  max-height: 94vh;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dish-lightbox.open .dish-lightbox-card {
  transform: scale(1);
}

.dish-lightbox-img {
  width: auto;
  height: auto;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.dish-lightbox-img img {
  max-width: min(1200px, 96vw);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: dishLightboxZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dishLightboxZoomIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.dish-lightbox-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: none;
  background: rgba(253, 251, 247, 0.95);
  color: var(--text-primary, #2D2926);
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: transform var(--transition-fast, 150ms ease), background var(--transition-fast, 150ms ease);
}

.dish-lightbox-close:hover {
  background: var(--brand-gold, #C9A456);
  color: #fff;
  transform: rotate(90deg);
}

.dish-lightbox-body {
  display: none;
}

.dish-lightbox-body h3 {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 6px;
  color: var(--text-primary, #2D2926);
}

.dish-lightbox-meta {
  color: var(--text-muted, #8B857D);
  font-size: 13px;
  margin-bottom: 14px;
}

.dish-lightbox-meta:empty {
  display: none;
}

.dish-lightbox-body p {
  color: var(--text-secondary, #5C5550);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 18px;
}

.dish-lightbox-body p:empty {
  display: none;
  margin: 0;
}

.dish-lightbox-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.dish-lightbox-price {
  font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
  font-weight: 700;
  font-size: 28px;
  color: var(--brand-gold-dark, #A68736);
  line-height: 1;
}

.btn-lightbox-add {
  background: linear-gradient(135deg, var(--brand-gold, #C9A456), var(--brand-gold-dark, #A68736));
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  box-shadow: 0 4px 15px rgba(201, 164, 86, 0.3);
  transition: transform var(--transition-fast, 150ms ease), box-shadow var(--transition-fast, 150ms ease);
}

.btn-lightbox-add:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 164, 86, 0.4);
}

.btn-lightbox-add:active {
  transform: translateY(0) scale(0.98);
}

.btn-lightbox-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .dish-lightbox {
    padding: clamp(12px, 3vw, 24px);
    align-items: center;
  }

  .dish-lightbox-card {
    max-width: 100%;
    max-height: 100%;
  }

  .dish-lightbox-img img {
    max-width: 96vw;
    max-height: 86vh;
  }
}

/* ============================================
   RESPONSIVE - TABLETS
   ============================================ */

@media (max-width: 768px) {
  #ajax-messages {
    top: auto;
    right: max(var(--space-sm, 0.5rem), env(safe-area-inset-right, 0px));
    left: max(var(--space-sm, 0.5rem), env(safe-area-inset-left, 0px));
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }

  .menu-page {
    padding: 0;
  }

  /* Horizontal scroll strip — one row, swipeable left/right */
  .menu-page .sub-nav {
    position: sticky;
    top: 60px;
    margin: 0 -10px;
    padding: 8px 10px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--bg-primary, #FDFBF7);
    border: none;
    border-bottom: 1px solid var(--bg-tertiary, #EDE6DA);
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(45, 41, 38, 0.04);
    z-index: 50;
    left: 0;
    right: 0;
    width: auto;
    justify-content: flex-start;
  }
  .menu-page .sub-nav::-webkit-scrollbar { display: none; }
  .menu-page .sub-nav .sub-nav-item {
    flex: 0 0 auto;
    min-width: 60px;
    width: auto;
    padding: 4px 6px;
    font-size: 10.5px;
    scroll-snap-align: start;
  }
  .menu-page .sub-nav .sub-nav-item .section-image {
    width: 44px;
    height: 44px;
  }

  .menu-page .menu-content section {
    padding: 24px 0;
    scroll-margin-top: 80px;
  }

  .section-flex { gap: 12px; margin: 24px 0 14px; }
  .section-flex .section-image { width: 56px; height: 56px; padding: 6px; }

  .cat-name {
    font-size: var(--fs-h3, 1.25rem);
  }

  .dishes-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .dish-image-link {
    height: 140px;
  }

  .dish .dish-name { font-size: 15px; }
  .dish .dish-description { font-size: 12px; -webkit-line-clamp: 2; }
  .dish .dish-price { font-size: 17px; }

  .dish-content {
    padding: 12px 14px 12px;
  }

  .dish .order-controls {
    padding: 0 14px 14px;
    gap: 6px;
  }

  .dish .quantity-input {
    width: 48px;
    font-size: 16px;
    min-height: 40px;
  }

  .dish .order-button {
    font-size: 12px;
    padding: 8px 12px;
    min-height: 40px;
  }
}

@media (max-width: 430px) {
  .dishes-container {
    grid-template-columns: 1fr;
  }

  .dish-image-link {
    height: 180px;
  }
}

/* ============================================
   TOAST NOTIFICATIONS (for cart feedback)
   ============================================ */

.toast {
  position: fixed;
  bottom: calc(var(--footer-height, 80px) + var(--space-lg, 1.5rem));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary, #2D2926);
  color: white;
  padding: var(--space-md, 1rem) var(--space-xl, 2rem);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 40px var(--shadow-strong, rgba(45, 41, 38, 0.25));
  z-index: var(--z-toast, 300);
  opacity: 0;
  transition: all var(--transition-base, 250ms ease);
}

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

.toast.success {
  background: var(--success, #4A7C59);
}

.toast.error {
  background: var(--error, #B44444);
}

/* ============================================
   SIDE PICKER — модалка выбора гарнира для мяса на огне
   ============================================ */
.side-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal, 1000);
  padding: var(--space-md, 1rem);
}
.side-picker-overlay.active {
  display: flex;
}
.side-picker {
  background: var(--surface, #fff);
  color: var(--text, #2a2a2a);
  border-radius: 14px;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}
.side-picker-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}
.side-picker-dish {
  margin: 0 0 1.25rem;
  color: var(--text-muted, #666);
  font-size: 0.95rem;
}
.side-picker-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 0.75rem;
}
.side-picker-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--surface-alt, #faf7f0);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  font-family: inherit;
  text-align: center;
}
.side-picker-card:hover,
.side-picker-card:focus-visible {
  border-color: var(--accent, #d1a954);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  outline: none;
}
.side-picker-card:active {
  transform: translateY(0);
}
.side-picker-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eee;
}
.side-picker-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.side-picker-label {
  padding: 0.7rem 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #2a2a2a);
}
.side-picker-cancel {
  background: none;
  border: none;
  color: var(--text-muted, #777);
  font-size: 0.95rem;
  padding: 0.5rem;
  cursor: pointer;
}
.side-picker-cancel:hover {
  color: var(--text, #2a2a2a);
}
@media (max-width: 480px) {
  .side-picker-options {
    grid-template-columns: 1fr 1fr;  /* две узкие карточки всё равно помещаются */
    gap: 0.6rem;
  }
  .side-picker {
    padding: 1rem;
  }
}
