/**
 * Cursos Fenin — Estilos
 */

/* ============================================================
   BASE
   ============================================================ */
.fenin-cursos-page {
  font-family: Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  width: 100%;
  box-sizing: border-box;
  color: #2e3434;
}

.fenin-cursos-page *,
.fenin-cursos-page *::before,
.fenin-cursos-page *::after {
  box-sizing: border-box;
}

/* ============================================================
   BUSCADOR
   ============================================================ */
.fenin-buscador {
  width: 100%;
  background: #fff;
  padding: 32px 0 24px;
}

.fenin-buscador__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.fenin-buscador__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Fila de filtros */
.fenin-buscador__filters {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* Campo individual */
.fenin-buscador__field {
  flex: 1 1 180px;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fenin-buscador__label {
  font-size: 13px;
  font-weight: 500;
  color: #5a6464;
  line-height: 1;
}

/* Select wrapper */
.fenin-buscador__select-wrap {
  position: relative;
  width: 100%;
}

.fenin-buscador__select-native {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: #F7F8F8;
  border: none;
  border-radius: 8px;
  padding: 12px 36px 12px 16px;
  font-family: Roboto, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #2E3434;
  cursor: pointer;
  line-height: 160%;
  outline: none;
  transition: background 0.2s;
}

.fenin-buscador__select-native:focus {
  background: #eef0f0;
}

.fenin-buscador__select-wrap .fenin-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #a1acac;
}

/* Input fecha */
.fenin-buscador__date-wrap {
  position: relative;
  width: 100%;
}

.fenin-buscador__date {
  width: 100%;
  background: #F7F8F8;
  border: none;
  border-radius: 8px;
  padding: 12px 36px 12px 16px;
  font-family: Roboto, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #2E3434;
  outline: none;
  cursor: pointer;
  line-height: 160%;
  transition: background 0.2s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.fenin-buscador__date::-webkit-calendar-picker-indicator,
.fenin-buscador__date::-webkit-inner-spin-button,
.fenin-buscador__date::-webkit-clear-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.fenin-buscador__date:focus,
.fenin-buscador__date.flatpickr-input:focus {
  background: #eef0f0;
}

.fenin-buscador__date.flatpickr-input {
  border: none !important;
  background: #F7F8F8 !important;
  padding: 12px 36px 12px 16px !important;
  border-radius: 8px !important;
  height: auto !important;
  line-height: 160% !important;
}

.fenin-buscador__date-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #a1acac;
}

.fenin-buscador__date-wrap.has-value .fenin-buscador__date-icon {
  display: none;
}

.fenin-buscador__date-clear {
  display: none !important;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: none !important;
  background: #e8ebeb !important;
  border-radius: 50%;
  color: #2e3434;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.fenin-buscador__date-clear:hover {
  background: #d1d6d6;
}

.fenin-buscador__date-wrap.has-value .fenin-buscador__date-clear {
  display: flex !important;
}

/* Input búsqueda */
.fenin-buscador__search-wrap {
  position: relative;
  width: 100%;
}

.fenin-buscador__search-icon {
  position: absolute;
  right: 16px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #a1acac;
}

.fenin-buscador__input {
  width: 100%;
  background: #F7F8F8;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 8px;
  padding: 12px 40px 12px 16px;
  font-family: Roboto, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #2E3434;
  line-height: 160%;
  transition: background 0.2s;
}

.fenin-buscador__input:focus {
  background: #eef0f0;
}

.fenin-buscador__input::placeholder {
  color: #a1acac;
}

/* Fila 2: fecha y búsqueda al mismo ancho */
.fenin-buscador__field--fecha {
  flex: 1 1 0;
}

.fenin-buscador__field--search {
  flex: 1 1 0;
}

/* Icons base */
.fenin-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fenin-icon__svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ============================================================
   SECCIÓN LISTADO
   ============================================================ */
.fenin-cursos {
  width: 100%;
  background: #fff;
  padding: 40px 0 64px;
}

.fenin-cursos__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Grid de cards */
.fenin-cursos__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Estado cargando */
.fenin-cursos__list.is-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* Sin resultados */
.fenin-cursos__empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #5a6464;
  font-size: 15px;
  padding: 48px 0;
}

/* ============================================================
   CARD DE CURSO
   ============================================================ */
.fenin-curso-card {
  display: flex;
  min-height: 576px;
  min-width: 296px;
  max-width: 600px;
  padding: 16px;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  flex: 1 0 0;
  border-radius: 24px;
  border: 2px solid #EFF1F1;
  background: #FFF;
  box-sizing: border-box;
  transition: box-shadow 0.2s;
}

.fenin-curso-card:hover {
}

/* Imagen */
.fenin-curso-card__image-wrap {
  display: flex;
  height: 200px;
  padding: 12px;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  flex-shrink: 0;
  align-self: stretch;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  background: lightgray 50% / cover no-repeat;
  gap: 16px;
}

.fenin-curso-card__image {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important; 
  object-position: center !important;
  border-radius: 0;
}

.fenin-curso-card__image--placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e8ebeb 0%, #d1d6d6 100%);
}

