/* Modal configuration plat (Glovo-style) */
.dish-configurator-root {
  display: none;
}

body.dish-modal-open {
  overflow: hidden;
}

.dish-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 640px) {
  .dish-modal-overlay {
    align-items: center;
    padding: 1.5rem;
  }
}

.dish-modal {
  width: 100%;
  max-width: 32rem;
  max-height: 92vh;
  max-height: 92dvh;
  background: #fff;
  border-radius: 1.25rem 1.25rem 0 0;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dishModalUp 0.28s ease-out;
}

@media (min-width: 640px) {
  .dish-modal {
    border-radius: 1.25rem;
    max-height: 88vh;
  }
}

@keyframes dishModalUp {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dish-modal-header {
  position: relative;
  flex-shrink: 0;
  border-bottom: 1px solid #f1f5f9;
}

.dish-modal-close {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  font-size: 1.35rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

.dish-modal-hero {
  display: flex;
  gap: 0.875rem;
  padding: 1rem 3rem 1rem 1rem;
}

.dish-modal-img {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.75rem;
  object-fit: cover;
  flex-shrink: 0;
}

.dish-modal-headtext h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.25rem;
}

.dish-modal-desc {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0 0 0.35rem;
  line-height: 1.4;
}

.dish-modal-base {
  font-size: 0.875rem;
  font-weight: 700;
  color: #8dc63e;
  margin: 0;
}

.dish-modal-preview {
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  background: #fffbeb;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
}

.dish-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.dish-section {
  padding: 1rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.dish-section:last-child {
  border-bottom: none;
}

.dish-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dish-section-head h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.dish-section-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 0.2rem 0 0;
}

.dish-badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.dish-badge--required {
  background: #fef2f2;
  color: #b91c1c;
}

.dish-badge--optional {
  background: #f1f5f9;
  color: #64748b;
}

.dish-choice-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dish-choice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.875rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dish-choice input {
  flex-shrink: 0;
  accent-color: #8dc63e;
}

.dish-choice-label {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

.dish-choice-price {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.dish-choice.is-selected {
  border-color: #8dc63e;
  background: #f7fee7;
}

.dish-spice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dish-spice-btn {
  padding: 0.5rem 0.85rem;
  border-radius: 9999px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.dish-spice-btn.is-selected {
  border-color: #ea580c;
  background: #fff7ed;
  color: #c2410c;
}

.dish-ice-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.dish-switch {
  position: relative;
  display: inline-block;
  width: 2.75rem;
  height: 1.5rem;
}

.dish-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.dish-switch-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 9999px;
  transition: 0.2s;
}

.dish-switch-slider::before {
  content: '';
  position: absolute;
  height: 1.125rem;
  width: 1.125rem;
  left: 0.2rem;
  bottom: 0.19rem;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.dish-switch input:checked + .dish-switch-slider {
  background: #8dc63e;
}

.dish-switch input:checked + .dish-switch-slider::before {
  transform: translateX(1.2rem);
}

[dir='rtl'] .dish-switch input:checked + .dish-switch-slider::before {
  transform: translateX(-1.2rem);
}

.dish-instructions {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 4.5rem;
}

.dish-instructions:focus {
  outline: none;
  border-color: #8dc63e;
  box-shadow: 0 0 0 3px rgba(141, 198, 62, 0.25);
}

.dish-modal-footer {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0));
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.dish-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border-radius: 0.75rem;
  padding: 0.25rem;
}

.dish-qty-btn {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.5rem;
  background: #fff;
  font-size: 1.125rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.dish-qty-val {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
}

.dish-footer-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.dish-footer-label {
  font-size: 0.6875rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.dish-footer-price {
  font-size: 1.125rem;
  color: #0f172a;
}

.dish-submit-btn {
  grid-column: 1 / -1;
  width: 100%;
  padding: 0.9rem 1rem;
  border: none;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, #8dc63e 0%, #6da82e 100%);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.dish-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dish-submit-btn:not(:disabled):active {
  transform: scale(0.98);
}

.dish-submit-price {
  font-weight: 600;
  opacity: 0.95;
}

.dish-loading {
  padding: 2rem;
  text-align: center;
  color: #64748b;
}

.rest-menu-card {
  display: flex;
  gap: 0.875rem;
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 0.875rem;
}

.rest-menu-card img {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.65rem;
  object-fit: cover;
}

.rest-menu-config-btn {
  flex-shrink: 0;
  padding: 0.5rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: #0f172a;
  color: #fff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.rest-menu-config-btn:hover {
  background: #1e293b;
}

.client-dish-add-btn {
  flex-shrink: 0;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.85rem;
  border-radius: 0.75rem;
  background: #8dc63e;
  color: #fff;
  font-weight: 700;
  font-size: 0.8125rem;
  border: none;
  cursor: pointer;
}

.client-dish-add-btn:hover {
  background: #6da82e;
}

.cart-options-summary {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.35;
}
