/* ==========================================================================
   Sticky pull-out donation menu + lightbox
   ========================================================================== */

.Give {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 70;
  display: grid;
  justify-items: center;
  padding: 0 10px max(10px, env(safe-area-inset-bottom));
  pointer-events: none;
  transform: translateY(130%);
  transition: transform 700ms var(--ease);
}

.Give.is-ready { transform: none; }

.Give__scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgb(var(--ink) / 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms;
}

.Give.is-open .Give__scrim { opacity: 1; pointer-events: auto; }

.Give__sheet {
  display: flex;
  flex-direction: column;
  inline-size: min(100%, 480px);
  max-block-size: calc(100dvh - 24px);
  border-radius: 18px;
  background: rgb(var(--yellow));
  box-shadow: 0 14px 34px -12px rgb(0 0 0 / 0.45);
  pointer-events: auto;
  overflow: hidden;
  transition: border-radius 400ms var(--ease), background-color 400ms;
}

.Give.is-open .Give__sheet { background: #fff; }

@media (min-width: 900px) {
  .Give { justify-items: end; padding-inline: 24px; padding-block-end: 24px; }
  .Give__sheet { inline-size: 420px; }
}

.Give__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  inline-size: 100%;
  min-block-size: var(--bar-h);
  padding: 8px 10px 8px 22px;
  background: rgb(var(--yellow));
  color: rgb(var(--ink));
  text-align: start;
  touch-action: none;
}

.Give__label { flex: 1 1 auto; font-size: 1.125rem; font-weight: 500; }
.Give__label b { font-weight: 700; }
.Give__price { font-size: 0.8125rem; font-weight: 600; opacity: 0.75; white-space: nowrap; }

.Give__chev {
  display: grid;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  border-radius: 8px;
  background: #fff;
  flex: none;
  box-shadow: 0 2px 6px -2px rgb(0 0 0 / 0.25);
}

.Give__chev svg { inline-size: 20px; block-size: 20px; fill: rgb(var(--ink)); transition: transform 500ms var(--ease); }
.Give.is-open .Give__chev svg { transform: rotate(180deg); }
.Give:not(.is-open) .Give__bar:hover .Give__chev svg { animation: nudge 900ms var(--ease) infinite; }

@keyframes nudge { 50% { transform: translateY(-3px); } }

.Give__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 560ms var(--ease);
  min-block-size: 0;
}

.Give.is-open .Give__panel { grid-template-rows: 1fr; }

.Give__inner { min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; }

.Give__body { display: grid; gap: 14px; padding: 18px 18px 20px; }

