/* Contenedor principal */
.ecbc-widget {
  --accent: #6a5cff;
  background: #161616;
  color: #fff;
  padding: 16px;
  border-radius: 12px;
}

/* Filtros (chips) */
.ecbc-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ecbc-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #222;
  color: #fff;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: filter .15s ease-in-out, background .15s ease-in-out, border-color .15s;
}

.ecbc-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ecbc-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ecbc-flag, .ecbc-flag-emoji { display: inline-block; }

.ecbc-chip .ecbc-chip-label { white-space: nowrap; }

/* Carrusel */
.ecbc-carousel-wrap { position: relative; }

.ecbc-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 40px 8px; /* espacio para sombras y nav */
}

.ecbc-card {
  flex: 0 0 auto;
  width: 300px;
  background: #1e1e1e;
  scroll-snap-align: start;
  border: 1px solid #262626;
  overflow: hidden;
}

@media (max-width: 768px) {
  .ecbc-card { width: 85vw; }
}

/* Header de la card */
.ecbc-card-header {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ecbc-card-header h3 {
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  margin: 0;
  padding: 0 12px;
}

/* Ribbon opcional */
.ecbc-ribbon {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #8A8A8A;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1;
}

/* Body */
.ecbc-card-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.ecbc-tag {
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0.9;
  letter-spacing: .02em;
}

.ecbc-excerpt {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.ecbc-date { font-weight: 700; }

.ecbc-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: filter .15s ease-in-out, transform .05s ease-in-out;
}

.ecbc-btn:hover { filter: brightness(1.05); }
.ecbc-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Flechas navegación */
.ecbc-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.4);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
}

.ecbc-prev { left: 4px; }
.ecbc-next { right: 4px; }

.ecbc-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[dir="rtl"] .ecbc-prev { right: 4px; left: auto; }
[dir="rtl"] .ecbc-next { left: 4px; right: auto; }

/* Ajustes por referencia: flechas arriba a la derecha y header con imagen + overlay */
.ecbc-widget { position: relative; }

.ecbc-filter { padding-right: 84px; } /* espacio para flechas */

.ecbc-card-header {
  height: 150px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--header-bg, #4a3cf5);
  background-size: cover;
  background-position: center;
}
.ecbc-card-header.has-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--header-bg, #4a3cf5);
  opacity: .85; /* overlay de color como la referencia */
  pointer-events: none;
}
.ecbc-card-header h3 { position: relative; z-index: 1; }

/* Reposicionar flechas en la parte superior derecha */
.ecbc-nav {
  position: absolute;
  top: 12px;
  transform: none;
  width: 28px;
  height: 28px;
  font-size: 14px;
  background: rgba(0,0,0,.45);
}
.ecbc-prev { right: 48px; left: auto; }
.ecbc-next { right: 12px; left: auto; }

[dir="rtl"] .ecbc-prev { left: 12px; right: auto; }
[dir="rtl"] .ecbc-next { left: 48px; right: auto; }

/* que la imagen del header NUNCA se recorte */
.ecbc-card-header.has-media{
  background-size: contain !important;   /* << clave */
  background-repeat: no-repeat;
  background-position: center center;
  background-color: #111;                /* “barras” laterales si hace falta */
}

/* opcional: asegura una altura consistente de las cards */
.ecbc-card-header{
  height: 320px; /* o la que estés usando */
}

/* Ocultar barra de scroll horizontal */
.ecbc-carousel {
  scrollbar-width: none; /* Firefox */
}
.ecbc-carousel::-webkit-scrollbar {
  display: none; /* Chrome, Edge, Safari */
}

/* Flechas a los lados de las tarjetas */
.ecbc-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.4);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 5;
}

/* Izquierda */
.ecbc-prev {
  left: -20px; /* Ajusta si quieres más afuera o más adentro */
}

/* Derecha */
.ecbc-next {
  right: -20px;
}

/* RTL */
[dir="rtl"] .ecbc-prev { right: -20px; left: auto; }
[dir="rtl"] .ecbc-next { left: -20px; right: auto; }

