/* Meal details page — onboarding kit */

:root {
  --meal-bg: #f3f4f6;
  --meal-ink: #0f172a;
  --meal-muted: #6b7280;
  --meal-primary: #22c55e;
  --meal-primary-dark: #16a34a;
  --meal-secondary: #f59e0b;
  --meal-soft: #e8f9ef;
  --meal-soft-deep: #d1f5de;
  --meal-line: #e5e7eb;
  --meal-card: #ffffff;
  --meal-font: "Roboto", system-ui, sans-serif;
}

body:has(.meal-page) {
  background: var(--meal-bg);
  font-family: var(--meal-font);
  color: var(--meal-ink);
}

.meal-page {
  padding: 28px 0 110px;
  font-family: var(--meal-font);
}

.meal-missing {
  max-width: 520px;
  padding: 60px 0;
}

.meal-missing h1 {
  color: var(--market-ink, #0f172a);
  margin-bottom: 10px;
}

.meal-missing p {
  color: #6b7280;
  margin-bottom: 20px;
}

.meal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.7fr);
  gap: 24px;
  align-items: start;
}

.meal-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.95fr);
  gap: 18px;
  background: #fff;
  border-radius: 24px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.meal-gallery {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #e8f9ef;
  min-height: 320px;
}

.meal-hero-img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  display: block;
}

.meal-hero-fallback {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 700;
  color: #0f172a;
}

.meal-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  text-decoration: none;
}

.meal-back {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
}

.meal-gallery-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.meal-thumbs {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.meal-thumb {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.meal-thumb.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #f59e0b;
}

.meal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.meal-summary {
  padding: 10px 8px 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meal-rest-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meal-rest-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.meal-rest-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f9ef;
  color: #0f172a;
  font-weight: 700;
}

.meal-rest-name {
  font-weight: 650;
  color: #0f172a;
  font-size: 0.92rem;
}

.meal-rest-cats {
  color: #6b7280;
  font-size: 0.78rem;
}

.meal-summary h1 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  line-height: 1.2;
  color: #0f172a;
  font-weight: 700;
}

.meal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meal-rating {
  color: #0f172a;
  font-weight: 600;
  font-size: 0.88rem;
}

.meal-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e8f9ef;
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 550;
}

.meal-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.meal-price-row strong {
  font-size: 1.45rem;
  color: #0f172a;
}

.meal-was {
  color: #6b7280;
  text-decoration: line-through;
  font-size: 0.95rem;
}

.meal-off {
  background: #e8f9ef;
  color: #1f7a3a;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
}

.meal-short {
  color: #6b7280;
  font-size: 0.92rem;
  line-height: 1.55;
}

.meal-order-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

.qty-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f9ef;
  border-radius: 999px;
  padding: 4px;
}

.qty-pill button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
}

.qty-pill span {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  color: #0f172a;
}

.btn-meal-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--meal-primary, #22c55e);
  color: #fff !important;
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-meal-primary:hover {
  background: var(--meal-primary-dark, #16a34a);
  transform: translateY(-1px);
}

.btn-meal-secondary {
  display: inline-flex;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--meal-primary, #22c55e);
  color: var(--meal-primary, #22c55e);
  background: #fff;
  font-weight: 600;
  text-decoration: none;
}

.btn-block {
  width: 100%;
  margin-top: 14px;
}

.meal-order-actions .btn-meal-primary {
  flex: 1;
}

.meal-tabs {
  display: flex;
  gap: 22px;
  margin: 22px 0 14px;
  border-bottom: 1px solid #e5e7eb;
}

.meal-tabs button {
  border: 0;
  background: transparent;
  padding: 10px 2px 12px;
  font: inherit;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  position: relative;
}

.meal-tabs button.is-active {
  color: #0f172a;
}

.meal-tabs button.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--meal-primary, #22c55e);
}

.meal-panel {
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.meal-panel h2 {
  font-size: 1.15rem;
  color: #0f172a;
  margin-bottom: 10px;
}

.meal-panel p {
  color: #6b7280;
  line-height: 1.65;
}

.meal-about-rest {
  margin-top: 12px;
}

.meal-highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.meal-highlight {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
}

.meal-related {
  margin-top: 24px;
}

.meal-related h2 {
  font-size: 1.2rem;
  color: #0f172a;
  margin-bottom: 14px;
}

.meal-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.meal-related-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.meal-related-card:hover {
  transform: translateY(-3px);
}

.meal-related-img {
  aspect-ratio: 4 / 3;
  background: #e8f9ef;
  overflow: hidden;
}

.meal-related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meal-related-img span {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
}

.meal-related-card h3 {
  font-size: 0.88rem;
  padding: 10px 12px 2px;
  color: #0f172a;
  line-height: 1.3;
}

.meal-related-card p {
  padding: 0 12px 12px;
  color: #f59e0b;
  font-weight: 700;
  font-size: 0.88rem;
}

.meal-aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 90px;
}

.meal-aside-card {
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.meal-aside-card h3 {
  font-size: 1rem;
  color: #0f172a;
  margin-bottom: 12px;
}

.meal-aside-rest {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.meal-aside-rest img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.meal-aside-rest strong {
  display: block;
  color: #0f172a;
  margin-bottom: 2px;
}

.meal-aside-rest p {
  color: #6b7280;
  font-size: 0.82rem;
  line-height: 1.4;
}

.meal-delivery-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.meal-delivery-list li {
  color: #6b7280;
  font-size: 0.88rem;
  padding-left: 14px;
  position: relative;
}

.meal-delivery-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
}

.meal-aside-note {
  color: #6b7280;
  font-size: 0.88rem;
  margin-bottom: 12px;
  line-height: 1.5;
}

.meal-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.meal-sticky-inner {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.meal-sticky-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.meal-sticky-info img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
}

.meal-sticky-info strong {
  display: block;
  color: #0f172a;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.meal-sticky-info p {
  color: #6b7280;
  font-size: 0.8rem;
  margin-top: 2px;
}

.meal-sticky-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 1100px) {
  .meal-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .meal-highlights {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .meal-layout {
    grid-template-columns: 1fr;
  }

  .meal-aside {
    position: static;
  }

  .meal-hero-card {
    grid-template-columns: 1fr;
  }

  .meal-sticky-info strong {
    max-width: 28vw;
  }
}

@media (max-width: 640px) {
  .meal-page {
    padding-bottom: 130px;
  }

  .meal-order-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .meal-sticky-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .meal-sticky-actions {
    width: 100%;
  }

  .meal-sticky-actions .btn-meal-primary {
    flex: 1;
  }

  .meal-related-grid {
    grid-template-columns: 1fr 1fr;
  }

  .meal-sticky-info strong {
    max-width: 60vw;
  }
}
