/* ════════════════════════════════════════════════
   b2b.css — Universolibro
   Sección: Venta a Instituciones
   Tarjetas grandes con imagen de fondo + overlay
   Mobile First · Carrusel táctil nativo (scroll-snap)
   WCAG 2.1 AA · Usa tokens de base.css
   ════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════
   SECCIÓN CONTENEDORA
   ════════════════════════════════════════════════ */
.b2b {
  width: 100%;
  overflow: hidden;
  padding-block: var(--s-xl) calc(var(--s-xl) + 1rem);
  background: var(--c-fondo);
}

.b2b__interior {
  width: 100%;
  max-width: var(--ancho-max);
  margin-inline: auto;
}

/* ════════════════════════════════════════════════
   CABECERA
   ════════════════════════════════════════════════ */
.b2b__cabecera {
  text-align: center;
  max-width: 680px;
  margin-inline: auto;
  margin-bottom: var(--s-xl);
  padding-inline: var(--pad-lateral);
}

.b2b__etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--f-titulo);
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--c-rojo);
  text-transform: uppercase;
  margin-bottom: var(--s-md);
  padding: 0.4em 1em;
  border-radius: var(--r-pill);
  background: var(--color-fondo-badge);
}

.b2b__etiqueta svg { color: var(--c-amarillo); flex-shrink: 0; }

.b2b__titulo {
  font-family: var(--f-titulo);
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  font-weight: 900;
  color: var(--c-texto);
  margin-bottom: var(--s-md);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.b2b__titulo-resalte {
  position: relative;
  color: var(--c-rojo);
  white-space: nowrap;
}

.b2b__titulo-resalte::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.28em;
  background: var(--c-amarillo);
  opacity: 0.35;
  z-index: -1;
  border-radius: 2px;
}

.b2b__subtitulo {
  font-size: var(--t-md);
  color: var(--c-texto-suave);
  line-height: 1.7;
}

/* ════════════════════════════════════════════════
   CARRUSEL — scroll horizontal nativo (CSS puro)
   ════════════════════════════════════════════════ */
.b2b__carrusel {
  display: flex;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad-lateral);
  padding-block: 0.5rem clamp(1rem, 2vw, 1.5rem);
  padding-inline: var(--pad-lateral);
  margin: 0;
  list-style: none;

  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
  -ms-overflow-style: none;
}

.b2b__carrusel::-webkit-scrollbar { display: none; }

.b2b__carrusel:focus-visible {
  outline: 3px solid var(--c-rojo);
  outline-offset: 4px;
  border-radius: var(--r-lg);
}

/* ════════════════════════════════════════════════
   TARJETA — imagen de fondo a pantalla completa,
   título y contenido superpuestos con overlay
   ════════════════════════════════════════════════ */
.b2b__tarjeta {
  scroll-snap-align: start;
  flex: 0 0 auto;
  position: relative;

  width: clamp(280px, 84vw, 360px);
  height: clamp(420px, 62vw, 480px);

  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;

  background-color: var(--c-fondo-suave);

  box-shadow: var(--sh-md);
  transition: transform var(--tr-n), box-shadow var(--tr-n);

  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

@media (min-width: 640px) {
  .b2b__tarjeta { width: clamp(300px, 42vw, 360px); height: 460px; }
}

@media (min-width: 1024px) {
  .b2b__tarjeta { width: calc((100% - 2 * clamp(1rem, 2.5vw, 1.5rem)) / 3); height: 480px; }
}

@media (hover: hover) and (pointer: fine) {
  .b2b__tarjeta:hover {
    transform: translateY(-6px);
    box-shadow: var(--sh-xl);
  }
  .b2b__tarjeta:hover .b2b__tarjeta-imagen {
    transform: scale(1.06);
  }
}

.b2b__tarjeta:focus-within {
  outline: 3px solid #fff;
  outline-offset: -3px;
  box-shadow: var(--sh-xl), 0 0 0 4px var(--c-rojo);
}

/* ── Imagen de fondo ── */
.b2b__tarjeta-imagen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform var(--tr-l);
}

/* ── Overlay degradado: oscurece la base para legibilidad WCAG ── */
.b2b__tarjeta::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0)   0%,
    rgba(0,0,0,.05) 35%,
    rgba(0,0,0,.55) 70%,
    rgba(0,0,0,.88) 100%
  );
  pointer-events: none;
}

/* Tinte de marca sutil por segmento */
.b2b__tarjeta--colegios::before,
.b2b__tarjeta--universidades::before,
.b2b__tarjeta--instituciones::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  mix-blend-mode: multiply;
  opacity: .35;
  pointer-events: none;
}

