/* ═══════════════════════════════════════════════════════════════
   Programas de enseñanza teórica homologados
   Figma node 22889:77049 — frame 1536x2228
   ═══════════════════════════════════════════════════════════════ */

:root {
  --peh-text: #0a0a0a;
  --peh-muted: #525252;
  --peh-border: #e5e5e5;
  --peh-bg: #ffffff;
  --peh-muted-bg: #f5f5f5;
  --peh-accent: #b91c1c;
  --peh-accent-dark: #991b1b;
  --peh-accent-foreground: #fafafa;
  --peh-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.peh-hero {
  position: relative;
  width: 100%;
  height: 288px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0f172a url('../images/figma/programas-homologados-hero.webp') center center / cover no-repeat;
}

.peh-hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.peh-hero__container {
  position: relative;
  z-index: 1;
  width: 1280px;
  max-width: calc(100% - 256px);
  margin: 0 auto;
}

.peh-hero__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1152px;
}

.peh-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.peh-breadcrumb__link,
.peh-breadcrumb__current {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #fafafa;
  text-decoration: none;
}

.peh-breadcrumb__link:hover {
  text-decoration: underline;
}

.peh-breadcrumb__sep {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #fafafa;
}

.peh-hero__title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 40px;
  color: #fafafa;
}

.peh-section {
  width: 100%;
  background: var(--peh-bg);
}

.peh-section__container {
  width: 1280px;
  max-width: calc(100% - 256px);
  margin: 0 auto;
  padding: 64px 0;
}

.peh-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.peh-topbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 157px;
  height: 36px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--peh-text);
  cursor: pointer;
}

.peh-topbar__btn:hover {
  background: #f8fafc;
}

.peh-topbar__btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.peh-topbar__select-wrap {
  position: relative;
  width: 132px;
  height: 36px;
  flex-shrink: 0;
}

.peh-topbar__select,
.peh-sidebar__select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  background-image: none;
}

.peh-topbar__select {
  width: 100%;
  height: 100%;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--peh-border);
  border-radius: 8px;
  box-shadow: var(--peh-shadow);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--peh-muted);
  outline: none;
  cursor: pointer;
}

.peh-topbar__select:focus,
.peh-sidebar__select:focus {
  border-color: var(--peh-accent);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.12);
}

.peh-topbar__chevron,
.peh-sidebar__chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--peh-muted);
  pointer-events: none;
}

.peh-separator {
  width: 100%;
  height: 0;
  margin-top: 16px;
  border-top: 1px solid var(--peh-border);
}

.peh-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding-top: 16px;
}

.peh-sidebar {
  width: 305px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}

.peh-sidebar__header {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.peh-sidebar__title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: var(--peh-text);
}

.peh-sidebar__field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.peh-sidebar__label {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  color: var(--peh-text);
}

.peh-sidebar__select-wrap {
  position: relative;
  width: 100%;
  height: 36px;
}

.peh-sidebar__select {
  width: 100%;
  height: 100%;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--peh-border);
  border-radius: 8px;
  box-shadow: var(--peh-shadow);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--peh-muted);
  outline: none;
  cursor: pointer;
}

.peh-sidebar__btn-search {
  width: 100%;
  height: 36px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--peh-accent);
  box-shadow: var(--peh-shadow);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--peh-accent-foreground);
  cursor: pointer;
}

.peh-sidebar__btn-search:hover {
  background: var(--peh-accent-dark);
}

.peh-sidebar__btn-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 148px;
  height: 36px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--peh-text);
  cursor: pointer;
}

.peh-sidebar__btn-clear:hover {
  background: #f8fafc;
}

.peh-sidebar__btn-clear svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.peh-main {
  width: 955px;
  flex-shrink: 0;
}

.peh-table-shell {
  width: 915px;
  margin-left: 20px;
  margin-right: 20px;
}

.peh-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: 'Inter', sans-serif;
}

.peh-table__head {
  height: 40px;
  padding: 0 16px;
  background: var(--peh-muted-bg);
  border-bottom: 1px solid var(--peh-border);
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--peh-muted);
}

.peh-table tbody tr {
  height: 52px;
  border-bottom: 1px solid var(--peh-border);
}

.peh-table__cell {
  padding: 0 16px;
  vertical-align: middle;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--peh-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.peh-table th:nth-child(1),
.peh-table td:nth-child(1) {
  width: 160px;
}

.peh-table th:nth-child(2),
.peh-table td:nth-child(2) {
  width: auto;
}

.peh-table th:nth-child(3),
.peh-table td:nth-child(3) {
  width: 220px;
  text-align: center;
}

.peh-table__head--acciones,
.peh-table__head--download {
  text-align: center;
}

.peh-table__cell--acciones {
  text-align: center;
  padding: 8px 16px;
}

/* ── Download Button (Pill Design) ── */
.peh-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  color: #525252;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.peh-download-btn:hover {
  background: #f8fafc;
  border-color: #d4d4d4;
  color: #0a0a0a;
}

.peh-download-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.peh-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--peh-accent);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.peh-download-link:hover {
  background: var(--peh-accent-dark);
}

.peh-download-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.peh-pagination {
  width: 915px;
  margin: 16px 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.peh-pagination__pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.peh-pagination__btn,
.peh-pagination__page,
.peh-pagination__dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.peh-pagination__btn {
  border: 1px solid var(--peh-border);
  background: #fff;
  color: var(--peh-muted);
  cursor: pointer;
}

.peh-pagination__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.peh-pagination__page {
  border: 0;
  background: transparent;
  color: var(--peh-muted);
  cursor: pointer;
}

.peh-pagination__page--active {
  background: var(--peh-accent);
  color: #fff;
}

.peh-pagination__dots {
  color: var(--peh-muted);
}

/* ── Vista de tarjetas (toggle "Ver en Tarjetas", AUD_045) ──
   La visibilidad la controla el JS inline del template; por defecto
   display:none y se conmuta a grid al activar el toggle. */
.peh-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 915px;
  margin: 0 20px;
}

.peh-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--peh-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--peh-shadow);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.peh-card:hover {
  border-color: #d4d4d4;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.peh-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.peh-card__year {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  color: var(--peh-accent);
  letter-spacing: 0.01em;
}

.peh-card__title {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  color: var(--peh-text);
}

@media (max-width: 1439px) {
  .peh-hero__container,
  .peh-hero__container,
  .peh-section__container {
    max-width: calc(100% - 48px);
  }

  .peh-main {
    width: calc(100% - 325px);
    min-width: 0;
  }

  .peh-table-shell,
  .peh-pagination,
  .peh-cards {
    width: auto;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 1024px) {
  .peh-hero {
    height: auto;
    min-height: 240px;
    padding: 48px 0;
  }

  .peh-layout {
    flex-direction: column;
  }

  .peh-sidebar,
  .peh-main {
    width: 100%;
  }

  .peh-sidebar {
    align-items: stretch;
  }

  .peh-sidebar__btn-clear {
    width: 100%;
  }

  .peh-table-shell {
    overflow-x: auto;
  }

  .peh-table {
    min-width: 915px;
  }
}

@media (max-width: 767px) {
  .peh-hero__container,
  .peh-section__container {
    max-width: calc(100% - 32px);
  }

  .peh-hero__title {
    font-size: 28px;
    line-height: 34px;
  }

  .peh-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .peh-topbar__btn,
  .peh-topbar__select-wrap {
    width: 100%;
  }

  .peh-cards {
    grid-template-columns: 1fr;
  }
}
