/* CP-002/CP-003 — Portal 1 PDP "Ingredients & product information" modal.
   Loaded only for portalId===1 && v3Page==='product'. Reuses the shared
   .modal-overlay/.modal/.modal-body/.modal-close/.d-dialog-fade base rules
   from v3-storefront.css and follows the same *-info-* naming convention as
   the HerbaPoints and Starter Set informational modals, but a wider desktop
   width and near-full-screen mobile layout to hold dense nutrition tables
   legibly. */


.ing-info-modal:not(.open) { display: none; }
.modal-overlay.ing-info-modal.open,
.ing-info-modal.open {
  /* CORRECTION-11: above the product Quick View it may be opened from (that overlay stays open underneath). */
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px 20px;
}
.modal.ing-info-dialog,
.ing-info-dialog {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  grid-template-rows: none;
  width: min(920px, calc(100vw - 40px));
  max-width: 920px;
  max-height: min(88vh, 88dvh, 840px);
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}
.modal-body.ing-info-body,
.ing-info-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-height: 0;
  max-height: min(88vh, 88dvh, 840px);
  margin: 0;
  padding: 0;
  text-align: left;
  grid-column: 1 / -1;
}
.ing-info-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ing-info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 26px 32px 16px;
  border-bottom: 1px solid var(--line);
}
.ing-info-head-text { min-width: 0; }
.ing-info-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--green-dark);
  margin-bottom: 4px;
}
.ing-info-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}
.ing-info-serving {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.ing-info-close {
  position: static;
  top: auto;
  right: auto;
  flex: none;
}
.ing-info-content {
  width: 100%;
  padding: 20px 32px 44px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  min-height: 0;
  flex: 1 1 auto;
}
.ing-info-foot {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 16px 32px 28px;
  border-top: 1px solid var(--line);
}
.ing-info-gotit { width: min(100%, 220px); }

/* Badges */
.ing-badges {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none; margin: 0 0 18px; padding: 0;
}
.ing-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-soft); color: var(--green-dark);
  border-radius: var(--radius-pill); padding: 5px 12px;
  font-size: 12.5px; font-weight: 700;
}
.ing-badge .ico { width: 14px; height: 14px; }

/* Milk / soya preparation toggle */
.ing-prep-toggle {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--bg, #f3f5f2); border-radius: var(--radius-pill);
  margin-bottom: 10px;
}
.ing-prep-btn {
  appearance: none; border: none; background: transparent;
  padding: 8px 16px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.ing-prep-btn[aria-pressed="true"] {
  background: #fff; color: var(--green-dark); box-shadow: var(--shadow-sm);
}
.ing-prep-note { display: none; font-size: 12.5px; color: var(--muted); margin: 0 0 18px; }
.ing-info-modal:not(.prep-soya) .ing-prep-note[data-val="milk"] { display: block; }
.ing-info-modal.prep-soya .ing-prep-note[data-val="soya"] { display: block; }

/* Nutrition sections */
.ing-section { margin: 0 0 24px; }
.ing-section:last-child { margin-bottom: 0; }
.ing-section h3 {
  margin: 0 0 10px; font-size: 14.5px; font-weight: 800; color: var(--ink);
}
.ing-section-intro { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.ing-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ing-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.ing-table th, .ing-table td {
  text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ing-table th[scope="row"] { font-weight: 600; color: var(--ink); white-space: normal; }
.ing-table td { font-weight: 700; color: var(--ink); text-align: right; }
.ing-row-sub th[scope="row"] { padding-left: 20px; font-weight: 400; color: var(--muted); }
.ing-row-sub td { font-weight: 500; color: var(--muted); }

/* Two-column (milk/soya) tables: only the active preparation's column shows,
   so the table never needs to squeeze two value columns onto a narrow
   screen — this is the "compact way to distinguish the two label columns"
   without an unreadable table. */
.ing-info-modal:not(.prep-soya) .ing-table td[data-val="soya"] { display: none; }
.ing-info-modal.prep-soya .ing-table td[data-val="milk"] { display: none; }

.ing-highlights { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.ing-highlights li { margin-bottom: 4px; }

.ing-ingredients-text { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

.ing-allergens h3 { color: var(--berry-dark, var(--ink)); }
.ing-allergens p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); }

.ing-safety-note {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 18px 0 0; padding: 10px 12px;
  background: var(--bg, #f3f5f2); border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
.ing-safety-note .ico { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--muted); }

@media (max-width: 720px) {
  .ing-info-modal.open { padding: 0; }
  .ing-info-dialog {
    width: 100%; max-width: 100%; height: 100%; max-height: 100vh; max-height: 100dvh;
    border-radius: 0;
  }
  .ing-info-body { max-height: 100vh; max-height: 100dvh; }
  .ing-info-head,
  .ing-info-content,
  .ing-info-foot { padding-left: 20px; padding-right: 20px; }
  .ing-table th, .ing-table td { padding: 6px 8px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .ing-info-dialog { animation: none; }
}
