/* ========================================================================
   UNIVERSIDAD LOYOLA | TABLAS DE PRECIOS DE GRADOS
   v1.7 | Tabla real en TODOS los dispositivos + scroll horizontal arrastrable

   - Sustituir TODO el CSS anterior por este archivo.
   - No convertir los <tr> en fichas, grids o bloques en ningun viewport.
   - El CSS permite deslizamiento nativo tactil/trackpad, scrollbar visible
     y cursor grab. Para arrastrar con el raton hace falta el JS adjunto.
   - Selector, filtros y textos grandes, con padding vertical MUY reducido.
   - Todos los selectores visuales estan limitados a .lp-prices.
   - Sin isolation, transforms ni z-index global para no interferir con menus.
   ======================================================================== */

/* 1. VARIABLES Y BASE ---------------------------------------------------- */
.lp-prices {
  --lp-ink: #192a67;
  --lp-light: #8cd1e7;
  --lp-accent: #2799c1;
  --lp-accent-dark: #176d95;
  --lp-text: #233650;
  --lp-muted: #4c6076;
  --lp-line: #b6d1e1;
  --lp-line-soft: #dae6ef;
  --lp-soft: #f1f8fc;
  --lp-hover: #eaf6fc;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 9px 0 18px;
  color: var(--lp-text);
  font-family: 'Montserrat', Arial, sans-serif !important;
  font-size: 1.21rem !important;
  line-height: 1.34;
}

.lp-prices *,
.lp-prices *::before,
.lp-prices *::after { box-sizing: border-box; }

.lp-prices :is(button, input, select, table, th, td, small, label, a, p, h2, strong, span) {
  font-family: 'Montserrat', Arial, sans-serif !important;
}

.lp-prices :is(button, input, select) { font: inherit; }
.lp-prices button { cursor: pointer; }

/* 2. CABECERA ------------------------------------------------------------ */
.lp-prices .lp-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 6px;
}

.lp-prices .lp-eyebrow {
  color: var(--lp-accent-dark);
  font-size: 1.06rem !important;
  font-weight: 800;
  letter-spacing: .03em;
}

.lp-prices .lp-heading h2 {
  margin: 0;
  color: var(--lp-ink);
  font-size: clamp(1.94rem, 2.4vw, 2.4rem) !important;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -.01em;
}

.lp-prices .lp-heading p {
  max-width: 850px;
  margin: 2px 0 0;
  color: var(--lp-muted);
  font-size: 1.19rem !important;
  line-height: 1.34 !important;
}

/* 3. SELECTOR DE CURSO --------------------------------------------------- */
.lp-prices .lp-course-tabs {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  max-width: 100%;
  padding: 2px;
  border: 1px solid var(--lp-line);
  border-radius: 5px;
  background: #eaf3f9;
  white-space: nowrap;
}

.lp-prices .lp-course-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  min-height: 39px;
  padding: 4px 10px;
  border: 1px solid transparent !important;
  border-radius: 3px;
  background: transparent !important;
  color: var(--lp-ink) !important;
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  line-height: 1.13;
  box-shadow: none !important;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.lp-prices .lp-course-tab:not(.is-active):not(:disabled):hover {
  border-color: #a6cbdf !important;
  background: #d6eaf5 !important;
}

.lp-prices .lp-course-tab.is-active,
.lp-prices .lp-course-tab.is-active:hover {
  border-color: var(--lp-ink) !important;
  background: var(--lp-ink) !important;
  color: #fff !important;
  box-shadow: inset 0 -3px 0 var(--lp-light) !important;
}

.lp-prices .lp-course-tab:disabled:not(.is-active) {
  opacity: .46;
  cursor: not-allowed;
  background: transparent !important;
}

.lp-prices .lp-course-tab:focus-visible {
  outline: 3px solid var(--lp-accent);
  outline-offset: 2px;
}

/* 4. BUSCADOR Y FILTROS -------------------------------------------------- */
.lp-prices .lp-filter-box {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin: 0 0 5px;
  padding: 5px 8px;
  border: 1px solid var(--lp-line);
  border-left: 3px solid var(--lp-accent);
  border-radius: 4px;
  background: var(--lp-soft);
  container: lp-price-filters / inline-size;
}

.lp-prices .lp-filter-box label {
  display: flex;
  flex: 1 1 145px;
  flex-direction: column;
  gap: 2px;
  min-width: 122px;
  margin: 0;
}

