/**
 * Performance Data - estilos de la tabla de cargas SWM.
 *
 * Todo esta scopeado bajo .swm-perf para no interferir con el header/footer
 * de Elementor ni con el resto del sitio. La tipografia se hereda del sitio
 * (font-family:inherit); solo se mantiene el rojo de marca SWM como acento.
 */

.swm-perf {
  --swm-red: #CA212A;
  --swm-red-hover: #a81b22;
  --swm-red-light: #f8e8e9;
  --swm-dark: #1a1a1a;
  --swm-charcoal: #2d2d2d;
  --swm-gray: #4a4a4a;
  --swm-light-gray: #f5f5f5;
  --swm-border: #ddd;
  --swm-accent-red: #e31e38;

  font-family: inherit;
  color: #333;
}

.swm-perf *,
.swm-perf *::before,
.swm-perf *::after {
  box-sizing: border-box;
}

/* ===== HERO ===== */
.swm-perf__hero {
  color: #fff;
  padding: 30px 40px 35px;
  position: relative;
  overflow: hidden;
}

.swm-perf__hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}
.swm-perf__hero-content {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.swm-perf__hero-text h1 {
  font-family: "Archivo", Sans-serif;
  font-size: 75px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 76px;
  margin: 0 0 20px;
  letter-spacing: -0.3px;
  color: #fff;
}
.swm-perf__hero-text h1 span {
  color: var(--swm-red);
}
.swm-perf__hero-text p {
  font-size: 35px;
  line-height: 39px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--e-global-color-119b486);
  margin: 0;
  opacity: 0.75;
}
.swm-perf__hero-logo {
  flex-shrink: 0;
}
.swm-perf__hero-logo img {
  height: 150px;
  max-width: 100%;
  opacity: 0.9;
}

/* ===== LINEA DE ACENTO ROJA ===== */
.swm-perf__accent-line {
  height: 1px;
  background: linear-gradient(90deg, var(--swm-red) 0%, var(--swm-accent-red) 50%, var(--swm-red) 100%);
}

/* ===== CONTENEDOR ===== */
.swm-perf__container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== CONTROLES ===== */
.swm-perf__controls {
  background: #fff;
  border-radius: 4px;
  padding: 14px 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-left: 4px solid var(--swm-red);
}
.swm-perf__controls-left,
.swm-perf__controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--swm-gray);
}
.swm-perf__controls select,
.swm-perf__controls input {
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  transition: border-color 0.2s;
  min-width:60px;
}
.swm-perf__controls select:focus,
.swm-perf__controls input:focus {
  outline: none;
  border-color: var(--swm-red);
  box-shadow: 0 0 0 2px rgba(202, 33, 42, 0.15);
}
.swm-perf__controls input[type=text] {
  width: 220px;
}
.swm-perf__controls select{
    background-position: right 10px top 10px;
}
/* Boton de limpiar filtros: mismo lenguaje visual que la paginacion. */
.swm-perf__clear {
  padding: 6px 14px !important;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px !important;
  cursor: pointer;
  font-size: 12px !important;
  transition: all 0.15s;
  color: var(--swm-gray) !important;
  text-decoration: none !important;
  text-transform: capitalize !important;
  white-space: nowrap;
}
.swm-perf__clear:hover {
  background: var(--swm-red) !important;
  color: #fff !important;
  border-color: var(--swm-red) !important;
}

