/* Projecting Hope — Gear & Merch storefront (shared by movie-dashboard.html and /merch).
   Mount point: <div id="gm-store"></div>. Edit products in the merch_* tables, never here. */
.gm-store {
  --gm-navy: #0d2540; --gm-navy-mid: #1C3F5E; --gm-gold: #F2B830; --gm-gold-dark: #e0a820;
  --gm-blue: #7BAFD4; --gm-blue-dark: #5d97c2; --gm-surface: #ffffff; --gm-border: #e8edf4;
  --gm-text: #4a5568; --gm-text-light: #64748b;
  font-family: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--gm-text);
}
.gm-store *, .gm-store *::before, .gm-store *::after { box-sizing: border-box; }
.gm-store button { font-family: inherit; }

/* ── Merch (matches main site) ── */
.merch-group { margin-bottom: 36px; }
.merch-group-title {
  font-family: 'Lato', sans-serif;
  font-size: 1.24rem;
  font-weight: 900;
  color: var(--gm-navy);
  margin: 0 0 6px;
  line-height: 1.2;
}
.merch-group-sub {
  font-size: .92rem;
  color: var(--gm-text);
  margin: 0 0 16px;
  line-height: 1.5;
}
.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 14px;
}
.merch-card {
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.merch-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13,37,64,.08);
  border-color: rgba(13,37,64,.18);
}
.merch-img-wrap {
  position: relative;
  aspect-ratio: 1/1;
  background: #f3f5fa;
  overflow: hidden;
}
.merch-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.merch-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 99px;
  color: #fff;
}
.merch-badge--new { background: var(--gm-blue); }
.merch-badge--limited { background: var(--gm-gold-dark); color: var(--gm-navy); }
.merch-sold-stamp {
  position: absolute;
  top: 18px;
  right: -28px;
  background: #888;
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 40px;
  transform: rotate(45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.merch-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.merch-name {
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  color: var(--gm-navy);
  margin: 0;
  line-height: 1.25;
}
.merch-desc {
  font-size: .92rem;
  color: var(--gm-text);
  line-height: 1.5;
  margin: 4px 0 10px;
  flex: 1;
}
.merch-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gm-border);
}
.merch-price {
  font-family: 'Fraunces', Georgia, serif;
  font-feature-settings: "tnum";
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gm-navy);
}
.merch-price span {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--gm-text-light);
  margin-top: 1px;
}
.merch-price--muted { color: var(--gm-text-light); }
.btn-add {
  background: var(--gm-navy);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-family: 'Lato', sans-serif;
  font-weight: 900;
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s;
}
.btn-add:hover { background: var(--gm-navy-mid); }
.btn-add--gold { background: var(--gm-gold); color: var(--gm-navy); }
.btn-add--gold:hover { background: var(--gm-gold-dark); }
.btn-add--ghost { background: transparent; color: var(--gm-text-light); border: 1px solid var(--gm-border); opacity: .55; cursor: not-allowed; }
.merch-card--soldout { opacity: .85; }
.merch-card--soldout .merch-img { filter: grayscale(.5); }
.merch-card--soldout:hover { transform: none; box-shadow: none; }

