/**
 * Gallery / product page extras — listicle upgrade + exit-intent modal.
 *
 * Drop into any affiliate site that already has the base styles.css (with
 * --accent, --card-bg, --border-subtle, --radius-md, --radius-lg, --text-main,
 * --text-subtle, --shadow-soft, --accent-soft, --accent-strong, --accent-glow).
 *
 * Pairs with gallery.js + exit-intent.js (and product.js setting
 * window.SITE_TOP_PICK).
 */

/* ── Exit-intent product modal ─────────────────────────────────────────────── */

.fxp-exit-root { position: relative; z-index: 1000; }

.fxp-exit-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 24, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.22s ease;
  z-index: 1000;
}

.fxp-exit-root.is-visible .fxp-exit-backdrop { opacity: 1; }

.fxp-exit-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  width: min(880px, 100%);
  max-width: 880px;
  min-height: 360px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  background: #0f172a;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.fxp-exit-root.is-visible .fxp-exit-card { transform: scale(1); opacity: 1; }

.fxp-exit-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}

.fxp-exit-close:hover { background: rgba(255, 255, 255, 0.22); }

.fxp-exit-dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #111827 100%);
  color: #fff;
  padding: 36px 30px;
  display: flex; flex-direction: column; justify-content: center;
  gap: 14px;
}

.fxp-exit-name {
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}

.fxp-exit-tag { margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.85); }

.fxp-exit-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #2f80ff 0%, #1d6cf0 100%);
  color: #fff;
  font-weight: 700; font-size: 16px;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 14px 30px rgba(45, 122, 245, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.fxp-exit-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(45, 122, 245, 0.6);
}

.fxp-exit-cta span { font-size: 20px; }

.fxp-exit-foot { margin: 6px 0 0; color: rgba(255, 255, 255, 0.55); font-size: 12px; }

.fxp-exit-light {
  position: relative;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0% 100%);
}

.fxp-exit-img {
  max-width: 86%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

.fxp-exit-badge {
  position: absolute;
  top: 26px; left: 28%;
  z-index: 1;
  background: linear-gradient(180deg, #f43f5e 0%, #e11d48 100%);
  color: #fff;
  font-weight: 800; font-size: 16px;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(225, 29, 72, 0.45);
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .fxp-exit-card { grid-template-columns: 1fr; grid-template-rows: auto auto; min-height: 0; }
  .fxp-exit-dark { padding: 24px 22px 22px; order: 2; }
  .fxp-exit-light { order: 1; clip-path: none; padding: 18px; min-height: 200px; }
  .fxp-exit-img { max-height: 200px; }
  .fxp-exit-badge { top: 14px; left: 14px; font-size: 14px; padding: 6px 12px; }
  .fxp-exit-cta { width: 100%; justify-content: center; }
}

/* ── "How we picked" methodology card ─────────────────────────────────────── */

.methodology-card {
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin: 40px 0 32px;
  box-shadow: var(--shadow-soft);
}

.methodology-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.methodology-icon {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.methodology-card h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }

.methodology-list {
  list-style: none; padding: 0; margin: 0 0 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
}

.methodology-list li {
  position: relative;
  padding-left: 22px;
  font-size: 14px; line-height: 1.5;
  color: var(--text-main);
}

.methodology-list li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 700;
}

.methodology-note { margin: 4px 0 0; font-size: 12.5px; color: var(--text-subtle); font-style: italic; }

@media (max-width: 720px) {
  .methodology-list { grid-template-columns: 1fr; }
  .methodology-card { padding: 18px; }
}

/* ── Sticky mobile top-pick CTA (with slide-up reveal) ────────────────────── */

.gallery-sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.18);
  z-index: 60;
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0) + 10px);
  transform: translateY(120%);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.gallery-sticky-cta.is-visible { transform: translateY(0); pointer-events: auto; }
.gallery-sticky-cta[hidden] { display: none; }

.gallery-sticky-cta .gsc-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: 720px; margin: 0 auto;
}

.gsc-img {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f1f5f9;
}

.gsc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gsc-medal { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #b58800; }
.gsc-title {
  font-size: 13px; font-weight: 600; color: var(--text-main);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.gsc-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--accent);
  color: #ecfeff;
  font-weight: 700; font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--accent-glow);
}

@media (min-width: 760px) {
  .gallery-sticky-cta { display: none; }
  body { padding-bottom: 0; }
}

@media (max-width: 759px) {
  body { padding-bottom: 78px; }
}

/* ── Quick picks (top 3 mini-cards) ────────────────────────────────────────── */

.quick-picks { margin: 0 0 32px; }
.qp-header-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.qp-heading { font-size: clamp(18px, 2vw, 22px); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.qp-read-full { font-size: 13px; color: var(--text-subtle); text-decoration: none; font-weight: 600; }
.qp-read-full:hover { color: var(--accent); text-decoration: underline; }
.qp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.qp-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  text-align: left;
}

