/* Catálogo Transpiedecuesta — mismo sistema visual de las plantillas Inicio y Serviteca.
   Todo vive bajo .tpc para no chocar con Elementor. */
.tpc {
  --tpc-azul-profundo: #00417C;
  --tpc-azul: #0058A5;
  --tpc-naranja: #F39325;
  --tpc-naranja-osc: #EC6608;
  --tpc-durazno: #FFDCC0;
  --tpc-titulo: #111C2D;
  --tpc-texto: #424751;
  --tpc-suave: #727782;
  --tpc-fondo-foto: #E7EEFF;
  --tpc-fondo-claro: #F0F3FF;
  --tpc-chip: #DEE8FF;
  --tpc-chip-hover: #D8E3FB;
  --tpc-blanco: #FFFFFF;
  --tpc-sombra-suave: 0 1px 2px rgba(0, 0, 0, .05);
  --tpc-sombra-media: 0 10px 15px -3px rgba(0, 0, 0, .1);
  --tpc-sombra-alta: 0 25px 50px -12px rgba(0, 0, 0, .25);

  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--tpc-texto);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.tpc *, .tpc *::before, .tpc *::after { box-sizing: border-box; }
/* Reinicio sin especificidad: así los estilos de cada botón siempre ganan */
:where(.tpc button, .tpc input, .tpc select) { font: inherit; color: inherit; }
.tpc :focus-visible { outline: 2px solid var(--tpc-azul); outline-offset: 2px; }
.tpc [hidden] { display: none !important; }

/* Etiquetas pequeñas en mayúscula, como en las tarjetas de la Serviteca */
.tpc-etiqueta {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--tpc-chip);
  color: var(--tpc-azul-profundo);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.273;
  letter-spacing: .88px;
  text-transform: uppercase;
}
.tpc-marca {
  color: var(--tpc-azul-profundo);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}

/* ---------- Buscador por medida: tarjeta blanca con esquina naranja ---------- */
.tpc-buscador {
  position: relative;
  background: var(--tpc-blanco);
  border-radius: 8px;
  box-shadow: var(--tpc-sombra-alta);
  padding: 32px;
  margin-bottom: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px 40px;
  align-items: end;
}
.tpc-buscador::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-top: 5px solid var(--tpc-naranja);
  border-left: 5px solid var(--tpc-naranja);
  border-top-left-radius: 8px;
  pointer-events: none;
}
.tpc-buscador h2 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--tpc-azul-profundo);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.364;
}
.tpc-medida { display: flex; align-items: flex-end; gap: 10px; }
.tpc-medida-campo { display: flex; flex-direction: column; gap: 6px; }
.tpc-medida-campo span,
.tpc-texto label {
  color: var(--tpc-azul-profundo);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.273;
  letter-spacing: .55px;
  text-transform: uppercase;
}
.tpc-medida-sep {
  font-size: 28px;
  font-weight: 800;
  line-height: 52px;
  color: var(--tpc-azul-profundo);
  opacity: .35;
}
.tpc-medida select {
  appearance: none;
  -webkit-appearance: none;
  height: 52px;
  min-width: 100px;
  padding: 0 34px 0 16px;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tpc-titulo);
  background: var(--tpc-fondo-claro) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2300417C' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.tpc-medida select:hover { border-color: var(--tpc-chip-hover); }
.tpc-medida select:disabled { opacity: .45; cursor: not-allowed; }
.tpc-medida select.tpc-activo { background-color: var(--tpc-chip); border-color: var(--tpc-azul); color: var(--tpc-azul-profundo); }

.tpc-texto { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tpc-texto input {
  height: 52px;
  width: 100%;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--tpc-fondo-claro);
  color: var(--tpc-titulo);
  font-size: 15px;
}
.tpc-texto input::placeholder { color: var(--tpc-suave); }
.tpc-texto input:hover { border-color: var(--tpc-chip-hover); }
.tpc-texto input:focus { background: var(--tpc-blanco); border-color: var(--tpc-azul); }

/* ---------- Estructura ---------- */
.tpc-cuerpo { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }

