/* ================================
   Módulo Calculadoras / Conversores
   Layout general
================================ */

.ct-tools-hero {
  padding: 2rem;
  margin: 1rem auto;
  max-width: 1120px;
  border-radius: 24px;
  background: #f4f7fb;
}

.ct-tools-hero.small {
  padding: 1.5rem;
}

.ct-tools-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: .25rem 0;
  color: #102033;
}

.ct-intro {
  color: #102033;
  line-height: 1.65;
}

.eyebrow {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  color: #4d647d;
}

.ct-tools-search {
  display: flex;
  gap: .5rem;
  margin-top: 1rem;
}

.ct-tools-search input {
  flex: 1;
  padding: .9rem;
  border: 1px solid #d7dee8;
  border-radius: 12px;
}

.ct-tools-search button,
.ct-calculator button {
  padding: .9rem 1.1rem;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  background: #162235;
  color: white;
}

.ct-tools-grid {
  max-width: 1120px;
  margin: 1rem auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.ct-tool-card,
.ct-tool-main,
.ct-tool-side,
.ct-tools-section {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(15,23,42,.05);
}

.ct-tool-card a {
  text-decoration: none;
}

.ct-tools-section {
  max-width: 1120px;
  margin: 1rem auto;
}

.ct-tools-list {
  display: grid;
  gap: .65rem;
  max-width: 1120px;
  margin: 1rem auto;
}

.ct-tool-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  text-decoration: none;
  background: white;
}

.ct-tool-row span {
  color: #64748b;
}

/* ================================
   Layout detalle con publicidad
================================ */

.ct-tool-layout {
  max-width: 1120px;
  margin: 1rem auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
  align-items: start;
}

.ct-tool-main {
  min-width: 0;
}

.ct-tool-side {
  align-self: start;
  display: grid;
  gap: .75rem;
  position: sticky;
  top: 1rem;
}

.ct-tool-side a {
  display: block;
  padding: .6rem;
  border-bottom: 1px solid #eef2f7;
  text-decoration: none;
}

.ad-placeholder {
  min-height: 180px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #64748b;
  background: #f8fafc;
}

/* ================================
   Imagen introductoria
================================ */

.ct-tool-image {
  max-width: 460px;
  margin: 14px auto 16px;
  padding: 10px;
  border: 1px solid #dbe7f5;
  border-radius: 16px;
  background: #f8fbff;
  text-align: center;
}

.ct-tool-image img {
  width: 100%;
  height: auto;
  display: block;
}

.ct-tool-image figcaption {
  margin-top: 8px;
  color: #64748b;
  font-size: .88rem;
  line-height: 1.35;
}

/* ================================
   Calculadora
================================ */

.ct-calculator {
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  padding: 1.1rem;
  background: #fbfdff;
  margin: 1rem 0 1.2rem;
}

.ct-calc-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  align-items: start;
}

.ct-form-ohm {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.ct-field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.ct-field label {
  display: block;
  font-weight: 800;
  color: #102033;
  margin-bottom: .15rem;
}

.ct-field input,
.ct-field select {
  width: 100%;
  min-height: 48px;
  padding: .8rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #102033;
  font-size: 1rem;
}

.ct-field input:focus,
.ct-field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.ct-field small {
  display: block;
  color: #64748b;
  margin-top: .15rem;
  font-size: .86rem;
  line-height: 1.35;
}

.ct-action-field {
  grid-column: 1 / -1;
}

.ct-action-field button {
  width: min(260px, 100%);
  min-height: 48px;
}

.ct-calc-note {
  grid-column: 1 / -1;
  background: #f8fafc;
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  padding: 12px 14px;
}

.ct-calc-note strong {
  display: block;
  margin-bottom: 4px;
  color: #122033;
}

.ct-calc-note span {
  color: #64748b;
  font-size: .92rem;
  line-height: 1.4;
}

.ct-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: #eef6ff;
  border: 1px solid #bfd8f5;
  color: #102033;
}

.ct-dynamic-text {
  margin: 10px 0 0;
  color: #334155;
  line-height: 1.5;
}

