/* =========================================================
   DOWNLOAD SECTION - Base
========================================================= */
.nexods-download-section {
  position: relative;
  padding: 1rem 0;
  max-width: var(--flow-container-max-width);
  margin: 0 auto;
}

.nexods-download-section__container {
  max-width: var(--flow-container-max-width);
  margin: 0 auto;
  padding-inline: var(--padding-desktop);
}


/* =========================================================
   HEADER - Filtros y botones de vista
========================================================= */
.nexods-download-section__header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
  .nexods-download-section__header {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
}

.nexods-download-section__view-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nexods-download-section__view-btn {
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nexods-download-section__view-btn--active {
  background: #fff;
}

.nexods-download-section__view-btn:hover {
  background: #f3f4f6;
}

.nexods-download-section__view-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.nexods-download-section__view-btn:not(
  .nexods-download-section__view-btn--active
) {
  filter: grayscale(1) opacity(0.5) !important;
}

.nexods-download-section__filters {
  flex: 1;
}

/* =========================================================
   STATUS BAR - Barra de estado de filtros
========================================================= */
.nexods-download-section__status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
}

.nexods-download-section__status-text {
  font-size: 0.875rem;
  color: #374151;
  margin: 0;
}

.nexods-download-section__status-text strong {
  font-weight: 600;
}

.nexods-download-section__clear-filters {
  font-size: 0.875rem;
  color: #2563eb;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.nexods-download-section__clear-filters:hover {
  color: #1e40af;
}

/* =========================================================
   GRID VIEW - Vista en mosaico con cards
========================================================= */
.nexods-download-section__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .nexods-download-section__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .nexods-download-section__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1280px) {
  .nexods-download-section__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.125rem;
  }
}

.nexods-download-section__card-wrapper {
  animation: fadeInUp 0.6s ease-out;
}

.nexods-download-section__card-wrapper:nth-child(1) {
  animation-delay: 0.1s;
}
.nexods-download-section__card-wrapper:nth-child(2) {
  animation-delay: 0.15s;
}
.nexods-download-section__card-wrapper:nth-child(3) {
  animation-delay: 0.2s;
}
.nexods-download-section__card-wrapper:nth-child(4) {
  animation-delay: 0.25s;
}
.nexods-download-section__card-wrapper:nth-child(n + 5) {
  animation-delay: 0.3s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
TABLE VIEW - Vista en lista/tabla
========================================================= */
.nexods-download-section__table-container {
  transition: all 0.3s ease;
}

.nexods-download-section__table {
  width: 100%;
  border-collapse: collapse;
}

/* En desktop, la tabla es un grid */
@media (min-width: 768px) {
  .nexods-download-section__table {
    display: grid;
    grid-template-columns: var(--grid-desktop);
  }
  
  /* thead y tbody desaparecen del layout, sus hijos se convierten en hijos directos del grid */
  .nexods-download-section__table-header,
  .nexods-download-section__table-body {
    display: contents;
  }
  
  /* Las filas (tr) también desaparecen */
  .nexods-download-section__table-header-row,
  .nexods-download-section__table-row {
    display: contents;
  }
  
  /* Las celdas (th/td) ahora son hijos directos del grid */
  .nexods-download-section__table-header-cell,
  .nexods-download-section__table-cell {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
  }
  
  /* Primera fila (header) con borde inferior */
  .nexods-download-section__table-header-cell {
    border-bottom: 1px solid #e5e7eb;
    font-weight: 400;
  }
  
  /* Filas del body con borde inferior */
  .nexods-download-section__table-cell {
    border-bottom: 1px solid #f3f4f6;
  }
  
  /* Hover en filas completas - calculamos cuántas columnas hay */
  .nexods-download-section__table-row:hover
  .nexods-download-section__table-cell {
    background-color: #f9fafb;
  }
}

/* Alineación de celdas */
.nexods-download-section__table-header-cell--left,
.nexods-download-section__table-cell--left {
  justify-content: flex-start;
  text-align: left;
}

.nexods-download-section__table-header-cell--center,
.nexods-download-section__table-cell--center {
  justify-content: center;
  text-align: center;
}

.nexods-download-section__table-header-cell--right,
.nexods-download-section__table-cell--right {
  justify-content: flex-end;
  text-align: right;
}

.nexods-download-section__table-header-cell--action,
.nexods-download-section__table-cell--action {
  justify-content: center;
  width: 2rem;
  padding: 0.75rem 0.5rem;
  padding-inline: 18px;
}

.nexods-download-section__table-header-label {
  font-family: var(--nexo-font-family);
  font-size: 30px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
}

.nexods-download-section__table-value {
  font-size: 1rem;
  color: #6b7280;
}

.nexods-download-section__table-value--title {
  font-weight: 500;
  color: var(--nexo-color-text-default, #000);
  text-transform: uppercase;
}

.nexods-download-section__table-value--empty {
  color: #9ca3af;
}

/* Download Button */
.nexods-download-section__download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.nexods-download-section__download-btn:hover {
  background-color: #f3f4f6;
}

.nexods-download-section__download-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--nexo-color-primary, #02b0a6);
}

/* =========================================================
EMPTY STATE - Estado vacío
========================================================= */
.nexods-download-section__empty {
  text-align: center;
  padding: 3rem 1rem;
  grid-column: 1 / -1;
}

.nexods-download-section__empty-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  color: var(--nexo-color-primary, #02b0a6);
  opacity: 0.5;
}

.nexods-download-section__empty-text {
  font-size: 1.125rem;
  color: #6b7280;
  margin: 0;
}

/* =========================================================
RESPONSIVE - Mobile adjustments
========================================================= */
@media (max-width: 767px) {
  .nexods-download-section__table {
    display: block;
  }
  
  .nexods-download-section__table-header {
    display: block;
  }
  
  .nexods-download-section__table-header-row {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .nexods-download-section__table-body {
    display: block;
  }
  
  .nexods-download-section__table-row {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
  }
  
  /* Ocultar columnas excepto primera y acción */
  .nexods-download-section__table-header-cell:not(
    .nexods-download-section__table-header-cell--action
    ):not(:first-child),
    .nexods-download-section__table-cell:not(
      .nexods-download-section__table-cell--action
      ):not(:first-child) {
        display: none;
      }
      
      /* Ajustar estilos mobile */
      .nexods-download-section__table-header-cell,
      .nexods-download-section__table-cell {
        padding: 0.5rem 0;
      }
      
      .nexods-download-section__table-header-label {
        font-size: 1rem;
      }
      
      .nexods-download-section__table-value {
        font-size: 0.875rem;
      }
      
      .nexods-download-section__download-btn {
    width: 1.5rem;
    height: 1.5rem;
  }
  
  .nexods-download-section__download-icon {
    width: 1rem;
    height: 1rem;
  }
}

/* =========================================================
BOTÓN Ver más
========================================================= */
.nexods-download-section__view-more-btn {
  padding-inline: 35px;
  padding-block: 18px;
  background-color: var(--nexo-color-secondary, #02b0a6);
  margin: 0 auto;
  display: flex;
  width: fit-content;
  font-weight: 700;
  margin-top: 120px;
}
.nexods-download-section__table-cell--action:has(
  .nexods-download-section__download-btn), .nexods-drupal-downloads-table table thead tr th:last-child {
    min-width: 68px;
  }
.nexods-download-section__footer {
  margin-top: 40px;
  margin-bottom: 80px;
  display: flex;
  justify-content: center;
}