/* ==========================================================================
   Dish detail modal (assets/scripts/dish-modal.js)
   ========================================================================== */

.dm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.55);
}

/* `display: flex` above outranks the browser's default [hidden]{display:none},
   so hiding the modal needs an explicit rule or the close button does nothing. */
.dm-overlay[hidden] {
  display: none;
}

.dm-box {
  position: relative;
  width: min(34rem, 100%);
  margin: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px -16px rgba(16, 24, 40, 0.45);
  overflow: hidden;
}

.dm-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.dm-close:hover { background: #fff; color: #000; }

.dm-figure {
  width: 100%;
  height: 15rem;
  background: #f2f2f2;
  overflow: hidden;
}
.dm-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-body {
  padding: 1.25rem 1.4rem 1.6rem;
}

.dm-category {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #fff4ec;
  color: #bc5500;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dm-title {
  margin: 0 0 0.4rem;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
  color: #161616;
}

/* Rating summary --------------------------------------------------------- */
.dm-rating {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
  min-height: 1.3rem;
}
.dm-stars { display: inline-flex; gap: 0.08rem; }
.dm-star { color: #dcdcdc; font-size: 1rem; line-height: 1; }
.dm-star.is-on { color: #f5a623; }
.dm-stars--sm .dm-star { font-size: 0.85rem; }
.dm-rating__avg { font-size: 0.9rem; font-weight: 700; color: #222; }
.dm-rating__count { font-size: 0.82rem; color: #8a8a8a; }
.dm-rating__none { font-size: 0.82rem; color: #9a9a9a; }

.dm-desc {
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #555;
}

/* Price / portions -------------------------------------------------------- */
.dm-price-block { margin-bottom: 1rem; }

.dm-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
}

.dm-choose {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9a9a9a;
}

.dm-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.dm-option {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid #e4e4e4;
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  color: #444;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}
.dm-option:hover { border-color: #d0d0d0; background: #fafafa; }
.dm-option.is-on {
  border-color: #bc5500;
  background: #fff7f1;
  color: #bc5500;
}
.dm-option__name { font-weight: 500; }
.dm-option__price { font-weight: 700; }

/* Add to cart ------------------------------------------------------------- */
.dm-add {
  display: block;
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.dm-add:hover { background: #bc5500; }

/* Reviews ----------------------------------------------------------------- */
.dm-subhead {
  margin: 1.6rem 0 0.7rem;
  padding-top: 1.1rem;
  border-top: 1px solid #f0f0f0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #222;
}

.dm-reviews {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 16rem;
  overflow-y: auto;
}

.dm-review {
  padding: 0.7rem 0.85rem;
  border: 1px solid #f0f0f0;
  border-radius: 10px;
  background: #fcfcfc;
}
.dm-review__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.dm-review__who { font-size: 0.85rem; font-weight: 600; color: #222; }
.dm-review__date { font-size: 0.72rem; color: #a0a0a0; }
.dm-review__text {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #555;
}

.dm-empty {
  margin: 0;
  padding: 0.6rem 0;
  font-size: 0.85rem;
  color: #9a9a9a;
}

/* Cards become obviously clickable ---------------------------------------- */
.dish {
  cursor: pointer;
}
.dish__add {
  cursor: pointer;
}

@media (max-width: 30rem) {
  .dm-overlay { padding: 0; }
  .dm-box { width: 100%; border-radius: 0; min-height: 100%; }
  .dm-figure { height: 12rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dm-option,
  .dm-add {
    transition: none;
  }
}
