/* Components added for the approved site copy (docs/site-copy.md): product galleries, bundle
   "Includes" lists and photos, closing taglines and the brand sign-off. */

/* ---------- galleries ---------- */
.gallery-main {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #efeee4;
}
.gallery-main[data-fit='contain'] {
  object-fit: contain;
}
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(var(--thumbs, 4), minmax(0, 1fr)); /* one row for every photo */
  gap: 8px;
  margin-top: 8px;
}
.gallery-thumb {
  padding: 0;
  border: 1px solid #dcdccd;
  background: #efeee4;
  opacity: 0.75;
  transition: opacity 0.2s, border-color 0.2s;
}
.gallery-thumb:hover,
.gallery-thumb.is-active {
  opacity: 1;
  border-color: #343b23;
}
.gallery-thumb img {
  aspect-ratio: 1;
  object-fit: cover;
}
.product-dialog .detail-layout > .gallery {
  position: sticky;
  top: 0;
}
.ingredient-card .gallery-main {
  aspect-ratio: 1.6;
  object-position: center 55%;
}
.ingredient-card .gallery-thumbs {
  margin: 8px 8px 0;
}

/* ---------- product copy ---------- */
.closing-tagline {
  margin-top: 14px;
  color: #69704a;
}
.product-dialog .product-tagline {
  font-size: 18px !important;
  margin: 6px 0 10px;
}

/* ---------- bundles ---------- */
.bundle-images .bundle-photo {
  width: 100%;
  object-fit: cover;
}
.bundle-copy > p:nth-of-type(2) {
  min-height: 0; /* the reference reserved this height for the description, now the 3rd paragraph */
}
.bundle-regular {
  font-size: 13px !important;
  margin-top: -6px;
}
.bundle-includes-label {
  margin: 14px 0 4px;
  font-size: 12px !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #536030 !important;
}
.bundle-includes {
  list-style: disc;
  padding-left: 18px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #4f5541;
}
.bundle-signoff {
  text-align: center;
  margin: 8px 0 18px;
}
.bundle-signoff p:first-child {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  color: #292d20;
}
.bundle-signoff p:last-child {
  font-size: 14px;
  color: #626a50;
}
/* The fine-print note sits under the centred sign-off, so centre it too. */
.combo-section > p.muted {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 951px) {
  .bundle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bundle-card {
    display: flex;
    flex-direction: column;
  }
  .bundle-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .bundle-copy .bundle-price {
    margin-top: auto;
    padding-top: 12px;
  }
  .bundle-copy .button {
    align-self: stretch;
  }
}
@media (min-width: 1280px) {
  .bundle-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
  .bundle-copy {
    padding: 24px;
  }
  .bundle-copy h3 {
    font-size: 25px;
  }
}

/* ---------- interest list (GHL form embed) ---------- */
.interest-form iframe {
  display: block;
  min-height: 420px; /* until form_embed.js sizes the frame to the form */
}
.interest-band {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 60px;
  align-items: center;
  padding: 70px 8%;
  background: #e9e9db;
}
.interest-band h2 {
  margin-bottom: 18px;
}
.interest-band p:not(.eyebrow) {
  color: #626752;
  max-width: 460px;
}
.interest-band .muted {
  margin-top: 14px;
}
.interest-card {
  /* The GHL form draws its own card, so no extra frame here. */
  min-width: 0;
}
.demo-sample {
  padding-top: 0;
}
.demo-sample .form-card {
  max-width: 640px;
}

@media (max-width: 800px) {
  .interest-band {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 45px 6%;
  }
}

/* ---------- brand sign-off ---------- */
.brand-signoff {
  text-align: center;
  padding: 60px 7% 70px;
  background: #e9e9db;
}
.brand-signoff .eyebrow {
  margin-bottom: 14px;
}
.brand-signoff p:last-child {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  letter-spacing: -0.02em;
  color: #292d20;
}

@media (max-width: 600px) {
  .product-dialog .detail-layout > .gallery {
    position: static;
  }
  .brand-signoff {
    padding: 40px 7% 46px;
  }
}

/* ---------- pre-orders (Stripe payment links) ---------- */
.announcement a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #f6efda80;
}
.preorder-banner {
  padding: 14px 18px;
  margin-bottom: 26px;
  background: #e9e9db;
  font-size: 14px;
  color: #3d4330;
}
.preorder-banner a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.product a.add {
  display: block;
  text-align: center;
  border: 1px solid #a5a890;
  padding: 10px;
  font-size: 13px;
}
.product a.add:hover {
  background: #343b23;
  color: white;
}
.product button.add:disabled,
.bundle-copy button.button:disabled {
  background: transparent;
  color: #6d705f;
  border-color: #c5cbb8;
}
.preorder-note {
  margin-top: 4px;
}

/* ---------- product & info dialogs: always-reachable close button ---------- */
/* The close button sticks to the top of the dialog while its content scrolls, sits on a frosted
   round chip, and never shows a focus ring on tap (focus opens on the content instead). */
.product-dialog > .close,
.info-dialog > .close {
  position: sticky;
  top: 10px;
  right: auto; /* the reference's absolute `right` inset would otherwise constrain the sticky chip */
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 -24px -44px auto; /* no top offset, so the content below keeps its position */
  border-radius: 50%;
  background: rgb(248 245 237 / 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgb(19 23 13 / 0.18);
  color: #292d20;
  font-size: 28px;
  line-height: 1;
  z-index: 3;
  transition: background 0.2s ease, transform 0.2s ease;
}
.product-dialog > .close:hover,
.info-dialog > .close:hover {
  background: #fffdf8;
  transform: scale(1.05);
}
.product-dialog > .close:focus:not(:focus-visible),
.info-dialog > .close:focus:not(:focus-visible),
#detailContent:focus {
  outline: none;
}
/* Keep the page behind an open dialog from scrolling (notably on iOS). */
html:has(dialog[open]) {
  overflow: hidden;
}

@media (max-width: 600px) {
  /* Product view becomes a full-screen sheet on phones. */
  .product-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 12px 20px 40px;
  }
  .product-dialog > .close,
  .info-dialog > .close {
    top: 12px;
    width: 46px;
    height: 46px;
    margin: 0 -6px -46px auto;
  }
  .info-dialog {
    padding-top: 16px;
  }
}
