/* =====================================================================
   Pack-Modern v1 — micro-animations, product cards, hero polish
   Depends on design tokens already declared in base.html :root
   ===================================================================== */

/* ---------- Scroll-reveal (used with data-reveal) ------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 650ms cubic-bezier(.22,.61,.36,1),
              transform 650ms cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Honor user reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .mesh-accent::before { animation: none !important; }
  .text-grad { animation: none !important; }
}

/* Stagger helpers (delay children) */
[data-reveal-stagger] > * { transition-delay: 0ms; }
[data-reveal-stagger] > *:nth-child(1) { transition-delay: 40ms; }
[data-reveal-stagger] > *:nth-child(2) { transition-delay: 90ms; }
[data-reveal-stagger] > *:nth-child(3) { transition-delay: 140ms; }
[data-reveal-stagger] > *:nth-child(4) { transition-delay: 190ms; }
[data-reveal-stagger] > *:nth-child(5) { transition-delay: 240ms; }
[data-reveal-stagger] > *:nth-child(6) { transition-delay: 290ms; }
[data-reveal-stagger] > *:nth-child(7) { transition-delay: 340ms; }
[data-reveal-stagger] > *:nth-child(8) { transition-delay: 390ms; }

/* ---------- Product card v2 (glassmorphism + 3D hover) -------------- */
.product-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 400ms cubic-bezier(.22,.61,.36,1),
              box-shadow 400ms cubic-bezier(.22,.61,.36,1),
              border-color 250ms ease,
              background 250ms ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.product-card::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  border-radius: inherit;
  background: linear-gradient(135deg,
    rgba(236,72,153,.10) 0%,
    rgba(168,85,247,.05) 38%,
    transparent 70%);
  opacity: 0;
  transition: opacity 350ms ease;
  pointer-events: none;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 18px 40px -20px rgba(236,72,153,.45),
    0 8px 20px -10px rgba(0,0,0,.6);
  border-color: rgba(236,72,153,.35) !important;
}
.product-card:hover::before { opacity: 1; }
.product-card > * { position: relative; z-index: 1; }

/* Shine sweep on hover over the banner */
.product-card__banner {
  position: relative;
}
.product-card__banner::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg,
    transparent 35%,
    rgba(255,255,255,.10) 50%,
    transparent 65%);
  transform: translateX(-120%);
  transition: transform 750ms ease;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: overlay;
}
.product-card:hover .product-card__banner::after {
  transform: translateX(120%);
}

/* ---------- Shiny badges (Top / Nuevo / Flash) ---------------------- */
.badge-modern {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  position: relative; overflow: hidden;
  box-shadow:
    0 6px 18px -8px rgba(0,0,0,.6),
    inset 0 1px 0 rgba(255,255,255,.28);
  backdrop-filter: blur(6px);
}
.badge-modern--top {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #fff;
}
.badge-modern--nuevo {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.badge-modern--flash {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
}
.badge-modern--premium {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #1f2937;
}
.badge-modern::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(115deg,
    transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-110%);
  animation: badgeShine 4s ease-in-out infinite;
  animation-delay: 1s;
}
@keyframes badgeShine {
  0%, 65%, 100% { transform: translateX(-110%); }
  80% { transform: translateX(110%); }
}

/* ---------- Hero platform ribbon (floating chips) ------------------ */
.platform-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  font-size: 12px; font-weight: 600;
  color: #e4e4e7;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
  transition: transform 220ms cubic-bezier(.22,.61,.36,1),
              background 220ms ease, border-color 220ms ease;
}
.platform-chip:hover {
  transform: translateY(-2px);
  background: rgba(236,72,153,.10);
  border-color: rgba(236,72,153,.35);
  color: #fff;
}
.platform-chip .dot {
  width: 6px; height: 6px; border-radius: 9999px;
  background: #34d399;
  box-shadow: 0 0 10px rgba(52,211,153,.7);
}