.ct-error {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* ================================
   Fórmula y FAQ
================================ */

.ct-formula {
  padding: 1rem;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  overflow: auto;
  text-align: center;
}

.ct-faq details {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: .8rem;
  margin: .5rem 0;
}

/* ================================
   Responsive
================================ */

@media (max-width: 980px) {
  .ct-tool-layout {
    grid-template-columns: 1fr;
  }

  .ct-tool-side {
    position: static;
  }

  .ct-form-ohm {
    grid-template-columns: 1fr 1fr;
  }

  .ct-calc-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .ct-tools-hero {
    padding: 1.25rem;
    border-radius: 18px;
  }

  .ct-tools-search {
    flex-direction: column;
  }

  .ct-tool-row {
    flex-direction: column;
  }

  .ct-calc-form,
  .ct-form-ohm {
    grid-template-columns: 1fr;
  }

  .ct-action-field button {
    width: 100%;
  }

  .ct-tool-image {
    max-width: 100%;
  }
}

/* Reducir espacio entre imagen y bloque de cálculo */
.ct-tool-image {
  margin-bottom: 8px !important;
}

.ct-tool-image figcaption {
  margin-top: 4px !important;
  margin-bottom: 0 !important;
}

.ct-tool-main > p:last-of-type {
  margin-bottom: 8px !important;
}

/* Bloque calculadora más cerca de la imagen */
.ct-calculator {
  margin-top: 6px !important;
}

/* Si hay wrapper o sección antes de la calculadora */
.ct-tool-main .ct-calculator:first-of-type {
  margin-top: 6px !important;
}

/* Reducir aire del contenedor general */
.ct-tool-main {
  padding-top: 16px !important;
}

/* Ajuste de la nota interna superior */
.ct-calc-note {
  margin-bottom: 0 !important;
  padding: 10px 12px !important;
}


/* Compactar fuerte separación entre diagrama y calculadora */
.ct-tools-hero.small {
  margin-bottom: 0 !important;
  padding-bottom: 0.75rem !important;
}

.ct-tool-main {
  padding-top: 0.75rem !important;
}

.ct-tool-main > .ct-intro,
.ct-tool-main > div.ct-intro {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.ct-tool-main p {
  margin-bottom: 0.65rem;
}

.ct-tool-image {
  margin-top: 10px !important;
  margin-bottom: 0 !important;
  padding-bottom: 8px !important;
}

.ct-tool-image figcaption {
  margin-top: 4px !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.ct-tool-layout {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.ct-calculator {
  margin-top: 0 !important;
}

/* Si el bloque de cálculo queda dentro de tarjeta, reducir aire superior */
.ct-tool-layout .ct-tool-main,
.ct-tool-layout .ct-tool-main .ct-calculator {
  margin-top: 0 !important;
}

/* Reducir espacio superior de la caja donde está la calculadora */
.ct-calculator > .ct-calc-form {
  margin-top: 0 !important;
}

/* Nota interna más compacta */
.ct-calc-note {
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
}


/* Secciones SEO del detalle de calculadora */
.ct-content-section {
  margin-top: 1.4rem;
}

.ct-content-section h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #102033;
  line-height: 1.25;
}

.ct-section-text {
  color: #102033;
  line-height: 1.7;
}

.ct-section-text h3 {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  color: #102033;
  font-size: 1.1rem;
}

.ct-section-text p {
  margin-top: 0;
  margin-bottom: 0.8rem;
}

.ct-intro p {
  line-height: 1.65;
}


/* Plantilla multi converter */
.ct-form-converter {
  grid-template-columns: 1fr 1fr;
}

.ct-form-converter .ct-calc-note,
.ct-form-converter .ct-action-field {
  grid-column: 1 / -1;
}

.ct-converter-summary {
  margin-bottom: 0.85rem;
  font-size: 1.05rem;
}

.ct-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 0.75rem;
}

.ct-result-grid > div {
  background: #ffffff;
  border: 1px solid #cfe0f2;
  border-radius: 12px;
  padding: 0.75rem;
}

.ct-result-grid span {
  display: block;
  color: #64748b;
  font-size: 0.86rem;
  margin-bottom: 0.25rem;
}

.ct-result-grid strong {
  color: #102033;
  font-size: 1.02rem;
}

@media (max-width: 760px) {
  .ct-form-converter {
    grid-template-columns: 1fr;
  }

  .ct-result-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .ct-result-grid {
    grid-template-columns: 1fr;
  }
}


/* Mejor visibilidad de unidades en resultados de conversores */
.ct-result-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ct-result-grid span {
  font-size: 1.08rem !important;
  font-weight: 800 !important;
  color: #0f2742 !important;
  letter-spacing: 0.01em;
}

.ct-result-grid strong {
  font-size: 1.12rem !important;
  color: #102033 !important;
  line-height: 1.25;
  word-break: break-word;
}

.ct-converter-summary strong {
  font-size: 1.12rem;
}


/* Conversor de presión agrupado por familias de unidades */
.ct-pressure-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  margin-top: 1rem;
}

.ct-pressure-group {
  background: #fffaf0;
  border: 1px solid #fde68a;
  border-radius: 14px;
  overflow: hidden;
}

.ct-pressure-group h3 {
  margin: 0;
  padding: 0.7rem 0.85rem;
  background: #fff3bf;
  color: #c2410c;
  font-size: 1.18rem;
  line-height: 1.25;
}

.ct-pressure-table {
  display: grid;
}

.ct-pressure-table > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid rgba(217, 119, 6, 0.16);
}

.ct-pressure-table > div:nth-child(odd) {
  background: #fff7cc;
}

.ct-pressure-table > div:nth-child(even) {
  background: #ffec80;
}

