/* Tabs — Tema 2 Componentes de la computadora (Módulo 1) */

.tema-tabs-block {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.tema-tabs-block--top {
  max-width: 960px;
}

/* —— Tabs superiores (componentes1, procesamiento, salida) —— */
.tema-tabs-block--top .tema-tabs-top,
.tema-tabs-block--top > .col-12.pill-info {
  width: 100%;
  max-width: 100%;
  float: none;
  padding-left: 0;
  padding-right: 0;
}

.tema-tabs-block .nav-pills {
  padding-right: 0 !important;
}

.tema-tabs-block--top .tema-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  padding: 0 0 1rem !important;
  margin: 0 0 0.75rem !important;
  float: none;
}

.tema-tabs-block--top .tema-tabs-nav > .nav-item {
  flex: 1 1 auto;
  min-width: 7.5rem;
  max-width: 100%;
  margin: 0 !important;
  padding: 0;
}

.tema-tabs-block--top .tema-tabs-nav > .nav-item > .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.85rem;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  border-radius: 6px;
}

.tema-tabs-block--top .tema-tabs-panel {
  width: 100%;
  max-width: 100%;
  clear: both;
  float: none;
  overflow-x: hidden;
}

.tema-tabs-block--top .tema-tabs-panel .card,
.tema-tabs-block--top .tema-tabs-panel .container {
  max-width: 100%;
}

/* —— Tabs laterales (componentes2, almacenamiento) —— */
.tema-tabs-block--side {
  max-width: 100%;
}

.tema-tabs-block--side::after {
  content: "";
  display: table;
  clear: both;
}

.tema-tabs-block--side .tema-tabs-side.nav-vertical .nav-pills {
  box-sizing: border-box;
}

.tema-tabs-block--side .tema-tabs-side.nav-vertical .tab-content {
  box-sizing: border-box;
}

/* Móvil: tabs superiores en rejilla */
@media (max-width: 575.98px) {
  .tema-tabs-block--top .tema-tabs-nav > .nav-item {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: calc(50% - 0.35rem);
  }

  .tema-tabs-block--top .tema-tabs-nav > .nav-item > .nav-link {
    min-height: 2.5rem;
    font-size: 0.875rem;
    padding: 0.45rem 0.5rem;
  }
}

/* Tablet: tabs superiores */
@media (min-width: 576px) and (max-width: 991.98px) {
  .tema-tabs-block--top .tema-tabs-nav > .nav-item {
    flex: 1 1 calc(33.333% - 0.4rem);
    min-width: 8rem;
  }
}

/* Desktop: tabs superiores en una fila equilibrada */
@media (min-width: 992px) {
  .tema-tabs-block--top .tema-tabs-nav {
    gap: 0.65rem;
  }

  .tema-tabs-block--top .tema-tabs-nav > .nav-item {
    flex: 1 1 0;
    min-width: 0;
  }
}

/* Móvil / tablet: tabs laterales → rejilla arriba, contenido abajo */
@media (max-width: 991.98px) {
  .tema-tabs-block--side .tema-tabs-side.nav-vertical .nav-pills {
    float: none;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0 0.25rem 1rem !important;
    margin-bottom: 0.5rem !important;
  }

  .tema-tabs-block--side .tema-tabs-side.nav-vertical .nav-pills > .nav-item {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: calc(50% - 0.35rem);
    max-width: 100%;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
  }

  .tema-tabs-block--side .tema-tabs-side.nav-vertical .nav-pills > .nav-item > .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.5rem 0.65rem;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
    font-size: 0.875rem;
  }

  .tema-tabs-block--side .tema-tabs-side.nav-vertical .tab-content {
    float: none;
    width: 100% !important;
    max-width: 100%;
    clear: both;
  }
}

@media (max-width: 374px) {
  .tema-tabs-block--top .tema-tabs-nav > .nav-item,
  .tema-tabs-block--side .tema-tabs-side.nav-vertical .nav-pills > .nav-item {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

/* Desktop: mantener layout lateral clásico */
@media (min-width: 992px) {
  .tema-tabs-block--side .tema-tabs-side.nav-vertical .nav-pills {
    float: left;
    width: 180px;
    padding: 0 12px 0 0;
    display: block;
  }

  .tema-tabs-block--side .tema-tabs-side.nav-vertical .nav-pills > .nav-item {
    width: 100%;
    margin-bottom: 12px;
  }

  .tema-tabs-block--side .tema-tabs-side.nav-vertical .nav-pills > .nav-item > .nav-link {
    width: 100%;
    min-height: 2.65rem;
  }

  .tema-tabs-block--side .tema-tabs-side.nav-vertical .tab-content {
    float: left;
    width: calc(100% - 200px);
    min-width: 0;
  }
}