/* ---------- Stat counter: large pulsing pill ----------------------- */
.stat-pulse {
  position: relative;
}
.stat-pulse::after {
  content: '';
  position: absolute; top: 14px; right: 14px;
  width: 8px; height: 8px;
  border-radius: 9999px;
  background: #34d399;
  box-shadow: 0 0 12px rgba(52,211,153,.7);
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* ---------- Floating CTA / comprar sticky (mobile) ----------------- */
.floating-cta {
  position: sticky; bottom: 12px; left: 0; right: 0; z-index: 30;
}

/* ---------- Skeleton loader (used while polling) ------------------- */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,.04) 0%,
    rgba(255,255,255,.10) 50%,
    rgba(255,255,255,.04) 100%);
  background-size: 200% 100%;
  animation: skelShimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skelShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Underline link w/ gradient ----------------------------- */
.link-underline {
  position: relative;
  background-image: linear-gradient(90deg, #ec4899, #a855f7);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 250ms ease;
  padding-bottom: 2px;
}
.link-underline:hover {
  background-size: 100% 2px;
}

/* ---------- Category card hover halo ------------------------------- */
.cat-card { position: relative; overflow: hidden; }
.cat-card::before {
  content: '';
  position: absolute;
  inset: -40% 50% 50% -40%;
  background: radial-gradient(closest-side,
    rgba(236,72,153,.35), transparent 70%);
  opacity: 0;
  transition: opacity 350ms ease, transform 450ms ease;
  pointer-events: none;
}
.cat-card:hover::before {
  opacity: 1;
  transform: translate(30%, 30%);
}

/* ---------- Number counter transition (used w/ counter JS) ---------- */
.num-flip {
  font-variant-numeric: tabular-nums;
  transition: color 300ms ease;
}

/* ---------- Small utility: soft inner glow on focus ---------------- */
.glow-ring:focus-within {
  box-shadow: 0 0 0 3px rgba(236,72,153,.18);
  border-color: rgba(236,72,153,.55) !important;
}

/* ---------- Mobile bottom navigation (floating island, modern 2026) -- */
.mobile-bottom-nav { display: none; }
@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    align-items: stretch;
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 45;
    padding: 8px;
    gap: 4px;
    border-radius: 22px;
    background:
      linear-gradient(135deg, rgba(168,85,247,.10), rgba(236,72,153,.06) 55%, rgba(20,18,32,.85) 100%),
      rgba(12,10,18,.78);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(168,85,247,.22);
    box-shadow:
      0 18px 40px -10px rgba(0,0,0,.55),
      0 4px 16px -4px rgba(236,72,153,.25),
      inset 0 1px 0 rgba(255,255,255,.05);
  }
  /* deja espacio para que el contenido no quede debajo de la barra */
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  /* Subir la burbuja del chat para que no choque con el nav inferior móvil */
  #jhz-chat-bubble { bottom: calc(96px + env(safe-area-inset-bottom)) !important; right: 14px !important; }
  #jhz-chat-panel { bottom: calc(96px + env(safe-area-inset-bottom)) !important; right: 14px !important; }
}

.mbn-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 4px 6px;
  color: rgba(244,244,245,.62);
  font-size: 10.5px; font-weight: 600; letter-spacing: .015em;
  text-align: center; border-radius: 16px;
  transition: color 240ms ease, background 280ms ease, transform 160ms ease;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
.mbn-item:hover { color: rgba(255,255,255,.85); }
.mbn-item:active { transform: scale(0.92); }
.mbn-item .icon {
  width: 22px; height: 22px; stroke-width: 1.9;
  transition: transform 280ms cubic-bezier(.34,1.56,.64,1), filter 260ms ease;
}
.mbn-item.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(236,72,153,.32), rgba(168,85,247,.36));
  box-shadow:
    0 4px 16px -4px rgba(236,72,153,.5),
    inset 0 1px 0 rgba(255,255,255,.18);
}
.mbn-item.is-active .icon {
  transform: translateY(-2px) scale(1.08);
  filter: drop-shadow(0 2px 6px rgba(236,72,153,.55));
}
.mbn-item.is-active::after {
  content: ''; position: absolute;
  bottom: -3px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, #ec4899, #a855f7);
  box-shadow: 0 0 12px rgba(236,72,153,.7);
}