/* ===== TABLA ===== */
.swm-perf__table-wrap {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
}
.swm-perf table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 1200px;
}
.swm-perf thead tr.swm-perf__filters th {
  padding: 5px 4px;
  background: #fafafa;
  border-bottom: 1px solid #e0e0e0;
}
.swm-perf thead tr.swm-perf__filters th input,
.swm-perf thead tr.swm-perf__filters th select {
  width: 100%;
  font-size: 11.5px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 2px;
  background: #fff;
  transition: border-color 0.2s;
}
.swm-perf thead tr.swm-perf__filters th input:focus,
.swm-perf thead tr.swm-perf__filters th select:focus {
  outline: none;
  border-color: var(--swm-red);
  box-shadow: 0 0 0 2px rgba(202, 33, 42, 0.12);
}
.swm-perf thead tr.swm-perf__headers th {
  background: var(--swm-dark);
  color: #fff;
  padding: 11px 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative;
  transition: background 0.15s;
}
.swm-perf thead tr.swm-perf__headers th:hover {
  background: var(--swm-charcoal);
}
.swm-perf thead tr.swm-perf__headers th .swm-perf__sort-arrow {
  font-size: 9px;
  margin-left: 3px;
  opacity: 0.35;
}
.swm-perf thead tr.swm-perf__headers th.is-sorted-asc .swm-perf__sort-arrow,
.swm-perf thead tr.swm-perf__headers th.is-sorted-desc .swm-perf__sort-arrow {
  opacity: 1;
  color: var(--swm-red);
}
.swm-perf tbody tr {
  border-bottom: 1px solid #eee;
  transition: background 0.12s;
}
.swm-perf tbody tr:nth-child(even) {
  background: #fafafa;
}
.swm-perf tbody tr:hover {
  background: var(--swm-red-light);
}
.swm-perf tbody td {
  padding: 8px;
  text-align: center;
  white-space: nowrap;
  border-right: 1px solid #f0f0f0;
}
.swm-perf tbody td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--swm-dark);
}
.swm-perf tbody td:nth-child(2) {
  text-align: left;
  color: var(--swm-gray);
}

/* Part number con data sheet en la biblioteca de medios.
   !important porque el tema padre y Elementor estilan los <a> del contenido
   (color, subrayado) y ganarian por especificidad de hoja. */
.swm-perf tbody td a.swm-perf__datasheet {
  color: var(--swm-red) !important;
  font-weight: 600;
  text-decoration: none !important;
  border-bottom: 1px dotted currentColor;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.swm-perf tbody td a.swm-perf__datasheet:hover,
.swm-perf tbody td a.swm-perf__datasheet:focus {
  color: var(--swm-red-hover) !important;
  border-bottom-style: solid;
}
.swm-perf tbody td a.swm-perf__datasheet:focus-visible {
  outline: 2px solid var(--swm-red);
  outline-offset: 2px;
}
/* Flecha de "abrir en pestana nueva". Va en ::after y no en el HTML para que
   el texto que se copia de la celda siga siendo solo el part number. */
.swm-perf tbody td a.swm-perf__datasheet::after {
  content: '\2197';
  font-weight: 700;
  margin-left: 4px;
  font-size: 0.9em;
  opacity: 0.75;
}

/* ===== PIE / PAGINACION ===== */
.swm-perf__footer-row {
  background: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #666;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
  gap: 10px;
}
.swm-perf__pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}
.swm-perf__pagination button {
  padding: 6px 14px!important;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 3px!important;
  cursor: pointer;
  font-size: 12px!important;
  transition: all 0.15s;
  color: var(--swm-gray)!important;
  text-decoration: none !important;
  text-transform: capitalize !important;
}
.swm-perf__pagination button:hover:not(:disabled) {
  background: var(--swm-red)!important;
  color: #fff!important;
  border-color: var(--swm-red)!important;
}
.swm-perf__pagination button:disabled {
  opacity: 0.35;
  cursor: default;
}
.swm-perf__page-num {
  padding: 5px 10px;
  font-weight: 700;
  color: var(--swm-red);
}

/* ===== LEYENDA ===== */
.swm-perf__legend {
  background: #fff;
  border-radius: 4px;
  padding: 16px 20px;
  margin-top: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 12.5px;
  line-height: 1.8;
  border-left: 4px solid var(--swm-red);
}
.swm-perf__legend b {
  color: var(--swm-dark);
}
.swm-perf__section-title {
  color: var(--swm-red);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.swm-perf__no-results {
  text-align: center;
  padding: 50px;
  color: #999;
  font-size: 14px;
}

/* ===== FILTROS MULTI-SELECCION ===== */

/* Boton que abre el panel de casillas. Imita a un <select> nativo para que la
   fila de filtros se lea igual, pero es un <button>: un select real no permite
   marcar varios valores sin obligar al usuario a mantener Ctrl pulsado. */
.swm-perf thead tr.swm-perf__filters th .swm-perf__ms-trigger {
  width: 100%;
  font-size: 11.5px !important;
  font-family: inherit;
  padding: 4px 18px 4px 6px !important;
  border: 1px solid #ccc;
  border-radius: 2px !important;
  background: #fff !important;
  color: #333 !important;
  text-align: left;
  text-transform: none !important;
  letter-spacing: 0;
  font-weight: 400;
  text-decoration: none !important;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  transition: border-color 0.2s;
}
.swm-perf thead tr.swm-perf__filters th .swm-perf__ms-trigger::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 50%;
  margin-top: -2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #777;
}
.swm-perf thead tr.swm-perf__filters th .swm-perf__ms-trigger:hover,
.swm-perf thead tr.swm-perf__filters th .swm-perf__ms-trigger.is-open {
  border-color: var(--swm-red);
}
/* Con algun valor marcado el filtro queda visiblemente activo: si no, con la
   tabla filtrada no hay forma de saber por que columna esta acotada. */
