/* ==========================================================================
   CHERIKEY — shop page (single-product buy page)
   ========================================================================== */

.buy-section { padding-top: clamp(18px, 3vw, 34px); }

.buy { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(26px, 4vw, 56px); align-items: start; }
/* minmax(0, …): the non-wrapping thumbnail row must scroll, not widen the column past the screen */
@media (max-width: 880px) { .buy { grid-template-columns: minmax(0, 1fr); } }

.buy__gallery { position: sticky; top: calc(var(--header-h) + 18px); }
@media (max-width: 880px) { .buy__gallery { position: static; } }
/* Wix photos are mostly 4:3 — show the whole photo, never crop it */
.buy__gallery .gallery__main { aspect-ratio: 4 / 3; }
.buy__gallery .gallery__main img { object-fit: contain; }
.buy__gallery .gallery__thumbs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.buy__gallery .gallery__thumbs button { flex: 0 0 auto; }

.buy__title { font-size: clamp(2rem, 3.6vw, 2.8rem); margin: 0 0 6px; }
.buy__rating { margin: 0 0 10px; min-height: 1px; }
.buy__rating a { color: inherit; text-decoration: none; }
.buy__pitch { color: var(--ink-600); font-size: 1.02rem; margin: 0 0 20px; max-width: 46ch; }
.buy__label { font-weight: 600; font-size: .9rem; margin: 0 0 10px; }

/* Pack tiles */
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
@media (max-width: 420px) { .packs { gap: 7px; } }
.packtile {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 22px 8px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: #fff; font: inherit; color: var(--ink); cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.packtile:hover { border-color: var(--magenta-100); }
@media (hover: hover) { .packtile:hover { transform: translateY(-2px); } }
.packtile[aria-checked="true"] { border-color: var(--magenta); background: var(--magenta-050); box-shadow: 0 0 0 3px var(--magenta-100); }
.packtile:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }
.packtile.is-out { opacity: .5; cursor: not-allowed; }
.packtile__tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--pine); color: #fff; font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  padding: 3px 9px; border-radius: var(--r-pill);
}
.packtile__keys { display: flex; gap: 3px; height: 18px; margin-bottom: 8px; }
.packtile__keys i { width: 12px; height: 16px; border-radius: 3px; border: 1.5px solid var(--ink-400); background: var(--cream-200); }
.packtile[aria-checked="true"] .packtile__keys i { border-color: var(--magenta); background: #fff; }
.packtile__name { font-family: var(--font-display); font-size: 1.02rem; line-height: 1.2; }
.packtile__line { font-size: .74rem; color: var(--ink-600); margin: 2px 0 8px; line-height: 1.3; min-height: 2.6em; }
.packtile__price { font-weight: 700; font-size: 1.05rem; }
.packtile__each { font-size: .74rem; color: var(--ink-400); }

/* Price + button */
.buy__price { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 14px; flex-wrap: wrap; }
.buy__price .price { font-size: clamp(1.8rem, 3vw, 2.2rem); letter-spacing: -.02em; }
.buy__price s { color: var(--ink-400); font-size: 1.05rem; }
.buy__off { background: var(--magenta); color: #fff; font-weight: 700; font-size: .8rem; padding: 3px 9px; border-radius: var(--r-pill); }
.buy .buy-row { display: flex; gap: 12px; align-items: stretch; }
.buy .buy__cta { flex: 1; justify-content: center; }

.buy__ship { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 14px; padding: 12px 14px;
  background: var(--pine-100); color: var(--pine-700); border-radius: var(--r-md); font-size: .9rem; }
.buy__ship svg { width: 22px; height: 22px; flex: 0 0 auto; }
.buy__trust { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.buy__trust li { display: flex; gap: 8px; align-items: center; font-size: .86rem; color: var(--ink-600); }
.buy__trust svg { width: 18px; height: 18px; color: var(--magenta); flex: 0 0 auto; }

/* Why */
.why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 960px) { .why { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .why { grid-template-columns: 1fr; } }
.why__item { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 22px; }
.why__icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--magenta-050); color: var(--magenta); margin-bottom: 12px; }
.why__icon svg { width: 22px; height: 22px; }
.why__item h3 { font-size: 1.05rem; margin: 0 0 6px; }
.why__item p { font-size: .9rem; color: var(--ink-600); margin: 0; }

/* How */
.how { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: how; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr; } }
.how li { counter-increment: how; display: flex; flex-direction: column; gap: 4px; padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line-soft); background: var(--paper); }
.how li::before { content: counter(how); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--magenta); color: #fff; font-weight: 700; margin-bottom: 8px; }
.how b { font-family: var(--font-display); font-size: 1.05rem; }
.how span { color: var(--ink-600); font-size: .92rem; }

/* Gifts */
.gifts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .gifts { grid-template-columns: 1fr; } }
.gift { margin: 0; background: var(--paper); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-soft); }
.gift img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gift figcaption { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.gift b { font-family: var(--font-display); font-size: 1.05rem; }
.gift span { color: var(--ink-600); font-size: .9rem; }

/* Specs */
.specs-wrap { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 820px) { .specs-wrap { grid-template-columns: 1fr; } }
.specs { display: grid; grid-template-columns: 130px 1fr; margin: 0; background: var(--paper);
  border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; font-size: .93rem; }
.specs dt, .specs dd { padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--line-soft); }
.specs dt { color: var(--ink-400); font-weight: 600; }
.specs dt:nth-last-of-type(1), .specs dd:last-of-type { border-bottom: 0; }
@media (max-width: 460px) { .specs { grid-template-columns: 1fr; } .specs dt { padding-bottom: 0; border-bottom: 0; } }

/* Sticky buy bar — phones only */
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--paper);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(28,42,46,.08);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  transform: translateY(110%); visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s; }   /* hidden = out of tab order too */
.buybar.is-on { transform: none; visibility: visible; transition-delay: 0s; }
.buybar__in { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.buybar__in > span { display: flex; flex-direction: column; line-height: 1.25; font-size: .88rem; }
.buybar__in .price { font-size: 1.05rem; }
@media (min-width: 881px) { .buybar { display: none; } }
#app-badge-slot .app-badges { justify-content: center; }

/* Product description */
.desc { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 820px) { .desc { grid-template-columns: 1fr; } }
.desc__text p:not(.eyebrow) { color: var(--ink-600); font-size: 1.02rem; max-width: 62ch; }
.desc__box { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 24px; }
.desc__box h3 { font-size: 1.1rem; margin: 0; }
.desc__box .checklist li svg { width: 19px; height: 19px; color: var(--leaf); flex: 0 0 auto; margin-top: 3px; }

/* Phones */
@media (max-width: 880px) {
  .page-shop { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }   /* room for the sticky buy bar */
  /* Lift toasts above the sticky buy bar while it is showing */
  .buybar-on .toast-host { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (max-width: 400px) {
  .packs { gap: 6px; }
  .packtile { padding: 20px 4px 12px; }
  .packtile__tag { font-size: .62rem; padding: 3px 7px; }
  .packtile__tag-x { display: none; }           /* "Save 15% each" -> "Save 15%" */
  .packtile__name { font-size: .9rem; }
  .packtile__line { font-size: .68rem; }
}
@media (max-width: 560px) {
  #shop-reviews .field-row { grid-template-columns: 1fr; display: grid; gap: 0; }
  .buy__trust { grid-template-columns: 1fr 1fr; gap: 10px 10px; }
  .buy__trust li { font-size: .82rem; }
  .packtile__line { font-size: .7rem; }
}