.lp-prices .lp-filter-box label.lp-search { flex: 2 1 225px; }

.lp-prices .lp-filter-box label > span {
  color: var(--lp-ink);
  font-size: 1.12rem !important;
  font-weight: 800;
  line-height: 1.15;
}

.lp-prices .lp-filter-box :is(input, select) {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 4px 8px;
  border: 1.5px solid #a6c5d9 !important;
  border-radius: 4px !important;
  outline: none;
  background: #fff !important;
  color: var(--lp-text) !important;
  box-shadow: none !important;
  font-size: 1.16rem !important;
  line-height: 1.2;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.lp-prices .lp-filter-box input::placeholder { color: #586b80; opacity: 1; }
.lp-prices .lp-filter-box :is(input, select):hover { border-color: var(--lp-accent) !important; }

.lp-prices .lp-filter-box :is(input, select):focus {
  border-color: var(--lp-accent-dark) !important;
  box-shadow: 0 0 0 3px rgba(140, 209, 231, .4) !important;
}

.lp-prices .lp-reset {
  align-self: flex-end;
  min-height: 40px;
  padding: 4px 7px;
  border: 1px solid transparent !important;
  border-radius: 3px;
  background: transparent !important;
  color: var(--lp-ink) !important;
  font-size: 1.12rem !important;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.lp-prices .lp-reset:hover {
  border-color: var(--lp-line) !important;
  background: #e0eff7 !important;
  text-decoration: none;
}

.lp-prices .lp-reset:focus-visible { outline: 3px solid var(--lp-accent); outline-offset: 2px; }

@container lp-price-filters (max-width: 800px) {
  .lp-prices .lp-filter-box label.lp-search { flex: 1 1 100%; }
  .lp-prices .lp-filter-box label:not(.lp-search) { flex: 1 1 180px; }
}

@container lp-price-filters (max-width: 520px) {
  .lp-prices .lp-filter-box label,
  .lp-prices .lp-filter-box label.lp-search { flex: 1 1 100%; min-width: 0; }
}

/* 5. SCROLL DE TABLA: RATON + TACTIL + TECLADO ----------------------------
   cursor:grab SOLO muestra el cursor. El archivo JS adjunto hace que
   pointerdown + movimiento arrastre la tabla con el raton de escritorio.
   En moviles el overflow se desplaza de forma nativa al deslizar.
   ---------------------------------------------------------------------- */
.lp-prices .lp-table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden;
  border: 1px solid var(--lp-line);
  border-top: 3px solid var(--lp-accent);
  border-radius: 3px;
  background: #fff;
  box-shadow: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: auto; /* preserva pan nativo y zoom de accesibilidad */
  scrollbar-width: thin;
  scrollbar-color: var(--lp-accent) #eaf2f7;
}

.lp-prices .lp-table-scroll[hidden] { display: none !important; }
.lp-prices .lp-table-scroll.lp-can-scroll { cursor: grab; }

.lp-prices .lp-table-scroll.lp-is-dragging,
.lp-prices .lp-table-scroll.lp-is-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.lp-prices .lp-table-scroll::-webkit-scrollbar { height: 11px; }
.lp-prices .lp-table-scroll::-webkit-scrollbar-track { background: #eaf2f7; }
.lp-prices .lp-table-scroll::-webkit-scrollbar-thumb {
  border: 2px solid #eaf2f7;
  border-radius: 999px;
  background: var(--lp-accent);
}
.lp-prices .lp-table-scroll::-webkit-scrollbar-thumb:hover { background: var(--lp-accent-dark); }

.lp-prices .lp-table-scroll:focus-visible {
  outline: 3px solid var(--lp-accent-dark);
  outline-offset: 2px;
}

.lp-prices .lp-scroll-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 1px 0;
  color: var(--lp-accent-dark);
  font-size: .99rem !important;
  font-weight: 700;
  line-height: 1.25;
}
.lp-prices .lp-scroll-hint[hidden] { display: none !important; }

/* 6. TABLA REAL. JAMAS CAMBIA A DISPLAY:GRID O BLOCK --------------------- */
.lp-prices .lp-table {
  width: 100%;
  min-width: 1040px; /* 5 o mas columnas: conserva letra grande y legibilidad */
  margin: 0 !important;
  border: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  table-layout: auto;
  background: #fff;
  color: var(--lp-text);
  font-size: 1.27rem !important;
  line-height: 1.24;
}

/* Tablas de renovacion (hasta 4 columnas): no imponer ancho de 7 columnas. */
@supports selector(.lp-table:has(thead th:nth-child(5))) {
  .lp-prices .lp-table:not(:has(thead th:nth-child(5))) { min-width: 590px; }
}

.lp-prices .lp-table thead th {
  padding: 5px 7px !important;
  border: 0 !important;
  border-bottom: 2px solid var(--lp-light) !important;
  background: var(--lp-ink) !important;
  color: #fff !important;
  font-size: 1.17rem !important;
  font-weight: 800;
  line-height: 1.22;
  text-align: left;
  vertical-align: middle;
  white-space: normal;
}

.lp-prices .lp-table thead th:first-child {
  width: 29%;
  min-width: 240px;
}

.lp-prices .lp-table thead th:not(:first-child):not(:last-child) { text-align: right; }
.lp-prices .lp-table thead th:last-child { text-align: center; }
.lp-prices .lp-table thead th.lp-action-head { width: 61px; min-width: 61px; }

.lp-prices .lp-table thead button {
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  gap: 3px;
  width: 100%;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  font-size: inherit !important;
  font-weight: 800 !important;
  line-height: 1.2;
  text-align: inherit;
  white-space: normal;
}

.lp-prices .lp-table thead button:hover { text-decoration: underline; text-underline-offset: 3px; }
.lp-prices .lp-table thead button:focus-visible { outline: 3px solid var(--lp-light); outline-offset: 2px; }

.lp-prices .lp-table tbody tr:nth-child(even):not(.lp-group) { background: #f7fbfd; }
.lp-prices .lp-table tbody tr:not(.lp-group):hover { background: var(--lp-hover); }

.lp-prices .lp-table td {
  padding: 4px 7px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--lp-line-soft) !important;
  background: transparent !important;
  color: var(--lp-text) !important;
  font-size: 1.27rem !important;
  font-weight: 500;
  line-height: 1.24 !important;
  vertical-align: middle;
  text-align: left;
}

.lp-prices .lp-table td:not(:first-child) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.lp-prices .lp-table td:last-child { text-align: center; }

.lp-prices .lp-table td.lp-name-cell,
.lp-prices .lp-table td:first-child {
  min-width: 240px;
  max-width: 440px;
  overflow-wrap: break-word;
  hyphens: auto;
}

.lp-prices .lp-table td strong {
  color: var(--lp-ink) !important;
  font-size: 1.29rem !important;
  font-weight: 800;
  line-height: 1.23;
}

.lp-prices .lp-table td small {
  display: block;
  margin-top: 1px;
  color: var(--lp-muted) !important;
  font-size: 1.05rem !important;
  line-height: 1.18 !important;
}

.lp-prices .lp-table .lp-note {
  max-width: 35rem;
  color: var(--lp-muted);
  font-size: 1.05rem !important;
  line-height: 1.2;
  white-space: normal !important;
}

.lp-prices .lp-table .lp-total {
  color: var(--lp-ink) !important;
  font-size: 1.37rem !important;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.lp-prices .lp-table .lp-group th {
  padding: 4px 8px !important;
  border: 0 !important;
  border-left: 4px solid var(--lp-accent) !important;
  background: #e5f2f9 !important;
  color: var(--lp-ink) !important;
  font-size: 1.28rem !important;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

/* 7. ETIQUETAS, ICONOS Y MENSAJES --------------------------------------- */
.lp-prices .lp-state,
.lp-prices .lp-draft {
  display: inline-block !important;
  width: fit-content;
  margin-top: 1px !important;
  padding: 1px 5px;
  border-radius: 3px;
  background: #fff1cd;
  color: #765514;
  font-size: 1rem !important;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
}
.lp-prices .lp-draft { background: #e5ebf3; color: #415675; }

.lp-prices .lp-view-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 37px;
  min-width: 37px;
  height: 37px;
  padding: 0 !important;
  border: 1.5px solid #a3ccdf !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: var(--lp-ink) !important;
  box-shadow: none;
  text-decoration: none !important;
  transition: background-color .15s ease, border-color .15s ease;
}

.lp-prices .lp-view-link svg {
  display: block;
  flex-shrink: 0;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lp-prices .lp-view-link:hover {
  border-color: var(--lp-accent) !important;
  background: #d9f1fb !important;
}
.lp-prices .lp-view-link:focus-visible { outline: 3px solid var(--lp-accent-dark); outline-offset: 2px; }
.lp-prices .lp-na { color: #586c80 !important; }

.lp-prices .lp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px 12px;
  margin: 4px 1px 0;
  color: var(--lp-muted);
  font-size: 1.1rem !important;
  line-height: 1.25;
}

.lp-prices .lp-empty {
  padding: 8px;
  border: 1px dashed var(--lp-line);
  border-radius: 4px;
  background: #f8fbfd;
  color: var(--lp-ink);
  font-size: 1.18rem !important;
  line-height: 1.25;
  text-align: center;
}

.lp-prices .lp-empty[hidden],
.lp-prices .lp-table [hidden] { display: none !important; }

.lp-prices .lp-legal {
  margin: 5px 0 0;
  color: var(--lp-muted);
  font-size: 1.1rem !important;
  line-height: 1.4 !important;
}

.lp-prices .lp-preview-warning {
  padding: 5px 8px;
  border: 1px solid #e9cf91;
  border-radius: 3px;
  background: #fff1cd;
  color: #695018;
  font-size: 1.1rem !important;
  font-weight: 800;
  line-height: 1.25;
}

.lp-prices .lp-error {
  padding: 7px 8px;
  color: #8b2b34;
  font-size: 1.13rem !important;
  line-height: 1.25;
}

/* 8. RESPONSIVE SIN CAMBIAR EL FORMATO TABLA ----------------------------- */
@media (max-width: 760px) {
  .lp-prices { margin: 7px 0 13px; }
  .lp-prices .lp-heading { gap: 4px 8px; margin-bottom: 5px; }
  .lp-prices .lp-heading h2 { font-size: clamp(1.9rem, 5vw, 2.3rem) !important; }
  .lp-prices .lp-heading p { font-size: 1.15rem !important; }

  .lp-prices .lp-course-tabs { display: flex; width: 100%; }
  .lp-prices .lp-course-tab {
    flex: 1 1 50%;
    min-width: 0;
    min-height: 39px;
    padding: 4px 7px;
    font-size: 1.25rem !important;
  }

  .lp-prices .lp-filter-box { gap: 4px 7px; padding: 5px 6px; }
  .lp-prices .lp-filter-box label.lp-search { flex-basis: 100%; }
  .lp-prices .lp-filter-box :is(input, select) { min-height: 40px; }

  /* Mantiene el encabezado real y los TD en la misma fila, con scroll. */
  .lp-prices .lp-table,
  .lp-prices .lp-table thead,
  .lp-prices .lp-table tbody,
  .lp-prices .lp-table tr,
  .lp-prices .lp-table th,
  .lp-prices .lp-table td { display: revert; }

  .lp-prices .lp-table thead th { padding: 4px 6px !important; }
  .lp-prices .lp-table td { padding: 3px 6px !important; }
  .lp-prices .lp-table .lp-group th { padding: 3px 7px !important; }
  .lp-prices .lp-footer { font-size: 1.07rem !important; }
}

@media (max-width: 420px) {
  .lp-prices .lp-heading h2 { font-size: 1.9rem !important; }
  .lp-prices .lp-course-tab { font-size: 1.22rem !important; }
  .lp-prices .lp-filter-box label { flex: 1 1 100%; min-width: 0; }
  .lp-prices .lp-reset { min-height: 39px; padding: 3px 7px; }
  .lp-prices .lp-table-scroll::-webkit-scrollbar { height: 9px; }
}

/* 9. IMPRESION Y MOVIMIENTO ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .lp-prices * { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  .lp-prices .lp-table-scroll {
    width: 100%;
    max-width: none;
    overflow: visible !important;
  }
  .lp-prices .lp-table { min-width: 0 !important; width: 100% !important; }
  .lp-prices .lp-filter-box,
  .lp-prices .lp-course-tabs,
  .lp-prices .lp-scroll-hint { display: none !important; }
  .lp-prices .lp-table tbody tr { break-inside: avoid; }
}

tr.lp-group {
    display: none;
}
.lp-scroll-toolbar {
    display: none;
}
.lp-filter-box {
    margin-bottom: 20px !important;
}