.tpc-filtros {
  position: sticky;
  top: 24px;
  background: var(--tpc-blanco);
  border-radius: 8px;
  box-shadow: var(--tpc-sombra-media);
  padding: 24px;
}
.tpc-filtros-cab { display: none; }
.tpc-grupo { border: 0; margin: 0 0 18px; padding: 0 0 18px; border-bottom: 1px solid var(--tpc-chip); min-width: 0; }
.tpc-grupo:last-of-type { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.tpc-grupo legend {
  padding: 0;
  margin-bottom: 10px;
  color: var(--tpc-azul-profundo);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.333;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.tpc-opcion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  cursor: pointer;
  color: var(--tpc-texto);
  font-size: 14px;
}
.tpc-opcion:hover { color: var(--tpc-azul-profundo); }
.tpc-opcion input { width: 16px; height: 16px; margin: 0; accent-color: var(--tpc-azul-profundo); flex: none; }
.tpc-opcion .tpc-n { margin-left: auto; color: var(--tpc-suave); font-size: 12px; font-variant-numeric: tabular-nums; }
.tpc-opcion.tpc-cero { color: #A3A8B1; }
.tpc-mas-marcas {
  background: none; border: 0; padding: 6px 0 0; cursor: pointer;
  color: var(--tpc-azul); font-size: 12px; font-weight: 700; letter-spacing: .3px;
}
.tpc-limpiar {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--tpc-azul); font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
}
.tpc-limpiar:hover { color: var(--tpc-azul-profundo); }

/* ---------- Resultados ---------- */
.tpc-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 20px; min-height: 36px; }
.tpc-total { color: var(--tpc-titulo); font-size: 15px; font-weight: 700; }
.tpc-activos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tpc-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 10px 0 12px;
  border: 0; border-radius: 4px;
  background: var(--tpc-chip); color: var(--tpc-azul-profundo);
  font-size: 12px; font-weight: 700; letter-spacing: .3px; cursor: pointer;
}
.tpc-chip:hover { background: var(--tpc-chip-hover); }
.tpc-chip svg { width: 10px; height: 10px; }
.tpc-btn-filtros { display: none; }

.tpc-grilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

/* Tarjeta de producto: misma receta que "Portafolio de productos" de la Serviteca */
.tpc-card {
  display: flex; flex-direction: column;
  background: var(--tpc-blanco);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 12px -2px rgba(0, 43, 84, .08);
  transition: box-shadow .2s ease;
}
.tpc-card:hover { box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 14px 24px -6px rgba(0, 43, 84, .16); }
.tpc-foto {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3.4;
  background: var(--tpc-fondo-foto);
  border: 0; padding: 24px; margin: 0;
  cursor: zoom-in;
}
.tpc-esquina {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  width: 24px; height: 24px;
  border-top: 2px solid var(--tpc-azul-profundo);
  border-left: 2px solid var(--tpc-azul-profundo);
  pointer-events: none;
}
.tpc-foto img { width: 100%; height: 100%; object-fit: contain; display: block; mix-blend-mode: multiply; }
.tpc-sinfoto {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--tpc-azul-profundo); font-size: 16px; font-weight: 700; opacity: .55;
}
.tpc-card-cuerpo { display: flex; flex-direction: column; flex: 1; }
.tpc-info { display: flex; flex-direction: column; gap: 6px; padding: 24px 24px 0; flex: 1; }
.tpc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 4px; }
.tpc-med {
  color: var(--tpc-azul-profundo);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
}
.tpc-nombre { margin: 0; color: var(--tpc-texto); font-size: 14px; line-height: 1.429; }
.tpc-datos { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; }
.tpc-datos li { color: var(--tpc-suave); }
.tpc-datos li b { color: var(--tpc-titulo); font-weight: 700; margin-left: 3px; }
.tpc-acciones { display: flex; flex-direction: column; gap: 2px; padding: 16px 24px 20px; }

