/* ============================================================================
   PROOFFLUX — store.css
   ----------------------------------------------------------------------------
   ADDITIVE ONLY. Loaded after main.css and only by digital-products.html
   and the product pages (<slug>.html).
   It defines nothing that main.css already provides and overrides nothing,
   so it cannot affect any existing page.

   Every value below comes from the tokens declared in main.css :root — no new
   colours, no new fonts, no new radii.
   ========================================================================== */

/* --- Hiding ---------------------------------------------------------------
   The browser's own rule for the hidden attribute is display:none, but any
   author rule that sets display beats it — and main.css sets .card{display:flex}
   and .grid{display:grid}. Without this, toggling `hidden` on the grid or the
   empty state does nothing and BOTH end up on screen at once.
   Scoped to the store's own elements so nothing else is affected. */

.store-grid[hidden],
.store-empty[hidden],
.store-note[hidden] {
  display: none;
}

/* --- Product grid --------------------------------------------------------- */

.store-grid {
  align-items: stretch;
}

.store-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- Cover ---------------------------------------------------------------- */

.store-card__cover {
  display: block;
  position: relative;
  background: var(--paper-alt);
  border-bottom: 1px solid var(--line-soft);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

/* --- Gallery ---------------------------------------------------------------
   Every image sits in the same box; only the active one is visible. They are
   contained, not cropped, so nothing in a product image is ever cut off. */

.store-gallery {
  background: var(--dark);
}

.store-gallery__open {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.store-gallery__open img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.store-gallery__open img.is-active {
  opacity: 1;
}

.store-gallery__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--dark-line);
  border-radius: 50%;
  background: rgba(12, 12, 16, 0.6);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s var(--ease), background 0.2s var(--ease);
}

.store-gallery__btn--prev { left: var(--gap-xs); }
.store-gallery__btn--next { right: var(--gap-xs); }

.store-gallery:hover .store-gallery__btn,
.store-gallery__btn:focus-visible {
  opacity: 1;
}

.store-gallery__btn:hover {
  background: rgba(12, 12, 16, 0.85);
}

/* Touch screens have no hover, so keep the arrows visible there. */
@media (hover: none) {
  .store-gallery__btn { opacity: 1; }
}

.store-gallery__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--gap-xs);
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.store-gallery__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: background 0.2s var(--ease), width 0.2s var(--ease);
}

.store-gallery__dot.is-active {
  width: 16px;
  border-radius: 3px;
  background: #fff;
}

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

.store-lightbox[hidden] {
  display: none;
}

.store-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 64px;
  background: rgba(12, 12, 16, 0.92);
}

.store-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.store-lightbox__btn,
.store-lightbox__close {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--dark-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.store-lightbox__btn:hover,
.store-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.store-lightbox__btn { top: 50%; transform: translateY(-50%); }
.store-lightbox__btn--prev { left: var(--gap-sm); }
.store-lightbox__btn--next { right: var(--gap-sm); }
.store-lightbox__close { top: var(--gap-sm); right: var(--gap-sm); }

.store-lightbox--single .store-lightbox__btn,
.store-lightbox--single .store-lightbox__count {
  display: none;
}

.store-lightbox__count {
  position: absolute;
  bottom: var(--gap-sm);
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--dark-text);
}

@media (max-width: 560px) {
  .store-lightbox { padding: 64px 12px; }
  .store-lightbox__btn { top: auto; bottom: var(--gap-xs); transform: none; }
}

.store-card__badge {
  position: absolute;
  top: var(--gap-sm);
  left: var(--gap-sm);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

/* --- Body ----------------------------------------------------------------- */

.store-card__body {
  padding: var(--gap) var(--gap) var(--gap-sm);
  flex: 1 1 auto;
}

.store-card__name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 6px;
}

.store-card__desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-600);
  margin: 0;
}

.store-card__points {
  list-style: none;
  margin: var(--gap-sm) 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.store-card__points li {
  position: relative;
  padding-left: 18px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-600);
}

.store-card__points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* --- Foot ----------------------------------------------------------------- */