.swm-perf thead tr.swm-perf__filters th .swm-perf__ms-trigger.is-active {
  border-color: var(--swm-red);
  background: var(--swm-red-light) !important;
  color: var(--swm-dark) !important;
  font-weight: 600;
}

/* Panel unico de casillas. Va colgado de .swm-perf (no del <th>) y con
   position:fixed porque .swm-perf__table-wrap tiene overflow-x:auto y recorta
   cualquier cosa que se salga de la tabla. */
.swm-perf__ms-panel {
  /* Redeclarados aqui: el panel se inserta en <body>, fuera de .swm-perf, y por
     tanto no hereda las variables de marca declaradas en ese contenedor. */
  --swm-red: #CA212A;
  --swm-red-light: #f8e8e9;
  --swm-dark: #1a1a1a;

  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #ccc;
  border-top: 2px solid var(--swm-red);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  overflow-y: auto;
  font-size: 12px;
  text-align: left;
}
.swm-perf__ms-actions {
  display: flex;
  justify-content: flex-end;
  padding: 5px 8px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
  position: sticky;
  top: 0;
}
.swm-perf__ms-actions button {
  background: none !important;
  border: none;
  padding: 0 !important;
  font-size: 11px !important;
  font-family: inherit;
  color: var(--swm-red) !important;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.swm-perf__ms-actions button:hover {
  text-decoration: underline;
}
.swm-perf__ms-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  cursor: pointer;
  color: #333;
  font-weight: 400;
  text-transform: none;
  line-height: 1.3;
  margin: 0;
}
.swm-perf__ms-list label:hover {
  background: var(--swm-red-light);
}
.swm-perf__ms-list input[type="checkbox"] {
  width: auto !important;
  min-width: 0;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--swm-red);
}

/* ===== FILTROS MIN / MAX ===== */

/* Los dos campos comparten una sola celda, asi que la fila de filtros sigue
   teniendo tantos <th> como columnas la tabla. */