.Give__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.Give__title { font-size: 1.25rem; color: rgb(var(--ink)); }
.Give__link { color: rgb(var(--navy)); font-size: 0.875rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.Products {
  display: flex;
  gap: 8px;
  margin-inline: -18px;
  padding: 2px 18px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.Products::-webkit-scrollbar { display: none; }

.Product {
  flex: none;
  display: grid;
  gap: 1px;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgb(var(--off));
  box-shadow: inset 0 0 0 1.5px rgb(var(--ink) / 0.08);
  text-align: start;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  transition: box-shadow 200ms, background-color 200ms;
}

.Product small { color: rgb(var(--muted)); font-size: 0.75rem; font-weight: 500; }
.Product[aria-pressed='true'] { background: rgb(var(--blue) / 0.12); box-shadow: inset 0 0 0 2px rgb(var(--blue)); }

.Seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 12px;
  background: rgb(var(--off));
  box-shadow: inset 0 0 0 1px rgb(var(--ink) / 0.06);
}

.Seg button {
  min-block-size: 42px;
  border-radius: 9px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgb(var(--muted));
  transition: background-color 250ms, color 250ms, box-shadow 250ms;
}

.Seg button[aria-pressed='true'] { background: #fff; color: rgb(var(--ink)); box-shadow: var(--shadow-sm), 0 2px 8px -4px rgb(0 0 0 / 0.2); }

.Field { display: grid; gap: 6px; }
.Field__label { color: rgb(var(--ink)); font-size: 0.875rem; font-weight: 600; }
.Field__help { color: rgb(var(--muted)); font-size: 0.8125rem; }

.Input,
.Select {
  inline-size: 100%;
  min-block-size: 46px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px rgb(var(--ink) / 0.14);
  font-size: 1rem;
  transition: box-shadow 200ms;
}

.Select {
  appearance: none;
  padding-inline-end: 40px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231e1e24' d='m12 15.5-5-5L8.4 9 12 12.7 15.6 9 17 10.5l-5 5Z'/%3E%3C/svg%3E") right 12px center / 20px no-repeat;
}

.Input:focus,
.Select:focus { outline: none; box-shadow: inset 0 0 0 2px rgb(var(--blue)); }

.Row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.Stepper { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; }
.Stepper button { min-block-size: 46px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1.5px rgb(var(--ink) / 0.14); font-size: 1.35rem; line-height: 1; }
.Stepper button:disabled { opacity: 0.4; }
.Stepper output { display: grid; place-items: center; border-radius: 10px; background: rgb(var(--off)); font-weight: 700; font-size: 1.125rem; }

.Amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.Amount {
  min-block-size: 50px;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px rgb(var(--ink) / 0.14);
  font-size: 1.0625rem;
  font-weight: 700;
  transition: box-shadow 200ms, background-color 200ms, transform 200ms var(--ease);
}

.Amount[aria-pressed='true'] { background: rgb(var(--blue) / 0.12); box-shadow: inset 0 0 0 2px rgb(var(--blue)); transform: scale(1.02); }

.Custom { position: relative; }
.Custom span { position: absolute; inset: 50% auto auto 14px; translate: 0 -50%; color: rgb(var(--muted)); font-weight: 600; }
.Custom .Input { padding-inline-start: 30px; }

.Count { justify-self: end; color: rgb(var(--muted)); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.Total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-block-start: 12px;
  border-block-start: 1px dashed rgb(var(--ink) / 0.18);
}

.Total span { color: rgb(var(--muted)); font-size: 0.875rem; }
.Total b { font-family: var(--font-h); font-size: 1.5rem; color: rgb(var(--ink)); }

.Give__note { color: rgb(var(--muted)); font-size: 0.8125rem; text-align: center; }

.Done { display: grid; justify-items: center; gap: 10px; padding: 26px 20px 24px; text-align: center; }
.Done__tick { inline-size: 64px; block-size: 64px; border-radius: 50%; background: rgb(var(--green)); display: grid; place-items: center; animation: pop 600ms var(--ease) both; }
.Done__tick svg { inline-size: 32px; block-size: 32px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: tick 500ms 250ms var(--ease) forwards; }
.Done h3 { font-size: 1.35rem; }
.Done p { color: rgb(var(--ink-soft)); font-size: 0.9375rem; }

@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
@keyframes tick { to { stroke-dashoffset: 0; } }

/* ---------- Lightbox ---------- */

.Lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 56px 12px 24px;
  background: rgb(12 12 16 / 0.92);
  opacity: 0;
  transition: opacity 300ms;
}

.Lightbox.is-open { opacity: 1; }

/* The wrapper needs a real width, otherwise the frame's percentage width collapses to zero */
.Lightbox__wrap {
  display: grid;
  justify-items: center;
  inline-size: 100%;
}

.Lightbox__frame {
  position: relative;
  inline-size: min(100%, calc((100vh - 120px) * var(--ratio-n, 1.7778)), 1100px);
  inline-size: min(100%, calc((100dvh - 120px) * var(--ratio-n, 1.7778)), 1100px);
  aspect-ratio: var(--ratio, 16 / 9);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  transform: scale(0.96);
  transition: transform 500ms var(--ease);
}

.Lightbox.is-open .Lightbox__frame { transform: none; }
.Lightbox__frame iframe,
.Lightbox__frame img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; object-fit: contain; }

.Lightbox__caption { margin-block-start: 12px; color: rgb(255 255 255 / 0.8); font-size: 0.9375rem; text-align: center; }

.Lightbox__close {
  position: absolute;
  inset: 10px 10px auto auto;
  display: grid;
  place-items: center;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  color: #fff;
}

.Lightbox__close svg { inline-size: 22px; block-size: 22px; fill: currentColor; }
.Lightbox__close:hover { background: rgb(255 255 255 / 0.24); }