/* Botón de la tarjeta: estilo "Consultar medidas" de la Serviteca */
.tpc-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  background: var(--tpc-chip); color: var(--tpc-azul-profundo) !important;
  border-radius: 4px;
  font-size: 12px; font-weight: 700; line-height: 1.333; letter-spacing: .72px;
  text-transform: uppercase; text-decoration: none !important;
  transition: background-color .15s ease;
}
.tpc-wa:hover { background: var(--tpc-chip-hover); }
.tpc-wa svg { width: 16px; height: 16px; flex: none; }
.tpc-ficha {
  height: 34px; background: none; border: 0; cursor: pointer;
  color: var(--tpc-azul); font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
}
.tpc-ficha:hover { color: var(--tpc-azul-profundo); }
.tpc-ref { color: var(--tpc-suave); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Botón principal naranja (ficha y estado vacío), como "Cotizar por WhatsApp" del hero */
.tpc-wa.tpc-wa-principal,
.tpc-dlg .tpc-wa,
.tpc-vacio .tpc-wa {
  min-height: 52px; padding: 16px 32px;
  background: var(--tpc-naranja); color: #FFFFFF !important;
  border-radius: 8px;
  font-size: 14px; letter-spacing: .7px;
  box-shadow: 0 20px 25px -5px rgba(243, 147, 37, .25);
}
.tpc-dlg .tpc-wa:hover,
.tpc-vacio .tpc-wa:hover { background: var(--tpc-naranja-osc); }

.tpc-mas { display: flex; justify-content: center; margin-top: 40px; }
.tpc-mas button {
  height: 52px; padding: 0 32px; cursor: pointer;
  background: var(--tpc-azul-profundo); color: #FFFFFF;
  border: 0; border-radius: 8px;
  font-size: 14px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
}
.tpc-mas button:hover { background: var(--tpc-azul); }

.tpc-vacio {
  grid-column: 1 / -1;
  position: relative;
  background: var(--tpc-blanco);
  border-radius: 16px;
  box-shadow: var(--tpc-sombra-media);
  padding: 40px;
  max-width: 680px;
}
.tpc-vacio::before {
  content: ""; position: absolute; top: 0; left: 0; width: 32px; height: 32px;
  border-top: 2px solid var(--tpc-azul-profundo); border-left: 2px solid var(--tpc-azul-profundo);
  border-top-left-radius: 16px;
}
.tpc-vacio h3 { margin: 0 0 8px; color: var(--tpc-azul-profundo); font-size: 22px; font-weight: 700; line-height: 1.364; }
.tpc-vacio p { margin: 0 0 24px; color: var(--tpc-texto); font-size: 14px; line-height: 1.625; }
.tpc-vacio .tpc-acciones-vacio { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }

/* ---------- Ficha (diálogo) ---------- */
.tpc-dlg {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--tpc-sombra-alta);
  color: var(--tpc-texto);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.tpc-dlg::backdrop { background: rgba(0, 25, 69, .7); }
.tpc-dlg[open] { animation: tpc-entra .16s ease-out; }
@keyframes tpc-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tpc-dlg-int { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 440px; }
.tpc-dlg-fotos { position: relative; background: var(--tpc-fondo-foto); padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.tpc-dlg-fotos::before {
  content: ""; position: absolute; top: 20px; left: 20px; width: 32px; height: 32px;
  border-top: 2px solid var(--tpc-azul-profundo); border-left: 2px solid var(--tpc-azul-profundo);
}
.tpc-dlg-principal { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 300px; }
.tpc-dlg-principal img { max-width: 100%; max-height: 440px; object-fit: contain; mix-blend-mode: multiply; }
.tpc-miniaturas { display: flex; gap: 8px; }
.tpc-miniaturas button {
  width: 64px; height: 64px; padding: 4px; cursor: pointer;
  background: var(--tpc-blanco); border: 1px solid var(--tpc-chip); border-radius: 4px;
}
.tpc-miniaturas button[aria-current="true"] { border: 2px solid var(--tpc-azul-profundo); }
.tpc-miniaturas img { width: 100%; height: 100%; object-fit: contain; }
.tpc-dlg-texto { padding: 32px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.tpc-dlg-cerrar {
  align-self: flex-end; margin: -12px -12px 0 0;
  width: 40px; height: 40px; border: 0; background: none; cursor: pointer; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--tpc-azul-profundo);
}
.tpc-dlg-cerrar:hover { background: var(--tpc-fondo-claro); }
.tpc-dlg-cerrar svg { width: 16px; height: 16px; }
.tpc-dlg .tpc-med { font-size: 34px; line-height: 1.15; letter-spacing: -.6px; }
.tpc-dlg h3 { margin: 0; color: var(--tpc-texto); font-size: 15px; font-weight: 500; line-height: 1.5; }
.tpc-tabla { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: 14px; }
.tpc-tabla th, .tpc-tabla td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--tpc-chip); vertical-align: top; }
.tpc-tabla th { width: 46%; padding-right: 12px; color: var(--tpc-suave); font-weight: 400; }
.tpc-tabla td { color: var(--tpc-titulo); font-weight: 600; }
.tpc-desc-web { margin: 6px 0 0; color: var(--tpc-texto); font-size: 14px; line-height: 1.625; white-space: pre-line; }
.tpc-dlg .tpc-wa { margin-top: 14px; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .tpc-grilla { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpc-buscador { grid-template-columns: 1fr; }
}

/* ---------- Móvil: filtros en panel ---------- */
@media (max-width: 820px) {
  .tpc-cuerpo { grid-template-columns: 1fr; gap: 0; }
  .tpc-btn-filtros {
    display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 14px; cursor: pointer;
    border: 0; border-radius: 4px; background: var(--tpc-azul-profundo); color: #FFFFFF;
    font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  }
  .tpc-btn-filtros svg { width: 16px; height: 16px; }
  .tpc-filtros {
    position: fixed; inset: 0; z-index: 99999;
    border-radius: 0; box-shadow: none;
    padding: 0 20px 96px;
    overflow-y: auto;
    display: none;
  }
  .tpc-filtros.tpc-abierto { display: block; }
  .tpc-filtros-cab {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; background: var(--tpc-blanco);
    padding: 16px 0; margin-bottom: 12px; border-bottom: 1px solid var(--tpc-chip);
    color: var(--tpc-azul-profundo); font-size: 18px; font-weight: 700;
  }
  .tpc-filtros-pie {
    position: fixed; left: 0; right: 0; bottom: 0;
    padding: 12px 20px; background: var(--tpc-blanco); border-top: 1px solid var(--tpc-chip);
  }
  .tpc-filtros-pie button {
    width: 100%; height: 52px; border: 0; border-radius: 8px; cursor: pointer;
    background: var(--tpc-naranja); color: #FFFFFF;
    font-size: 14px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  }
  .tpc-dlg-int { grid-template-columns: 1fr; }
  .tpc-dlg-principal { min-height: 220px; }
  .tpc-dlg-principal img { max-height: 260px; }
}
@media (min-width: 821px) { .tpc-filtros-pie { display: none; } }

@media (max-width: 560px) {
  .tpc-buscador { padding: 24px 20px; gap: 16px; margin-bottom: 32px; }
  .tpc-buscador h2 { font-size: 19px; padding-left: 4px; }
  .tpc-medida { gap: 6px; }
  .tpc-medida-campo { flex: 1; min-width: 0; }
  .tpc-medida select { min-width: 0; width: 100%; font-size: 17px; padding: 0 24px 0 10px; background-position: right 8px center; height: 48px; }
  .tpc-medida-sep { font-size: 22px; line-height: 48px; }
  .tpc-grilla { grid-template-columns: 1fr; gap: 16px; }
  .tpc-card { flex-direction: row; }
  .tpc-foto { width: 38%; aspect-ratio: auto; min-height: 160px; padding: 12px; flex: none; }
  .tpc-esquina { top: 10px; left: 10px; width: 18px; height: 18px; }
  .tpc-info { padding: 14px 14px 0; gap: 4px; }
  .tpc-med { font-size: 19px; }
  .tpc-acciones { padding: 10px 14px 12px; }
  .tpc-card .tpc-largo { display: none; }
  .tpc-dlg { border-radius: 8px; }
  .tpc-dlg-texto { padding: 20px 18px; }
  .tpc-dlg .tpc-med { font-size: 26px; }
  .tpc-vacio { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .tpc *, .tpc-dlg { transition: none !important; animation: none !important; }
}