.swm-perf__range {
  display: flex;
  align-items: center;
  gap: 3px;
}
.swm-perf thead tr.swm-perf__filters th .swm-perf__range-input {
  width: 100%;
  min-width: 0;
  flex: 1 1 0;
  font-size: 11.5px;
  padding: 4px 4px;
  text-align: center;
  -moz-appearance: textfield;
}
/* Sin esto los spinners de Chrome se comen la mitad de un campo tan estrecho. */
.swm-perf thead tr.swm-perf__filters th .swm-perf__range-input::-webkit-outer-spin-button,
.swm-perf thead tr.swm-perf__filters th .swm-perf__range-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.swm-perf__range-sep {
  color: #999;
  font-size: 11px;
  flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */

/* Las etiquetas de los controles son <label> por accesibilidad; el tema da
   estilo propio a label (bloque, negrita, margen), aqui se neutraliza. */
.swm-perf .swm-perf__controls label {
  display: inline;
  margin: 0;
  font: inherit;
  color: inherit;
}

@media (max-width: 768px) {
  .swm-perf__controls {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
  }
  .swm-perf__controls-left,
  .swm-perf__controls-right {
    justify-content: flex-start;
  }

  /* El tema pone los select a ancho completo y empujaba "entries" fuera. */
  .swm-perf .swm-perf__controls select {
    width: auto;
    flex: 0 0 auto;
  }

  /* Busqueda: la etiqueta en su linea, debajo el campo ocupando lo que quede
     y el boton al lado. min-width:0 deja que el campo encoja por debajo de
     su ancho por defecto en vez de sacar el boton de la caja. */
  .swm-perf__controls-right {
    flex-wrap: wrap;
  }
  .swm-perf__search-label {
    flex-basis: 100%;
  }
  .swm-perf .swm-perf__controls input[type=text] {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  /* Paginacion: solo las flechas. El texto sigue en aria-label. */
  .swm-perf__footer-row {
    flex-direction: column;
    padding: 12px 16px;
  }
  .swm-perf__pagination {
    width: 100%;
    justify-content: center;
  }
  .swm-perf__btn-label {
    display: none;
  }
  .swm-perf .swm-perf__pagination button {
    min-width: 40px;
    min-height: 40px;
    padding: 0 !important;
    font-size: 16px !important;
    line-height: 1;
  }
  .swm-perf__page-num {
    white-space: nowrap;
    padding: 0 10px;
  }
  .swm-perf__hero-content {
    flex-direction: column;
    text-align: center;
  }

}

/* ===== GRILLA DEL SITIO =====
   Igual que los contenedores boxed de Elementor en el homepage: contenido de
   1440px como maximo y 50px de margen lateral en desktop (10px en tablet y
   mobile). El fondo del hero sigue a todo el ancho; solo el contenido se
   limita a la grilla. */
.swm-perf {
  --swm-grid: 1440px;
  --swm-gutter: 50px;
}
.swm-perf__hero {
  padding-left: 0;
  padding-right: 0;
}
.swm-perf__hero-content,
.swm-perf__container {
  width: min(var(--swm-grid), 100% - 2 * var(--swm-gutter));
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}
@media (min-width: 1440px) {
  .swm-perf__hero {
    padding-top: 5%;
    padding-bottom: 5%;
  }
  .swm-perf__hero-text {
    padding-right: 5%;
  }
}
/* Logo del hero 50% mas grande en desktop y widescreen (70px -> 105px). */
@media (min-width: 1025px) {
  .swm-perf__hero-logo img {
    height: 200px;
  }
}

/* ===== TIPOGRAFIA RESPONSIVE =====
   Mismas medidas que el titulo del hero del homepage. Se antepone .swm-perf
   porque el kit de Elementor (.elementor-kit-5 h1 { font-size: 75px }) carga
   despues de esta hoja y, con la misma especificidad, ganaba en mobile. */
@media (max-width: 1024px) {
  .swm-perf {
    --swm-gutter: 10px;
  }
  .swm-perf .swm-perf__hero-text h1 {
    font-size: 50px;
    line-height: 56px;
  }
  .swm-perf .swm-perf__hero-text p {
    font-size: 25px;
    line-height: 30px;
  }
}
@media (max-width: 767px) {
  .swm-perf .swm-perf__hero-text h1 {
    font-size: 35px;
    line-height: 36px;
    margin-bottom: 15px;
  }
  .swm-perf .swm-perf__hero-text p {
    font-size: 18px;
    line-height: 23px;
  }
  /* Titulo, subtitulo y logo a la izquierda, como el homepage. */
  .swm-perf .swm-perf__hero-content {
    align-items: stretch;
  }
  .swm-perf .swm-perf__hero-text {
    text-align: left;
  }
  /* Logo al 80% del ancho. El SVG trae aire alrededor del dibujo (viewBox
     1000x600, dibujo de x111 a x948 y de y208 a y394), asi que la imagen se
     agranda y se recorta con margenes negativos para que lo VISIBLE mida el
     80% y arranque en el borde del texto. Los % de margen se calculan sobre
     el ancho del contenedor:
       ancho img   = 80% / 0.837          = 95.5%
       margen izq  = -0.111 x 95.5%       = -10.6%
       aire arriba/abajo ~ 0.34 x 0.6 x 95.5% ~ 20%  (se deja 3% de respiro) */
  .swm-perf__hero-logo {
    align-self: stretch;
  }
  .swm-perf__hero-logo img {
    display: block;
    width: 95.5%;
    max-width: none;
    height: auto;
    margin: -17% 0 -17% -10.6%;
  }
}