.qp-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1); border-color: var(--accent); }

.qp-card--gold { border-color: #f0c14a; box-shadow: 0 10px 24px rgba(240, 193, 74, 0.22); }
.qp-card--gold:hover { border-color: #e3aa1c; }

.qp-image { width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: #f1f5f9; }
.qp-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.qp-medal {
  display: inline-flex; align-items: center; align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em;
}

.qp-medal--gold   { background: linear-gradient(135deg, #fff7d6, #fde68a); color: #7c5a00; }
.qp-medal--silver { background: linear-gradient(135deg, #f4f7fb, #d8dde6); color: #475569; }
.qp-medal--bronze { background: linear-gradient(135deg, #fce7d2, #f5b886); color: #7a3b00; }

.qp-title {
  font-size: 14px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.qp-rating { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-subtle); }
.qp-rating .rating-stars { color: #f59e0b; letter-spacing: 1px; }

.qp-cta {
  margin-top: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent); color: #ecfeff;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 8px 20px var(--accent-glow);
}
.qp-cta .qp-ext-icon { width: 14px; height: 14px; flex-shrink: 0; }
.qp-ad-tag { font-size: 10px; font-weight: 700; opacity: 0.8; margin-right: 2px; letter-spacing: 0.04em; }
.qp-cta-note { display: block; text-align: center; font-size: 11px; color: var(--text-subtle); margin-top: 6px; letter-spacing: 0.01em; }

.qp-card--gold .qp-cta { background: #b58800; box-shadow: 0 8px 20px rgba(181, 136, 0, 0.4); }
.qp-card--gold .qp-cta:hover { background: #946d00; }

@media (max-width: 720px) {
  .qp-grid { grid-template-columns: 1fr; gap: 12px; }
  .qp-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    grid-template-areas: "img medal" "img title" "img rating" "cta cta";
    align-items: center;
    padding: 12px;
    gap: 4px 14px;
  }
  .qp-image { grid-area: img; aspect-ratio: 1 / 1; width: 88px; }
  .qp-medal { grid-area: medal; align-self: start; }
  .qp-title { grid-area: title; font-size: 13.5px; -webkit-line-clamp: 2; }
  .qp-rating { grid-area: rating; }
  .qp-cta { grid-area: cta; margin-top: 8px; padding: 12px; width: 100%; }
}

/* ── Compact gallery hero + jump-to-pick button ───────────────────────────── */

.gallery-hero { min-height: 200px !important; margin-bottom: 24px !important; }
@media (min-width: 720px) { .gallery-hero { min-height: 260px !important; } }
.gallery-hero-content { padding: 24px 0 !important; }
@media (min-width: 720px) { .gallery-hero-content { padding: 36px 0 !important; } }

.gh-jump-btn {
  display: inline-flex; align-items: center;
  margin-top: 14px;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-main);
  font-weight: 700; font-size: 14px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gh-jump-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3); }

/* ── Hero meta pills ──────────────────────────────────────────────────────── */

.gallery-hero-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; opacity: 1 !important; }

.ghm-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.01em;
  backdrop-filter: blur(4px);
}

.ghm-pill--cat {
  text-transform: capitalize;
  background: rgba(13, 148, 136, 0.32);
  border-color: rgba(20, 184, 166, 0.5);
}

.ghm-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}

/* ── Rank medals on full cards ────────────────────────────────────────────── */

.gp-rank { flex-shrink: 0; display: flex; align-items: flex-start; }

.gp-medal {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--accent-soft); color: var(--accent);
  white-space: nowrap;
  border: 1px solid transparent;
}

.gp-medal--gold {
  background: linear-gradient(135deg, #fff7d6, #fde68a);
  color: #7c5a00;
  border-color: #f0c14a;
  box-shadow: 0 6px 14px rgba(240, 193, 74, 0.4);
}

.gp-medal--silver { background: linear-gradient(135deg, #f4f7fb, #d8dde6); color: #475569; border-color: #cbd5e1; }
.gp-medal--bronze { background: linear-gradient(135deg, #fce7d2, #f5b886); color: #7a3b00; border-color: #e7a572; }

.gallery-product { position: relative; }
.gallery-product.gp-rank-1 {
  border-color: #f0c14a !important;
  box-shadow: 0 14px 36px rgba(240, 193, 74, 0.18), 0 6px 14px rgba(15, 23, 42, 0.06) !important;
}

.gallery-product.gp-rank-1::before {
  content: ""; position: absolute; inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.16), transparent 55%);
}

/* ── Star rating row inside cards ─────────────────────────────────────────── */

.gp-rating-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-subtle);
  margin: -4px 0 4px;
}

.gp-rating-row .rating-stars { color: #f59e0b; letter-spacing: 1px; font-size: 15px; }
.gp-rating-row .rating-num { font-weight: 700; color: var(--text-main); }
.gp-rating-row .rating-count { opacity: 0.85; }