.store-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  padding: var(--gap-sm) var(--gap) var(--gap);
  border-top: 1px solid var(--line-soft);
  margin-top: auto;
}

.store-card__price {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

.store-card__old-price {
  margin-left: 6px;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ink-400);
}

/* White text on the orange product buttons. */
[data-accent="amazon"] .store-buy {
  --btn-fg: #fff;
}

.store-buy.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.store-card__name a {
  color: inherit;
  text-decoration: none;
}

.store-card__name a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.store-gallery__open--link {
  cursor: pointer;
}

/* --- Product page --------------------------------------------------------- */

.product-page {
  padding-block: 32px 72px;
}

.product-page[hidden],
.product-inside[hidden],
.product-more[hidden] {
  display: none;
}

.product-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--gap-lg);
  font-size: 0.875rem;
  color: var(--ink-500);
}

.product-crumbs a {
  color: var(--ink-600);
}

.product {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.product__media {
  position: sticky;
  top: 96px;
}

.product__media .store-card__cover {
  border: 0;
  border-radius: var(--radius-lg);
}

.product__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.product__thumb {
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--dark);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s var(--ease), border-color 0.2s var(--ease);
}

.product__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product__thumb:hover,
.product__thumb.is-active {
  opacity: 1;
}

.product__thumb.is-active {
  border-color: var(--accent);
}

.product__title {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 10px 0 14px;
}

.product__lead {
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--ink-600);
  margin: 0;
}

.product__price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: var(--gap-lg) 0 var(--gap);
}

.product__price .store-card__price {
  font-size: 1.6rem;
}

.product__price .store-card__old-price {
  font-size: 1rem;
}

.product__save {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 600;
}

.product__trust {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--ink-500);
  text-align: center;
}

.product__heading {
  margin: var(--gap-lg) 0 0;
  padding-top: var(--gap);
  border-top: 1px solid var(--line);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.product__points li {
  font-size: 0.95rem;
}

/* Overview: numbered feature boxes */
.product-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: var(--gap-xl);
}

.product-feature {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.product-feature:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
}

.product-feature__num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-ink);
}

.product-feature h3 {
  margin: 16px 0 8px;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.product-feature p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-600);
}

/* How it works: numbered steps */
.product-steps {
  list-style: none;
  margin: var(--gap-xl) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-lg);
}

.product-step {
  position: relative;
  padding-top: 64px;
}

.product-step__num {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* Line joining the step numbers */
.product-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 60px;
  right: calc(-1 * var(--gap-lg) + 16px);
  border-top: 1px dashed var(--line-strong);
}

.product-step h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.product-step p {
  margin: 0;
  color: var(--ink-600);
  line-height: 1.55;
}

/* Who it's for + Specifications */
.product-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.product-box {
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.product-box__title {
  margin: 0 0 var(--gap);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.product-check {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.product-check li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.5;
  color: var(--ink-800);
}

.product-check svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--accent);
}

.product-specs {
  margin: 0;
}

.product-specs div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: var(--gap-sm);
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.product-specs div:last-child {
  border-bottom: 0;
}

.product-specs dt {
  font-size: 0.875rem;
  color: var(--ink-500);
}

.product-specs dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

/* Every image, large, one under the other */
.product-inside__grid {
  display: grid;
  gap: var(--gap);
  max-width: 1040px;
  margin-inline: auto;
}

.product-inside__item {
  display: block;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--dark);
  cursor: zoom-in;
}

.product-inside__item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Sticky buy bar on phones: price on the left, button on the right */
.product-buybar {
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 16px;
}

.product-buybar .store-card__price {
  flex: 0 0 auto;
}

.product-buybar .btn {
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .product {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-steps,
  .product-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-step:not(:last-child)::after {
    display: none;
  }

  .product__media {
    position: static;
  }
}

/* --- Empty state ---------------------------------------------------------- */

.store-empty {
  max-width: var(--container-narrow);
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 560px) {
  .product-features {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-specs div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .store-card__foot {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .store-card__foot .btn {
    justify-content: center;
  }
}
