/* Bambi — Promociones bancarias (módulo extension/bambi/module/bank_promos).
   Mobile-first. Tokens de bambi.css (--bb-*). Prefijo de clases: bb-promos. */

.bb-promos { margin: 2.5rem 0 3rem; }
.bb-promos__title {
  margin: 0 0 1.25rem;
  font-family: var(--bb-font-head);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  line-height: 1.1;
  color: var(--bb-blue);
}

/* Mobile: carrusel horizontal con scroll-snap. */
.bb-promos__list {
  list-style: none;
  margin: 0;
  padding: .25rem .25rem 1rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(84%, 320px);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--bb-frost) transparent;
}
.bb-promos__list:focus-visible { outline: 3px solid var(--bb-yellow); outline-offset: 2px; border-radius: var(--bb-radius); }
.bb-promos__item { scroll-snap-align: start; display: flex; min-width: 0; }

.bb-promos__card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.25rem;
  background: var(--bb-white);
  border: 1px solid rgba(9, 54, 77, .1);
  border-radius: var(--bb-radius);
  box-shadow: 0 1px 2px rgba(9, 54, 77, .04), 0 10px 28px -14px rgba(9, 54, 77, .22);
  transition: transform .35s var(--bb-ease), box-shadow .35s var(--bb-ease), border-color .35s var(--bb-ease);
}
.bb-promos__card:hover {
  transform: translateY(-3px);
  border-color: rgba(9, 54, 77, .2);
  box-shadow: 0 1px 2px rgba(9, 54, 77, .06), 0 18px 36px -16px rgba(9, 54, 77, .32);
}

/* Ficha del banco: iniciales en un círculo de color de marca (sin logos de terceros). */
.bb-promos__bank { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.bb-promos__badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bb-blue);
  color: var(--bb-white);
  font-family: var(--bb-font-head);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.bb-promos__badge--1 { background: var(--bb-blue-2); }
.bb-promos__badge--2 { background: var(--bb-frost); }
.bb-promos__badge--3 { background: var(--bb-yellow); color: var(--bb-blue); }
.bb-promos__bank-name {
  min-width: 0;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--bb-muted);
  overflow-wrap: anywhere;
}

.bb-promos__headline {
  margin: 0;
  font-family: var(--bb-font-head);
  font-size: clamp(1.35rem, 3.6vw, 1.7rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--bb-blue);
  overflow-wrap: anywhere;
}