.b2b__tarjeta--colegios::before      { background: var(--c-rojo); }
.b2b__tarjeta--universidades::before { background: var(--color-azul-escolar); }
.b2b__tarjeta--instituciones::before { background: #1C2833; }

/* ── Contenido superpuesto ── */
.b2b__tarjeta-contenido {
  position: relative;
  z-index: 2;
  padding: var(--s-lg);
  color: #fff;
}

/* ── Ícono insignia ── */
.b2b__tarjeta-icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-size: 1.6rem;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,.3);
  margin-bottom: var(--s-sm);
}

/* ── Título ── */
.b2b__tarjeta-titulo {
  font-family: var(--f-titulo);
  font-size: var(--t-xl);
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* ── Descripción ── */
.b2b__tarjeta-descripcion {
  font-size: var(--t-sm);
  color: rgba(255,255,255,.92);
  line-height: 1.55;
  margin-bottom: var(--s-md);
}

/* ── Lista de beneficios ── */
.b2b__lista {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0 0 var(--s-md);
  padding: 0;
  list-style: none;
}

.b2b__lista li {
  position: relative;
  padding-left: 1.5em;
  font-size: var(--t-xs);
  color: rgba(255,255,255,.95);
  line-height: 1.5;
}

.b2b__lista li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: rgba(255,255,255,.25);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 9px;
}

/* ── Botón de cotización ── */
.b2b__boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  min-height: 48px;
  padding: 0 var(--s-md);
  border-radius: var(--r-sm);
  font-family: var(--f-titulo);
  font-weight: 800;
  font-size: var(--t-sm);
  color: #1a1a1a;
  background: #fff;
  transition: transform var(--tr-r), box-shadow var(--tr-r), background var(--tr-r);
}

.b2b__boton:hover {
  background: var(--c-amarillo);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}

.b2b__boton:active { transform: translateY(0); }

.b2b__boton:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.b2b__boton svg { transition: transform var(--tr-r); }
.b2b__boton:hover svg { transform: translateX(3px); }

/* ════════════════════════════════════════════════
   FLECHAS DE NAVEGACIÓN (desde tablet)
   ════════════════════════════════════════════════ */
.b2b__controles {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--s-md);
  margin-top: var(--s-md);
}

@media (min-width: 768px) {
  .b2b__controles { display: flex; }
}

.b2b__flecha {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--c-fondo);
  color: var(--c-texto);
  border: 1.5px solid var(--c-borde);
  cursor: pointer;
  box-shadow: var(--sh-sm);
  transition: background var(--tr-r), color var(--tr-r), border-color var(--tr-r), transform var(--tr-r), box-shadow var(--tr-r);
}

.b2b__flecha:hover:not(:disabled) {
  background: var(--c-rojo);
  color: #fff;
  border-color: var(--c-rojo);
  box-shadow: var(--sh-md);
  transform: scale(1.06);
}

.b2b__flecha:active:not(:disabled) { transform: scale(0.94); }

.b2b__flecha:focus-visible {
  outline: 3px solid var(--c-rojo);
  outline-offset: 2px;
}

.b2b__flecha:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ════════════════════════════════════════════════
   INDICADORES (puntos) — solo en móvil
   ════════════════════════════════════════════════ */
.b2b__indicadores {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--s-md);
}

@media (min-width: 768px) {
  .b2b__indicadores { display: none; }
}

.b2b__indicador {
  position: relative;
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  border-radius: 50%;
  background: var(--c-borde);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background var(--tr-n), width var(--tr-n);
}

.b2b__indicador::after {
  content: '';
  position: absolute;
  inset: -12px;
}

.b2b__indicador--activo {
  background: var(--c-rojo);
  width: 24px;
  border-radius: var(--r-pill);
}

.b2b__indicador:focus-visible {
  outline: 3px solid var(--c-rojo);
  outline-offset: 3px;
}

/* ════════════════════════════════════════════════
   ACCESIBILIDAD: movimiento reducido
   ════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .b2b__carrusel { scroll-behavior: auto; }
  .b2b__tarjeta,
  .b2b__tarjeta-imagen,
  .b2b__boton,
  .b2b__flecha,
  .b2b__indicador {
    transition: none;
  }
}

/* ════════════════════════════════════════════════
   MODO OSCURO
   ════════════════════════════════════════════════ */
[data-tema="oscuro"] .b2b__flecha {
  background: var(--c-fondo-suave);
  border-color: var(--c-borde);
}