/* Badge estado */
.fenin-curso-card__badge {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 34px;
  max-width: 202px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.fenin-curso-card__badge--ya-disponible {
  background: #fff;
  color: #3c3399;
  border: 1.5px solid #e8ebeb;
}

.fenin-curso-card__badge--proximamente {
  background: linear-gradient(122deg, #ffa807 19%, #bc0075 81%);
  color: #fff;
}

.fenin-curso-card__badge--novedad {
  background: linear-gradient(104deg, #009ca0 10%, #403399 90%);
  color: #fff;
}

.fenin-curso-card__badge--pasado {
  background: #2e3434;
  color: #fff;
}

/* Badge duración */
.fenin-curso-card__duration {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 100px;
  padding: 0 10px;
  height: 34px;
  font-size: 13px;
  font-weight: 700;
  color: #3c3399;
  white-space: nowrap;
  flex-shrink: 0;
}

.fenin-curso-card__duration .fenin-icon__svg {
  width: 14px;
  height: 14px;
  color: #3c3399;
}

/* Cuerpo */
.fenin-curso-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  align-self: stretch;
  min-height: 0;
}

/* Tags pequeños (modalidad + perfil) */
.fenin-curso-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fenin-curso-card__tag {
  display: flex;
  padding: 4px 10px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  background: #F5FAFA;
  backdrop-filter: blur(10px);
  color: #009CA0;
  font-family: Roboto, sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 160%;
}

/* Área temática */
.fenin-curso-card__area {
  overflow: hidden;
  color: #009CA0;
  text-overflow: ellipsis;
  font-family: Roboto, sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 160%;
}

/* Título */
.fenin-curso-card__title {
  overflow: hidden;
  color: #2E3434;
  text-overflow: ellipsis;
  font-family: Roboto, sans-serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
  line-height: 140%;
  margin: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.fenin-curso-card__title a {
  color: inherit;
  text-decoration: none;
}

.fenin-curso-card__title a:hover {
  color: inherit;
}

/* Fecha */
.fenin-curso-card__date-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fenin-curso-card__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: #a1acac;
}

.fenin-curso-card__icon .fenin-icon__svg {
  width: 16px;
  height: 16px;
}

.fenin-curso-card__date {
  color: #6E7B7B;
  font-family: Roboto, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
  line-height: 160%;
}

/* Precios */
.fenin-curso-card__prices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.fenin-curso-card__price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.fenin-curso-card__price-label {
  font-size: 13px;
  color: #5a6464;
}

.fenin-curso-card__price-value {
  display: flex;
  padding: 4px 10px;
  align-items: center;
  gap: 8px;
  flex: 1 0 0;
  border-radius: 100px;
  background: #F7F8F8;
  width: 100%;
  max-width: 148px;
  height: 30px;
  font-size: 14px;
  font-weight: 700;
  color: #2e3434;
  justify-content: center;
  box-sizing: border-box;
}

/* Patrocinadores */
.fenin-curso-card__sponsors {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.fenin-curso-card__sponsor-logo {
  width: 81px;
  height: 48px;
  object-fit: contain;
  display: block;
}

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.fenin-cursos__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 40px;
}

.fenin-cursos__pagination-numbers {
  display: flex;
  gap: 4px;
  align-items: center;
}

.fenin-cursos__pagination-page {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  text-decoration: none;
  color: #a1acac;
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
}

.fenin-cursos__pagination-page:hover {
  background: #f7f8f8;
  color: #2e3434;
}

.fenin-cursos__pagination-page.is-active {
  background: #ccebec;
  color: #009ca0;
  font-weight: 700;
}

.fenin-cursos__pagination-nav {
  display: flex;
  gap: 4px;
}

.fenin-cursos__pagination-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  outline: 1.5px solid #e8ebeb;
  outline-offset: -1.5px;
  color: #a1acac;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.fenin-cursos__pagination-btn:not(.is-disabled) {
  color: #009ca0;
  outline-color: #ccebec;
}

.fenin-cursos__pagination-btn:not(.is-disabled):hover {
  background: #edf7f9;
}

.fenin-cursos__pagination-btn.is-disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.4;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .fenin-cursos__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .fenin-buscador__inner,
  .fenin-cursos__inner {
    padding: 0 16px;
  }

  .fenin-buscador {
    padding: 24px 0 20px;
  }

  .fenin-buscador__filters {
    flex-direction: column;
  }

  .fenin-buscador__field,
  .fenin-buscador__field--fecha,
  .fenin-buscador__field--search {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .fenin-cursos {
    padding: 24px 0 40px;
  }

  .fenin-cursos__grid {
    grid-template-columns: 1fr;
  }

  .fenin-cursos__pagination {
    flex-wrap: wrap;
  }
}

/* Fecha y búsqueda — mismo ancho, max 568px, altura 46px */
.fenin-buscador__field--fecha,
.fenin-buscador__field--search {
  flex: 1 1 0;
  max-width: 568px;
}

.fenin-buscador__date,
.fenin-buscador__date.flatpickr-input,
.fenin-buscador__input {
  height: 46px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Paginación — prev | números | next */
.fenin-cursos__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 40px;
}

.fenin-cursos__pagination-numbers {
  display: flex;
  gap: 4px;
  align-items: center;
  order: 2;
}

.fenin-cursos__pagination-nav {
  display: contents;
}

.fenin-cursos__pagination-btn:first-child {
  order: 1;
}

.fenin-cursos__pagination-btn:last-child {
  order: 3;
}