/* ── Gear & Merch storefront: sizes, gallery, cart ── */
.gm-loading, .gm-error { font-size: .95rem; color: var(--gm-text-light); padding: 24px 0; }
.gm-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.gm-size {
  min-width: 42px; padding: 6px 10px; border-radius: 8px;
  border: 1.5px solid var(--gm-border); background: #fff; color: var(--gm-navy);
  font-family: 'Lato', sans-serif; font-weight: 800; font-size: .8rem; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.gm-size:hover { border-color: var(--gm-navy); }
.gm-size.is-on { background: var(--gm-navy); border-color: var(--gm-navy); color: #fff; }
.gm-size:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
/* Always-visible cart button: sticks to the top while scrolling so shoppers can find the cart. */
.gm-topcart-wrap { position: sticky; top: var(--gm-topcart-top, 12px); z-index: 5; display: flex; justify-content: flex-end; height: 0; overflow: visible; }
.gm-topcart {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 0;
  background: var(--gm-navy); color: #fff; border: 0; border-radius: 999px; cursor: pointer;
  padding: 10px 14px 10px 16px; font-family: 'Lato', sans-serif; font-weight: 800; font-size: .95rem;
  box-shadow: 0 8px 22px rgba(13,37,64,.28); touch-action: manipulation;
}
.gm-topcart:hover { background: #0a1c31; }
.gm-topcart-count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.18); color: #fff; font-size: .85rem; }
.gm-topcart-count.has-items { background: var(--gm-gold); color: var(--gm-navy); }
#gm-groups { padding-top: 56px; }
.gm-cart-bar {
  position: sticky; bottom: 16px; z-index: 4;
  display: none; align-items: center; justify-content: space-between; gap: 14px;
  margin: 24px auto 0; max-width: 520px;
  background: var(--gm-navy); color: #fff; border-radius: 999px;
  padding: 8px 8px 8px 20px; box-shadow: 0 12px 32px rgba(13,37,64,.28);
}
.gm-cart-bar.is-on { display: flex; }
.gm-cart-bar-text { font-size: .95rem; font-weight: 800; }
.gm-cart-bar-text span { opacity: .75; font-weight: 700; }
.gm-cart-bar .btn-add { background: var(--gm-gold); color: var(--gm-navy); border-radius: 999px; }
.gm-cart-bar .btn-add:hover { background: var(--gm-gold-dark); }
.gm-cart-backdrop { position: fixed; inset: 0; background: rgba(13,37,64,.45); z-index: 9190; display: none; }
.gm-cart-backdrop.open { display: block; }
.gm-cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 92vw);
  /* No vh/dvh here: phone browsers (and the Facebook/Instagram/email in-app browsers) report vh taller than
     what is visible, which pushed the Checkout button off-screen. top+bottom pins it to the visible area, and
     gmFitCart() in merch-store.js also sets the exact visible height. */
  background: #fff; z-index: 9200; transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column; box-shadow: -16px 0 40px rgba(13,37,64,.18); overflow: hidden;
}
/* Items + code + donation + totals scroll together in ONE area; the Checkout button lives in a fixed
   footer. (Before: the totals block was position:sticky and, with the donation added, grew taller than a
   phone screen and covered the items, which then could not be reached.) */
