/* ── Dish detail modal (CSS radio + :has(); no dialog JS) ── */

.plate-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.order-card-label {
  display: contents;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.order-card[data-dish] {
  cursor: pointer;
}

.order-card[data-dish]:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 3px;
}

.order-card__hint {
  margin: 0.35rem 0 0;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 184, 77, 0.65);
}

body:has(.plate-toggle:checked:not(#plate-none)) {
  overflow: hidden;
}

.dish-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  width: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0.75rem;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  content-visibility: hidden;
}

body:has(#plate-vada-pav:checked) .dish-modal--vada-pav,
body:has(#plate-chai:checked) .dish-modal--chai,
body:has(#plate-pani-puri:checked) .dish-modal--pani-puri,
body:has(#plate-idli:checked) .dish-modal--idli,
body:has(#plate-dosa:checked) .dish-modal--dosa,
body:has(#plate-poha:checked) .dish-modal--poha,
body:has(#plate-misal-pav:checked) .dish-modal--misal-pav,
body:has(#plate-banana-chips:checked) .dish-modal--banana-chips {
  content-visibility: visible;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1001;
}

.dish-modal__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(2, 2, 4, 0.82);
  backdrop-filter: blur(12px) saturate(0.85);
  cursor: pointer;
}

.dish-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: min(88dvh, 720px);
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 184, 77, 0.18);
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255, 140, 60, 0.1), transparent 55%),
    linear-gradient(180deg, #1a1410 0%, #100c0a 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 140, 60, 0.08);
  transform: translateY(16px) scale(0.96);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

body:has(#plate-vada-pav:checked) .dish-modal--vada-pav .dish-modal__panel,
body:has(#plate-chai:checked) .dish-modal--chai .dish-modal__panel,
body:has(#plate-pani-puri:checked) .dish-modal--pani-puri .dish-modal__panel,
body:has(#plate-idli:checked) .dish-modal--idli .dish-modal__panel,
body:has(#plate-dosa:checked) .dish-modal--dosa .dish-modal__panel,
body:has(#plate-poha:checked) .dish-modal--poha .dish-modal__panel,
body:has(#plate-misal-pav:checked) .dish-modal--misal-pav .dish-modal__panel,
body:has(#plate-banana-chips:checked) .dish-modal--banana-chips .dish-modal__panel {
  transform: translateY(0) scale(1);
}

.dish-modal--theater .dish-modal__panel {
  width: min(920px, 100%);
}

.dish-modal__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 184, 77, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.dish-modal__toolbar-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dish-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.dish-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 184, 77, 0.35);
}

.dish-modal__close:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 2px;
}

.dish-modal__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease 0.18s, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.18s;
}

body:has(#plate-vada-pav:checked) .dish-modal--vada-pav .dish-modal__scroll,
body:has(#plate-chai:checked) .dish-modal--chai .dish-modal__scroll,
body:has(#plate-pani-puri:checked) .dish-modal--pani-puri .dish-modal__scroll,
body:has(#plate-idli:checked) .dish-modal--idli .dish-modal__scroll,
body:has(#plate-dosa:checked) .dish-modal--dosa .dish-modal__scroll,
body:has(#plate-poha:checked) .dish-modal--poha .dish-modal__scroll,
body:has(#plate-misal-pav:checked) .dish-modal--misal-pav .dish-modal__scroll,
body:has(#plate-banana-chips:checked) .dish-modal--banana-chips .dish-modal__scroll {
  opacity: 1;
  transform: translateY(0);
}

.dish-modal__scroll::-webkit-scrollbar {
  width: var(--scrollbar-size);
}

.dish-modal__scroll::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
  margin: 4px 0;
  border-left: 1px solid var(--scrollbar-track-edge);
}

.dish-modal__scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--scrollbar-thumb-hover), var(--scrollbar-thumb));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.dish-modal__scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--scrollbar-thumb-active), var(--scrollbar-thumb-hover));
}

.dish-modal__scroll::-webkit-scrollbar-thumb:active {
  background: var(--scrollbar-thumb-active);
}

.dish-modal__content {
  padding: 1rem 1.25rem 1.5rem;
}

.dish-modal__header {
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 184, 77, 0.1);
  padding-bottom: 1rem;
}

.dish-modal__script {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--lamp);
}

.dish-modal__title {
  margin: 0.2rem 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
}

.dish-modal__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.dish-modal__badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Price badge retired for CSS Art — comfort + craft first */

.dish-modal__famous {
  margin: 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.45;
}

.dish-modal__techniques {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.dish-modal__technique {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 100px;
  background: rgba(255, 184, 77, 0.08);
  border: 1px solid rgba(255, 184, 77, 0.2);
  color: var(--lamp);
  font-family: ui-monospace, 'Cascadia Code', monospace;
}

.dish-modal__body {
  display: grid;
  gap: 1rem;
}

.dish-modal__section h3 {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lamp);
}

.dish-modal__section p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
}

.dish-modal__section--health {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.dish-modal__section--health h3 {
  color: #86efac;
}

.dish-modal__section--css h3 {
  color: #fcd34d;
}

.dish-modal__list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
}

.dish-modal__list li + li {
  margin-top: 0.25rem;
}

.dish-modal__note {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}

.dish-modal__nutrition {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 0.5rem;
  margin: 0;
}

.dish-modal__nutrition div {
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.dish-modal__nutrition dt {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dish-modal__nutrition dd {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .dish-modal,
  .dish-modal__panel {
    transition: none;
  }
}