.mbn-badge {
  position: absolute;
  top: 4px; right: calc(50% - 18px);
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #fff;
  font-size: 10px; font-weight: 800; line-height: 17px; text-align: center;
  border: 1.5px solid rgba(12,10,18,.95);
  box-shadow: 0 2px 8px -1px rgba(236,72,153,.7);
  animation: mbn-badge-pop .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes mbn-badge-pop {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------- Checkout progress (modern, mobile-friendly) ------------- */
.ck-progress {
  display: flex; align-items: center; justify-content: space-between;
  position: relative;
  list-style: none; padding: 0; margin: 0;
  gap: 0;
}
.ck-progress::before {
  content: ''; position: absolute;
  left: 22px; right: 22px; top: 18px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--line), var(--line));
  z-index: 0;
}
.ck-progress__step {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1 1 0; min-width: 0; max-width: 33%;
  color: rgba(244,244,245,.55);
  font-size: 12px; font-weight: 600; letter-spacing: .015em;
  text-align: center;
}
.ck-progress__dot {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 9999px;
  background: rgba(20,18,32,.92);
  border: 1.5px solid var(--line);
  transition: all 240ms cubic-bezier(.34,1.56,.64,1);
}
.ck-progress__num {
  font-size: 13px; font-weight: 700;
  color: rgba(244,244,245,.6);
}
.ck-progress__label {
  font-size: 12px; line-height: 1.2;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ck-progress__step.is-active { color: #fff; }
.ck-progress__step.is-active .ck-progress__dot {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  border-color: rgba(236,72,153,.55);
  box-shadow: 0 0 0 6px rgba(236,72,153,.16), 0 6px 18px -6px rgba(236,72,153,.55);
  transform: scale(1.06);
}
.ck-progress__step.is-active .ck-progress__num { color: #fff; }
.ck-progress__step.is-done { color: #34d399; }
.ck-progress__step.is-done .ck-progress__dot {
  background: rgba(16,185,129,.18);
  border-color: rgba(16,185,129,.6);
}
.ck-progress__step.is-done .ck-progress__num { color: #34d399; }
@media (max-width: 480px) {
  .ck-progress__dot { width: 30px; height: 30px; }
  .ck-progress::before { left: 18px; right: 18px; top: 15px; }
  .ck-progress__label { font-size: 11px; }
  .ck-progress__num { font-size: 12px; }
}

/* ---------- Empty cart state --------------------------------------- */
.cart-empty { max-width: 64rem; margin: 0 auto; }
.cart-empty__hero {
  position: relative; overflow: hidden;
  padding: 3rem 1.25rem 2.5rem;
  border-radius: 24px;
  background:
    radial-gradient(60% 80% at 50% -10%, rgba(168,85,247,.20), transparent 70%),
    radial-gradient(50% 60% at 50% 110%, rgba(236,72,153,.14), transparent 70%),
    rgba(12,10,18,.55);
  border: 1px solid rgba(168,85,247,.18);
  text-align: center;
}
@media (min-width: 768px) {
  .cart-empty__hero { padding: 4rem 2rem 3rem; }
}
.cart-empty__halo {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -55%);
  width: 360px; height: 360px;
  border-radius: 9999px;
  background: radial-gradient(closest-side, rgba(236,72,153,.18), transparent 70%);
  pointer-events: none;
  animation: cartEmptyPulse 6s ease-in-out infinite;
}
@keyframes cartEmptyPulse {
  0%, 100% { opacity: .65; transform: translate(-50%, -55%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -55%) scale(1.08); }
}
.cart-empty__icon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 96px; height: 96px; border-radius: 28px;
  margin: 0 auto;
  color: #fff;
  background: linear-gradient(135deg, rgba(236,72,153,.28), rgba(168,85,247,.22));
  border: 1px solid rgba(236,72,153,.4);
  box-shadow:
    0 18px 40px -10px rgba(236,72,153,.45),
    inset 0 1px 0 rgba(255,255,255,.15);
}
.cart-empty__icon svg { width: 54px; height: 54px; }
.cart-empty__title {
  position: relative;
  font-family: 'Geist','Inter',system-ui,sans-serif;
  font-size: 1.75rem; line-height: 1.15;
  font-weight: 800; letter-spacing: -.01em;
  color: #fff;
  margin-top: 1.25rem;
}
@media (min-width: 768px) {
  .cart-empty__title { font-size: 2.25rem; }
}
.cart-empty__sub {
  position: relative;
  margin: .65rem auto 0;
  max-width: 36rem;
  font-size: .95rem;
  color: rgba(244,244,245,.7);
}
.cart-empty__cta {
  position: relative;
  margin-top: 1.75rem;
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center;
}
.cart-empty__trust {
  position: relative;
  list-style: none; padding: 0;
  margin: 2rem auto 0;
  display: flex; flex-wrap: wrap; gap: .5rem .75rem;
  justify-content: center;
  font-size: 12px;
}
.cart-empty__trust li {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem; border-radius: 9999px;
  color: rgba(244,244,245,.8); font-weight: 600;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.cart-empty__trust svg { width: 14px; height: 14px; color: rgba(245,158,11,.85); }
.cart-empty__trust li:nth-child(1) svg { color: #34d399; }
.cart-empty__trust li:nth-child(2) svg { color: #fbbf24; }
.cart-empty__trust li:nth-child(3) svg { color: #ec4899; }
.cart-empty__suggested { margin-top: 2.25rem; }

/* Legacy: mantener .ck-steps por compatibilidad si otra plantilla aún lo usa. */
.ck-steps {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ck-step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 9999px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: #a1a1aa;
  transition: all 200ms ease;
}
.ck-step.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(236,72,153,.15), rgba(168,85,247,.1));
  border-color: rgba(236,72,153,.4);
  box-shadow: 0 6px 20px -10px rgba(236,72,153,.5);
}
.ck-step.is-done {
  color: #34d399;
  border-color: rgba(52,211,153,.3);
  background: rgba(52,211,153,.08);
}
.ck-step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 9999px;
  background: rgba(255,255,255,.08);
  font-size: 11px; font-weight: 700;
}
.ck-step.is-active .ck-step__num {
  background: linear-gradient(135deg, #ec4899, #a855f7); color: #fff;
}
.ck-step.is-done .ck-step__num {
  background: #10b981; color: #fff;
}
.ck-sep {
  flex: 1; height: 1px; min-width: 10px; max-width: 60px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* Payment method chip with logos */
.pay-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
}
.pay-option:hover {
  border-color: rgba(236,72,153,.35);
  background: rgba(236,72,153,.04);
  transform: translateY(-1px);
}
.pay-option input[type=radio] {
  accent-color: var(--pink);
  margin-top: 2px;
}
.pay-option.is-checked {
  border-color: var(--pink);
  background: linear-gradient(135deg, rgba(236,72,153,.08), rgba(168,85,247,.05));
  box-shadow: 0 10px 28px -16px rgba(236,72,153,.5);
}
.pay-option__logo {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06);
  font-size: 20px; flex-shrink: 0;
}
.pay-option.logo--yape .pay-option__logo {
  background: linear-gradient(135deg, #7b2cbf, #9d4edd);
  color: #fff;
}
.pay-option.logo--mp .pay-option__logo {
  background: linear-gradient(135deg, #00b1ea, #009ee3);
  color: #fff;
}

/* ---------- Animated gradient border (ALE: used on key CTAs) ------- */
.grad-border {
  position: relative;
}
.grad-border::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from 180deg at 50% 50%,
    rgba(236,72,153,.6),
    rgba(168,85,247,.3),
    rgba(236,72,153,.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: conicSpin 6s linear infinite;
  pointer-events: none;
}
@keyframes conicSpin {
  to { transform: rotate(360deg); }
}
