/* JCBike - Campañas festivas */

.jcbc {
  --jcbc-accent: #00e000;
  --jcbc-ink: #0b0c0f;
  --jcbc-bg: #121418;
  --jcbc-text: #f4f5f7;
  --jcbc-muted: rgba(244, 245, 247, .72);
  box-sizing: border-box;
  color: var(--jcbc-text);
  font-family: inherit;
}
.jcbc *, .jcbc *::before, .jcbc *::after { box-sizing: border-box; }

/* ---------- Ilustración ---------- */
.jcbc-art { position: relative; overflow: hidden; background: #0b0c0f; }
.jcbc-art svg, .jcbc-art img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Textos comunes ---------- */
.jcbc-body { display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.jcbc-kicker {
  display: flex; align-items: center; gap: 10px;
  margin: 0; color: var(--jcbc-accent);
  font-size: .78rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase;
}
.jcbc-kicker::before { content: ""; width: 26px; height: 2px; background: currentColor; box-shadow: 0 0 10px currentColor; }
.jcbc-title {
  margin: 0; color: #fff;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.2vw, 2.9rem); font-weight: 600; line-height: 1.08; letter-spacing: 0;
  text-transform: none;
}
.jcbc-text { margin: 0; color: var(--jcbc-muted); font-size: 1rem; line-height: 1.55; max-width: 46ch; }

/* Código de descuento */
.jcbc-code { display: flex; flex-direction: column; gap: 6px; }
.jcbc-code__label { color: #fff; font-weight: 700; font-size: .95rem; }
.jcbc-code__btn {
  display: inline-flex; align-items: center; gap: 14px; align-self: flex-start;
  padding: 10px 14px; border: 2px dashed var(--jcbc-accent); border-radius: 10px;
  background: rgba(255, 255, 255, .04); color: #fff; cursor: pointer; font: inherit;
  transition: background .2s;
}
.jcbc-code__btn:hover { background: rgba(255, 255, 255, .1); }
.jcbc-code__value { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.25rem; font-weight: 800; letter-spacing: .12em; }
.jcbc-code__hint { color: var(--jcbc-accent); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.jcbc-code__btn.is-done .jcbc-code__hint { color: #fff; }

/* Cuenta atrás */
.jcbc-count { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.jcbc-count__label { width: 100%; color: var(--jcbc-muted); font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.jcbc-count__box {
  display: flex; flex-direction: column; align-items: center; min-width: 56px; padding: 8px 6px 6px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; background: rgba(255, 255, 255, .05);
}
.jcbc-count__box b { color: #fff; font-size: 1.35rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.jcbc-count__box small { margin-top: 3px; color: var(--jcbc-muted); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }

/* Botón */
.jcbc-btn, .jcbc-btn:visited {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  padding: 14px 26px; border-radius: 999px;
  background: var(--jcbc-accent); color: var(--jcbc-ink) !important;
  font-size: .9rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; text-decoration: none !important;
  box-shadow: 0 10px 28px -10px var(--jcbc-accent);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
button.jcbc-btn { border: 0; cursor: pointer; font-family: inherit; line-height: 1.2; }
.jcbc-btn:hover, .jcbc-btn:focus { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 14px 34px -10px var(--jcbc-accent); }
.jcbc-btn span { transition: transform .2s; }
.jcbc-btn:hover span { transform: translateX(4px); }

/* ---------- Banner de la portada ---------- */
.jcbc-banner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  min-height: 360px; margin: 32px 0; overflow: hidden;
  border-radius: 18px;
  background: var(--jcbc-bg);
  background:
    radial-gradient(600px 300px at 0% 100%, color-mix(in srgb, var(--jcbc-accent) 22%, transparent), transparent 70%),
    var(--jcbc-bg);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .45);
}
.jcbc-banner .jcbc-body { padding: 44px 48px; }
.jcbc-banner .jcbc-art { min-height: 300px; }
.jcbc-banner .jcbc-art::before {
  content: ""; position: absolute; inset: 0 auto 0 0; z-index: 1; width: 90px;
  background: linear-gradient(90deg, var(--jcbc-bg), transparent);
  pointer-events: none;
}

/* ---------- Ventana emergente ---------- */
.jcbc-pop[hidden] { display: none !important; }
.jcbc-pop {
  position: fixed; inset: 0; z-index: 100050;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.jcbc-pop__backdrop {
  position: absolute; inset: 0; background: rgba(8, 9, 12, .62);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .35s;
}
.jcbc-pop__box {
  position: relative; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1fr);
  width: min(860px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  border-radius: 20px; background: var(--jcbc-bg);
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
  opacity: 0; transform: translateY(18px) scale(.97);
  transition: opacity .35s, transform .45s cubic-bezier(.2, 1.2, .4, 1);
}
.jcbc-pop.is-open .jcbc-pop__backdrop { opacity: 1; }
.jcbc-pop.is-open .jcbc-pop__box { opacity: 1; transform: none; }
.jcbc-pop .jcbc-art { min-height: 380px; }
.jcbc-pop .jcbc-body { padding: 40px 38px 36px; }
.jcbc-pop .jcbc-title { font-size: clamp(1.7rem, 2.6vw, 2.4rem); }
.jcbc-pop__close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 26px; line-height: 40px; cursor: pointer;
  transition: background .2s, transform .2s;
}
.jcbc-pop__close:hover { background: rgba(255, 255, 255, .24); transform: rotate(90deg); }

/* Vista previa estática en el back office */
.jcbc-pop.is-static { position: static; padding: 0; display: block; }
.jcbc-pop.is-static .jcbc-pop__backdrop { display: none; }

/* ---------- Móvil ---------- */
@media (max-width: 767px) {
  .jcbc-banner { grid-template-columns: 1fr; min-height: 0; margin: 20px 0; border-radius: 14px; }
  .jcbc-banner .jcbc-art { order: -1; min-height: 0; aspect-ratio: 3 / 2; }
  .jcbc-banner .jcbc-art::before { display: none; }
  .jcbc-banner .jcbc-body { padding: 24px 20px 28px; }

  /* La ventana sale como tarjeta desde abajo y no tapa toda la pantalla */
  .jcbc-pop:not(.is-static) { align-items: flex-end; padding: 0; }
  .jcbc-pop:not(.is-static) .jcbc-pop__box {
    grid-template-columns: 1fr; width: 100%;
    /* dvh = alto real visible (descontando las barras del navegador del móvil) */
    max-height: 86vh; max-height: 86dvh;
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-radius: 20px 20px 0 0; transform: translateY(100%);
  }
  .jcbc-pop:not(.is-static).is-open .jcbc-pop__box { transform: none; }
  .jcbc-pop .jcbc-art { min-height: 0; height: 150px; }
  .jcbc-pop .jcbc-body { padding: 20px 20px 24px; gap: 10px; }
  .jcbc-pop .jcbc-title { font-size: 1.6rem; }
  .jcbc-text { font-size: .93rem; }
  .jcbc-btn { align-self: stretch; justify-content: center; }
  .jcbc-count__box { min-width: 50px; }
}

/* Móviles bajitos (iPhone SE, Android pequeños): todo más compacto para que quepa entero */
@media (max-width: 767px) and (max-height: 760px) {
  .jcbc-pop .jcbc-art { height: 110px; }
  .jcbc-pop .jcbc-body { padding: 16px 18px 18px; gap: 8px; }
  .jcbc-pop .jcbc-title { font-size: 1.4rem; }
  .jcbc-pop .jcbc-text { font-size: .86rem; line-height: 1.4; }
  .jcbc-pop .jcbc-count__label { display: none; }
  .jcbc-pop .jcbc-count__box { min-width: 44px; padding: 5px 4px 4px; }
  .jcbc-pop .jcbc-count__box b { font-size: 1.1rem; }
  .jcbc-pop .jcbc-btn { padding: 12px 18px; }
  .jcbc-pop .jcbc-code__btn { padding: 7px 10px; }
}

/* ---------- Animaciones de las ilustraciones ---------- */
@keyframes jcbc-tw { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes jcbc-fl { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes jcbc-fall { from { transform: translateY(-40px); } to { transform: translateY(440px); } }
@keyframes jcbc-spin { to { transform: rotate(360deg); } }
@keyframes jcbc-sway { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
.jcbc-svg .jcbc-tw { animation: jcbc-tw 2.4s ease-in-out infinite; }
.jcbc-svg .jcbc-fl { animation: jcbc-fl 4s ease-in-out infinite; }
.jcbc-svg .jcbc-fall { animation: jcbc-fall 9s linear infinite; }
.jcbc-svg .jcbc-spin { transform-box: fill-box; transform-origin: center; animation: jcbc-spin 12s linear infinite; }
.jcbc-svg .jcbc-spin-slow { transform-box: fill-box; transform-origin: center; animation: jcbc-spin 40s linear infinite; }
.jcbc-svg .jcbc-sway { animation: jcbc-sway 5s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .jcbc *, .jcbc-pop__box, .jcbc-pop__backdrop { animation: none !important; transition: none !important; }
}