/* Valor de la cuota (solo en la ficha de producto y solo si es sin interés). */
.bb-promos__quota {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .6rem;
  padding: .6rem .85rem;
  border-radius: 16px;
  background: var(--bb-ice);
  color: var(--bb-blue);
  font-size: .95rem;
  font-weight: 600;
}
.bb-promos__quota--soft { padding: 0; background: none; color: var(--bb-muted); font-weight: 500; }
.bb-promos__chip {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: var(--bb-yellow);
  color: var(--bb-blue);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.bb-promos__detail { margin: 0; font-size: .9rem; line-height: 1.45; color: var(--bb-muted); overflow-wrap: anywhere; }
.bb-promos__valid {
  margin: auto 0 0;
  padding-top: .75rem;
  border-top: 1px dashed rgba(9, 54, 77, .16);
  font-size: .8rem;
  font-weight: 600;
  color: var(--bb-muted);
}

.bb-promos__legal { margin: 1rem 0 0; max-width: 80ch; font-size: .78rem; line-height: 1.5; color: var(--bb-muted); }

/* Tablet / desktop: grilla de 3 a 4 tarjetas por fila, sin scroll horizontal. */
@media (min-width: 768px) {
  .bb-promos__list {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-template-columns: repeat(auto-fill, minmax(max(240px, calc((100% - 3rem) / 4)), 1fr));
    overflow: visible;
    scroll-snap-type: none;
    padding: .25rem 0 0;
  }
}

/* Financiación en la caja de compra de la ficha: la cuota más baja a la vista, selector de cuotas y un cuadro con todos los medios de pago. */
.bb-fin { padding: 1rem 1.1rem; border-radius: 20px; background: linear-gradient(135deg, #eef3f6 0%, #fff7dd 140%); border: 1px solid rgba(9, 54, 77, .08); }
.bb-fin__title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bb-muted); }
.bb-fin__title i { color: var(--bb-blue-2); }
.bb-fin__line { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin: 0; }
.bb-fin__line strong { font: 800 1.3rem/1.1 var(--bb-font-head); letter-spacing: -.02em; color: var(--bb-blue); }
.bb-fin__banks { margin: .25rem 0 0; font-size: .8rem; color: var(--bb-muted); }
.bb-fin__plans { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .75rem; }
.bb-fin__label { margin-right: .2rem; font-size: .75rem; font-weight: 600; color: var(--bb-muted); }
.bb-fin__plan {
  min-width: 42px; height: 34px; padding: 0 .7rem; border: 1.5px solid rgba(9, 54, 77, .15); border-radius: 999px; background: var(--bb-white);
  color: var(--bb-blue); font-weight: 700; font-size: .85rem; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s var(--bb-ease);
}
.bb-fin__plan:hover { border-color: var(--bb-blue); }
.bb-fin__plan:active { transform: scale(.94); }
.bb-fin__plan.is-on { background: var(--bb-blue); border-color: var(--bb-blue); color: var(--bb-white); }
.bb-fin__plan:focus-visible, .bb-fin__more:focus-visible, .bb-sheet__close:focus-visible { outline: 3px solid var(--bb-yellow); outline-offset: 2px; }
.bb-fin__more { display: inline-flex; align-items: center; gap: .4rem; margin-top: .8rem; padding: 0; border: 0; background: none; font-size: .85rem; font-weight: 700; color: var(--bb-blue-2); cursor: pointer; }
.bb-fin__more:hover { color: var(--bb-blue); }
.bb-fin__more i { font-size: .7rem; transition: transform .25s var(--bb-ease); }
.bb-fin__more:hover i { transform: translateX(3px); }

/* Una sola promoción: una fila compacta (ficha chica, sobre todo en notebooks). */
.bb-fin--single { display: flex; align-items: center; gap: .85rem; padding: .7rem .95rem; }
.bb-fin--single .bb-promos__badge { width: 38px; height: 38px; font-size: .78rem; }
.bb-fin__text { min-width: 0; display: grid; gap: .1rem; }
.bb-fin__headline { margin: 0; font: 700 .95rem/1.25 var(--bb-font-head); letter-spacing: -.01em; color: var(--bb-blue); }
.bb-fin__sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .7rem; margin: 0; font-size: .8rem; color: var(--bb-muted); }
.bb-fin__sub strong { color: var(--bb-blue-2); font-weight: 700; }
.bb-fin__more--small { margin: 0; font-size: .75rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Cuadro con todos los medios de pago: nativo <dialog>, centrado en desktop y hoja desde abajo en celular. */
.bb-sheet {
  width: min(560px, 94vw); max-height: min(86vh, 720px); margin: auto; padding: 0; border: 0; border-radius: 28px; overflow: hidden auto;
  background: var(--bb-white); color: var(--bb-ink); box-shadow: 0 40px 90px rgba(9, 54, 77, .35);
}
.bb-sheet[open] { animation: bb-sheet-in .45s var(--bb-ease); }
.bb-sheet::backdrop { background: rgba(9, 54, 77, .55); backdrop-filter: blur(4px); animation: bb-fade .3s ease; }
@keyframes bb-sheet-in { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes bb-fade { from { opacity: 0; } }
.bb-sheet__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem .75rem; background: var(--bb-white); }
.bb-sheet__head h2 { margin: 0; font-size: 1.35rem; }
.bb-sheet__close { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--bb-ice); color: var(--bb-blue); cursor: pointer; transition: background .2s, transform .2s var(--bb-ease); }
.bb-sheet__close:hover { background: var(--bb-yellow); transform: rotate(90deg); }
.bb-sheet__price { display: flex; justify-content: space-between; gap: 1rem; margin: 0 1.5rem .75rem; padding: .75rem 1rem; border-radius: 14px; background: var(--bb-ice); font-size: .9rem; }
.bb-sheet__price strong { font-family: var(--bb-font-head); }
.bb-sheet__list { list-style: none; margin: 0; padding: 0 1.5rem; display: grid; gap: .75rem; }
.bb-sheet__item { display: flex; gap: .9rem; padding: .9rem 1rem; border: 1px solid rgba(9, 54, 77, .1); border-radius: 18px; }
.bb-sheet__item > div { min-width: 0; display: grid; gap: .15rem; }
.bb-sheet__item strong { font-size: .85rem; color: var(--bb-muted); }
.bb-sheet__headline { font: 700 1.1rem/1.2 var(--bb-font-head); color: var(--bb-blue); }
.bb-sheet__item em { font-style: normal; font-weight: 700; color: var(--bb-blue-2); }
.bb-sheet__item small { font-size: .78rem; color: var(--bb-muted); }
.bb-sheet__note { margin: 0; padding: .9rem 1.5rem 0; font-size: .75rem; line-height: 1.5; color: var(--bb-muted); }
.bb-sheet__note:last-child { padding-bottom: 1.5rem; }
.bb-sheet__list { padding-bottom: .25rem; }
@media (max-width: 575.98px) {
  .bb-sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 28px 28px 0 0; max-height: 88vh; }
  .bb-sheet[open] { animation-name: bb-sheet-up; }
  @keyframes bb-sheet-up { from { transform: translateY(100%); } }
}

@media (prefers-reduced-motion: reduce) {
  .bb-promos__card, .bb-fin__plan, .bb-sheet[open], .bb-sheet::backdrop { transition: none; animation: none; }
  .bb-promos__card:hover { transform: none; }
  .bb-promos__list { scroll-behavior: auto; }
  .bb-promos [data-reveal] { opacity: 1; transform: none; transition: none; }
}