.ct-pressure-table span {
  color: #1677e8;
  font-size: 0.98rem;
  line-height: 1.25;
  font-weight: 600;
}

.ct-pressure-table strong {
  color: #102033;
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.ct-converter-summary {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
  .ct-pressure-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .ct-pressure-table > div {
    grid-template-columns: 1fr;
  }

  .ct-pressure-table strong {
    text-align: left;
    white-space: normal;
  }
}


/* Estilo limpio para resultados agrupados de presión - reemplaza apariencia amarilla */
.ct-pressure-groups {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1rem 1.25rem !important;
  margin-top: 1rem !important;
}

.ct-pressure-group {
  background: #ffffff !important;
  border: 1px solid #dbe7f5 !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04) !important;
}

.ct-pressure-group h3 {
  margin: 0 !important;
  padding: 0.78rem 0.95rem !important;
  background: #f1f6fc !important;
  color: #102033 !important;
  border-bottom: 1px solid #dbe7f5 !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
}

.ct-pressure-table {
  display: grid !important;
  background: #ffffff !important;
}

.ct-pressure-table > div {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 0.75rem !important;
  align-items: center !important;
  padding: 0.7rem 0.95rem !important;
  border-top: 1px solid #eef3f8 !important;
  background: #ffffff !important;
}

.ct-pressure-table > div:nth-child(odd) {
  background: #ffffff !important;
}

.ct-pressure-table > div:nth-child(even) {
  background: #f8fbff !important;
}

.ct-pressure-table span {
  color: #1d4ed8 !important;
  font-size: 0.98rem !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
}

.ct-pressure-table strong {
  color: #102033 !important;
  font-size: 1.08rem !important;
  line-height: 1.25 !important;
  font-weight: 850 !important;
  text-align: right !important;
  white-space: nowrap !important;
}

.ct-converter-summary {
  background: #f8fbff !important;
  border: 1px solid #dbe7f5 !important;
  border-radius: 14px !important;
  padding: 0.85rem 1rem !important;
  margin-bottom: 1rem !important;
  color: #102033 !important;
}

.ct-converter-summary strong {
  color: #0f2742 !important;
  font-size: 1.12rem !important;
}

@media (max-width: 900px) {
  .ct-pressure-groups {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 520px) {
  .ct-pressure-table > div {
    grid-template-columns: 1fr !important;
  }

  .ct-pressure-table strong {
    text-align: left !important;
    white-space: normal !important;
  }
}


/* Ajuste visual de números en conversor de presión */
.ct-pressure-table strong {
  font-weight: 700 !important;
  color: #16304d !important;
  font-size: 1rem !important;
  letter-spacing: 0 !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.ct-pressure-table span {
  color: #1d4ed8 !important;
  font-size: 0.97rem !important;
  font-weight: 650 !important;
  line-height: 1.3 !important;
}

.ct-pressure-table sup {
  font-size: 0.78em;
  vertical-align: super;
}

.ct-pressure-table > div {
  padding-top: 0.65rem !important;
  padding-bottom: 0.65rem !important;
}

.ct-converter-summary strong {
  font-weight: 700 !important;
}


/* Nota de formato numérico en conversor de presión */
.ct-format-note {
  margin: 0.9rem 0 0;
  padding: 0.75rem 0.9rem;
  border-left: 4px solid #2563eb;
  background: #f8fbff;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.45;
  border-radius: 10px;
}


/* Centrar títulos de grupos en conversor de presión */
.ct-pressure-group h3 {
  text-align: center !important;
  justify-content: center !important;
}


/* Título visual en barra lateral sin afectar jerarquía H1/H2/H3 */
.ct-side-title {
  font-weight: 800;
  color: #102033;
  font-size: 1.05rem;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}


.ct-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.ct-card {
  background: #fff;
  border: 1px solid #dbe7f5;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.ct-card h2 {
  font-size: 1.08rem;
  margin-top: 0;
}

.ct-related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.ct-related-list a {
  display: inline-block;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  background: #f1f6fc;
  border: 1px solid #dbe7f5;
  font-weight: 700;
  text-decoration: none;
}


/* Ajuste visual para formularios de conversores dinámicos */
.ct-calculator .ct-form-converter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: end;
  margin-top: 1rem;
}

.ct-calculator .ct-form-converter label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-weight: 700;
  color: #0f172a;
}

.ct-calculator .ct-form-converter label span {
  font-size: 0.98rem;
  line-height: 1.3;
}

.ct-calculator .ct-form-converter input,
.ct-calculator .ct-form-converter select {
  width: 100%;
  min-height: 52px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  background: #fff;
  color: #0f172a;
}

.ct-calculator .ct-form-converter button {
  min-height: 52px;
  border-radius: 14px;
}

@media (max-width: 720px) {
  .ct-calculator .ct-form-converter {
    grid-template-columns: 1fr;
  }
}