.gm-cart-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.gm-cart-foot { flex: 0 0 auto; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--gm-border); background: #fff; }
.gm-cart-drawer.open { transform: translateX(0); }
.gm-cart-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; background: var(--gm-navy); color: #fff; }
.gm-cart-title { font-family: 'Lato', sans-serif; font-size: 1.05rem; font-weight: 900; }
.gm-cart-close { background: transparent; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; padding: 4px 8px; line-height: 1; }
.gm-cart-items { padding: 6px 18px; }
.gm-cart-empty { text-align: center; color: var(--gm-text-light); font-size: .95rem; padding: 48px 12px; }
.gm-cart-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--gm-border); align-items: start; }
.gm-cart-item:last-child { border-bottom: none; }
.gm-cart-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #f3f5fa; }
.gm-cart-item-name { font-size: .92rem; font-weight: 800; color: var(--gm-navy); line-height: 1.3; }
.gm-cart-item-meta { font-size: .82rem; color: var(--gm-text-light); margin-top: 2px; }
.gm-cart-item-price { font-size: .95rem; font-weight: 900; color: var(--gm-navy); white-space: nowrap; text-align: right; }
.gm-qty { display: inline-flex; align-items: center; border: 1px solid var(--gm-border); border-radius: 8px; margin-top: 8px; }
.gm-qty button { width: 30px; height: 28px; background: transparent; border: none; font-size: 1rem; font-weight: 900; color: var(--gm-navy); cursor: pointer; }
.gm-qty span { min-width: 26px; text-align: center; font-size: .9rem; font-weight: 800; color: var(--gm-navy); }
.gm-cart-remove { background: transparent; border: none; color: var(--gm-text-light); font-size: .8rem; font-weight: 700; cursor: pointer; padding: 0; margin-top: 8px; display: block; }
.gm-cart-remove:hover { color: #c0392b; text-decoration: underline; }
.gm-cart-totals { padding: 16px 20px 20px; border-top: 1px solid var(--gm-border); background: #f7f8fc; }
.gm-cart-row { display: flex; justify-content: space-between; font-size: 1rem; font-weight: 900; color: var(--gm-navy); padding: 4px 0 10px; }
.gm-cart-note { font-size: .82rem; color: var(--gm-text-light); line-height: 1.5; margin: 0 0 12px; }
.gm-cart-checkout { width: 100%; padding: 13px 16px; font-size: .95rem; border-radius: 10px; }
.gm-cart-checkout:disabled { opacity: .6; cursor: wait; }
.gm-code { display: flex; gap: 8px; margin: 0 0 6px; }
.gm-code input, .gm-ship input { flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid var(--gm-border); border-radius: 8px; font-family: 'Lato', sans-serif; font-size: 1rem; color: var(--gm-navy); background: #fff; }
.gm-code input { text-transform: uppercase; }
.gm-code input:focus, .gm-ship input:focus { outline: none; border-color: var(--gm-navy); }
.btn-add--ghost-navy { background: #fff; color: var(--gm-navy); border: 1.5px solid var(--gm-navy); }
.btn-add--ghost-navy:hover { background: var(--gm-navy); color: #fff; }
.gm-code-msg { font-size: .85rem; font-weight: 700; min-height: 1.2em; margin: 0 0 8px; color: var(--gm-text-light); }
.gm-code-msg.is-ok { color: #1e7a4a; }
.gm-code-msg.is-bad { color: #c0392b; }
.gm-cart-row--sub { font-size: .92rem; font-weight: 700; color: #1e7a4a; padding-bottom: 2px; }
.gm-cart-item-was { font-size: .8rem; color: var(--gm-text-light); text-decoration: line-through; display: block; }
.gm-ship { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.gm-ship-title { font-size: .95rem; font-weight: 900; color: var(--gm-navy); margin-bottom: 2px; }
.gm-ship-row { display: grid; grid-template-columns: 1fr 56px 90px; gap: 8px; }
.gm-ship input.is-bad { border-color: #c0392b; }
.gm-gallery { cursor: pointer; touch-action: pan-y; }
.gm-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.92); color: var(--gm-navy);
  box-shadow: 0 2px 10px rgba(13,37,64,.22);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: .9; transition: opacity .15s, transform .15s;
}
.gm-nav--prev { left: 10px; }
.gm-nav--next { right: 10px; }
.gm-nav:hover { opacity: 1; transform: translateY(-50%) scale(1.06); }
.gm-count {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(13,37,64,.78); color: #fff;
  font-family: 'Lato', sans-serif; font-size: .78rem; font-weight: 800; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; pointer-events: none;
}
.gm-thumbs {
  display: flex; gap: 6px; padding: 8px 10px 0; overflow-x: auto; scrollbar-width: none;
  background: var(--gm-surface);
}
.gm-thumbs::-webkit-scrollbar { display: none; }
.gm-thumb {
  flex: 0 0 auto; width: 52px; height: 52px; padding: 0; border-radius: 8px; overflow: hidden;
  border: 2px solid transparent; background: #f3f5fa; cursor: pointer; opacity: .75;
  transition: opacity .15s, border-color .15s;
}
.gm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gm-thumb:hover { opacity: 1; }
.gm-thumb.is-on { opacity: 1; border-color: var(--gm-navy); }

.gm-toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--gm-navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 9300; max-width: 92vw; text-align: center; box-shadow: 0 10px 28px rgba(13,37,64,.3); }
.gm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Optional donation (separate from the purchase; tax-deductible). Plain, no callout box. */
.gm-don { margin: 4px 0 14px; padding: 14px 0 4px; border-top: 1px solid var(--gm-border); }
.gm-don-title { font-size: 1rem; font-weight: 900; color: var(--gm-navy); margin: 0 0 6px; }
.gm-don-text { font-size: .85rem; color: var(--gm-text-light); line-height: 1.5; margin: 0 0 10px; }
.gm-don-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.gm-don-chip {
  min-width: 56px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--gm-border); background: #fff; color: var(--gm-navy);
  font-family: 'Lato', sans-serif; font-weight: 800; font-size: .9rem; cursor: pointer; touch-action: manipulation;
}
.gm-don-chip:hover { border-color: var(--gm-navy); }
.gm-don-chip.is-on { background: var(--gm-navy); border-color: var(--gm-navy); color: #fff; }
#gm-don-other { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1.5px solid var(--gm-border); border-radius: 8px; font-family: 'Lato', sans-serif; font-size: 1rem; color: var(--gm-navy); margin: 0 0 8px; }
#gm-don-other:focus { outline: none; border-color: var(--gm-navy); }
.gm-don-legal { font-size: .78rem; color: var(--gm-text-light); line-height: 1.45; margin: 4px 0 8px; }
