/* ============================================================
   GearForPet Child — extras.css
   Card animations · Back-to-top · Pros/Cons · Comparison
   tables · Star rating widget · Sticky CTA JS hooks
   ============================================================ */

/* ── Card Entrance Animations ─────────────────────────────── */
@keyframes gfp-fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gfp-animate {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.gfp-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay helpers */
.gfp-animate[data-delay="1"] { transition-delay: 0.10s; }
.gfp-animate[data-delay="2"] { transition-delay: 0.20s; }
.gfp-animate[data-delay="3"] { transition-delay: 0.30s; }
.gfp-animate[data-delay="4"] { transition-delay: 0.40s; }
.gfp-animate[data-delay="5"] { transition-delay: 0.50s; }
.gfp-animate[data-delay="6"] { transition-delay: 0.60s; }

/* ── Back-to-Top Button ───────────────────────────────────── */
#gfp-back-to-top {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 997;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gfp-navy);
  color: var(--gfp-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(31,42,68,0.25);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  pointer-events: none;
}
#gfp-back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#gfp-back-to-top:hover { background: var(--gfp-green); }
#gfp-back-to-top:focus-visible {
  outline: 2px solid var(--gfp-green);
  outline-offset: 3px;
}

/* ── Scroll-aware Header Shadow ──────────────────────────── */
.site-header.is-scrolled,
header.kadence-header.is-scrolled {
  box-shadow: 0 2px 20px rgba(31,42,68,0.14) !important;
}

/* ── Reading Progress Bar ─────────────────────────────────── */
#gfp-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gfp-green) 0%, var(--gfp-green-dark) 100%);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── Pros / Cons (extras version with animation) ─────────── */
.gfp-pros-cons.is-visible .gfp-pros,
.gfp-pros-cons.is-visible .gfp-cons {
  animation: gfp-fade-up 0.4s ease both;
}
.gfp-pros-cons.is-visible .gfp-cons {
  animation-delay: 0.1s;
}

/* ── Comparison Table (responsive scroll) ────────────────── */
.gfp-comparison-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  box-shadow: var(--gfp-shadow);
}
.gfp-comparison-wrap .gfp-comparison-table {
  box-shadow: none;
  min-width: 540px;
}

/* Highlight "Best" column */
.gfp-comparison-table .col-best {
  background: rgba(60,207,145,0.07);
  font-weight: 600;
}
.gfp-comparison-table thead .col-best {
  background: var(--gfp-green);
  color: var(--gfp-white);
}

/* ── Star Rating Widget (extras polish) ──────────────────── */
.gfp-rating-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gfp-border);
}
.gfp-rating-block:last-child { border-bottom: none; }
.gfp-rating-block .label {
  flex: 1;
  font-size: 0.875rem;
  color: var(--gfp-text);
}
.gfp-rating-bar {
  flex: 2;
  height: 6px;
  background: var(--gfp-border);
  border-radius: 99px;
  overflow: hidden;
}
.gfp-rating-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gfp-green) 0%, var(--gfp-green-dark) 100%);
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
  width: 0; /* animated in by JS */
}

/* ── Review Score Badge ───────────────────────────────────── */
.gfp-score-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gfp-green);
  color: var(--gfp-white);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(60,207,145,0.4);
}
.gfp-score-badge small {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.85;
}

/* ── Email Form — success state ───────────────────────────── */
.email-form-row.is-success input[type="email"] {
  border: 1px solid var(--gfp-green);
}
.gfp-form-message {
  margin-top: 10px;
  font-size: 0.85rem;
  font-family: var(--font-heading);
  color: var(--gfp-green-dark);
  display: none;
}
.gfp-form-message.is-visible { display: block; }
.gfp-form-message.is-error   { color: #DC2626; }

/* ── Cookie/Notice Banner ─────────────────────────────────── */
#gfp-notice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--gfp-navy);
  color: rgba(255,255,255,0.85);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  transform: translateY(100%);
  transition: transform 0.35s ease;
}
#gfp-notice.is-visible { transform: translateY(0); }
#gfp-notice a { color: var(--gfp-green); text-decoration: underline; }
#gfp-notice-close {
  background: var(--gfp-green);
  color: var(--gfp-white);
  border: none;
  padding: 8px 18px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Dark mode overrides for extras ──────────────────────── */
@media (prefers-color-scheme: dark) {
  #gfp-back-to-top { background: var(--gfp-navy-light); }
  .gfp-comparison-wrap { box-shadow: none; border: 1px solid var(--gfp-border); }
  #gfp-notice { background: #0F1623; border-top: 1px solid var(--gfp-border); }
}

/* ── Reduce motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gfp-animate,
  .gfp-animate.is-visible,
  .gfp-rating-bar-fill {
    transition: none !important;
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
