/**
 * Grupo FAM - Elementor Ecosystem & Company Directory Styles
 * Autocontenido, aislado y 100% idéntico a la maqueta original.
 */

:root,
.elementor-widget-fam_directory,
.elementor-widget-fam_ecosystem_overview,
.directory-section {
  --fam-paper: #f8f8f6;
  --fam-ink: #171717;
  --fam-muted: #62625d;
  --fam-line: #d6d6d0;
  --fam-accent: #212c5d;
  --fam-card-bg: #ffffff;
  --fam-font: 'Editorial', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fam-space: clamp(24px, 4.15vw, 80px);
}

/* ==========================================================================
   1. AISLAMIENTO Y ESTRUCTURA GENERAL
   ========================================================================== */
.directory-section {
  font-family: var(--fam-font);
  color: var(--fam-ink);
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  padding-block: 112px;
}

.directory-section *,
.directory-section *::before,
.directory-section *::after {
  box-sizing: border-box;
}

.directory-section.container,
.directory-section .container {
  margin-inline: auto;
  width: calc(100% - var(--fam-space) * 2);
  max-width: 1600px;
}

/* ==========================================================================
   2. ENCABEZADOS Y LABELS
   ========================================================================== */
.directory-section .section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 44px;
  line-height: 1.4;
  color: var(--fam-ink);
  letter-spacing: -0.01em;
}

.directory-section .section-label > span {
  color: var(--fam-muted);
  font-size: 12px;
  font-weight: 600;
}

.directory-section .section-heading {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: end;
  gap: 9%;
  margin-bottom: 55px;
}

.directory-section .section-heading h2 {
  font-size: clamp(2.4rem, 4.2vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-weight: 500;
  margin: 0;
  color: var(--fam-ink);
}

/* ==========================================================================
   3. CONTROLES: BUSCADOR Y FILTROS POR CATEGORÍA
   ========================================================================== */
.directory-controls,
.fam-directory-controls {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--fam-line);
}

.search-label,
.fam-search-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  max-width: 530px;
  margin-bottom: 25px;
  color: var(--fam-ink);
}

.search-label input,
.fam-search-label input,
.fam-company-search {
  display: block;
  width: 100%;
  border: 1px solid var(--fam-line);
  background: var(--fam-paper);
  padding: 13px 16px;
  margin-top: 8px;
  border-radius: 4px;
  font-size: 15px;
  color: var(--fam-ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.search-label input:focus,
.fam-search-label input:focus,
.fam-company-search:focus {
  border-color: var(--fam-accent);
  box-shadow: 0 0 0 3px rgba(33, 44, 93, 0.12);
}

.search-label input::placeholder,
.fam-search-label input::placeholder {
  color: var(--fam-muted);
  opacity: 1;
}

.filter-group,
.fam-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.filter-button,
.fam-filter-btn {
  border: 1px solid var(--fam-line);
  background: transparent;
  color: var(--fam-ink);
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  line-height: 1;
  text-decoration: none;
}

.filter-button:hover,
.filter-button.active,
.fam-filter-btn:hover,
.fam-filter-btn.active {
  background: var(--fam-ink);
  color: #ffffff;
  border-color: var(--fam-ink);
}

.section-footnote,
#company-count,
.fam-company-count {
  font-size: 13px;
  color: var(--fam-muted);
  line-height: 1.6;
  margin-top: 24px;
  margin-bottom: 0;
  display: block;
}

/* ==========================================================================
   4. GRILLA Y TARJETAS DE EMPRESAS
   ========================================================================== */
.directory-grid,
.fam-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 28px;
}

.company-card,
.fam-company-card {
  border: 1px solid var(--fam-line);
  background: var(--fam-card-bg);
  border-radius: 6px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.company-card:hover,
.fam-company-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.06);
  border-color: rgba(33, 44, 93, 0.3);
}

.company-logo-link,
.fam-card-logo-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 165px;
  height: 60px;
  margin-bottom: 22px;
  text-decoration: none;
}

.company-card .company-logo {
  max-height: 52px;
  max-width: 155px;
  width: auto;
  height: auto;
  object-fit: contain !important;
  mix-blend-mode: multiply;
  filter: saturate(1.06) contrast(1.04);
  opacity: 0.92;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.company-card:hover .company-logo,
.company-logo-link:hover .company-logo {
  filter: none;
  opacity: 1;
}

.company-card .mini-label,
.fam-company-card .mini-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--fam-muted);
  line-height: 1.5;
  min-height: 36px;
  margin-bottom: 14px;
  font-weight: 600;
  text-transform: uppercase;
}

.company-card h3,
.fam-company-card h3 {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  font-weight: 500;
  color: var(--fam-ink);
}

.company-card > p:not(.mini-label),
.fam-company-card > p:not(.mini-label) {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fam-muted);
  margin: 0 0 16px;
  flex: 1;
}

.company-card dl,
.fam-company-card dl {
  width: 100%;
  margin: 22px 0 25px;
  border-top: 1px solid var(--fam-line);
  padding-top: 14px;
}

.company-card dt,
.fam-company-card dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--fam-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

.company-card dd,
.fam-company-card dd {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--fam-ink);
  margin: 0 0 14px;
}

.company-card .text-link,
.fam-company-card .text-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--fam-ink);
  border: 0;
  border-bottom: 1px solid currentColor;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition: gap 0.25s ease, color 0.25s ease;
  line-height: 1.3;
}

.company-card .text-link svg,
.fam-company-card .text-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.company-card .text-link:hover,
.fam-company-card .text-link:hover {
  color: var(--fam-accent);
  gap: 22px;
}

.company-card .text-link:hover svg,
.fam-company-card .text-link:hover svg {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   5. ESTADO VACÍO (SIN RESULTADOS)
   ========================================================================== */
.empty-search,
.fam-empty-search {
  text-align: center;
  border-bottom: 1px solid var(--fam-line);
  border-top: 1px dashed var(--fam-line);
  padding: 55px 25px;
  margin-top: 28px;
  border-radius: 4px;
}

.empty-search h3,
.fam-empty-search h3 {
  font-size: 27px;
  margin-bottom: 15px;
  font-weight: 500;
  color: var(--fam-ink);
}

.empty-search p,
.fam-empty-search p {
  font-size: 16px;
  color: var(--fam-muted);
  margin-bottom: 20px;
}

.empty-search .text-link,
.fam-empty-search .text-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fam-ink);
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.2s ease, gap 0.2s ease;
}

.empty-search .text-link:hover,
.fam-empty-search .text-link:hover {
  color: var(--fam-accent);
  gap: 18px;
}

.empty-search .text-link svg,
.fam-empty-search .text-link svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   6. 4 PILARES DEL ECOSISTEMA
   ========================================================================== */
.capability-overview,
.fam-capability-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--fam-line);
  border-left: 1px solid var(--fam-line);
}

.capability-overview > a,
.fam-capability-card {
  display: grid;
  grid-template-columns: 1fr 28px;
  gap: 20px;
  padding: 40px;
  border-bottom: 1px solid var(--fam-line);
  border-right: 1px solid var(--fam-line);
  background: transparent;
  text-decoration: none;
  color: var(--fam-ink);
  transition: background 0.3s ease, color 0.3s ease;
}

.capability-overview > a:hover,
.fam-capability-card:hover {
  background: var(--fam-accent);
  color: #ffffff;
}

.capability-overview h3,
.fam-capability-card h3 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 500;
  margin: 0 0 12px;
}

.capability-overview span,
.fam-capability-card span {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fam-muted);
  grid-column: 1;
  max-width: 500px;
  transition: color 0.3s ease;
}

.capability-overview > a:hover span,
.fam-capability-card:hover span {
  color: #e3e7f3;
}

.capability-overview svg,
.fam-capability-card svg {
  grid-column: 2;
  grid-row: 1;
  width: 22px;
  height: 22px;
  color: var(--fam-muted);
  transition: transform 0.25s ease, color 0.25s ease;
}

.capability-overview > a:hover svg,
.fam-capability-card:hover svg {
  color: #ffffff;
  transform: translate(3px, -3px);
}

/* ==========================================================================
   7. RESPONSIVIDAD
   ========================================================================== */
@media (max-width: 1100px) {
  .directory-grid,
  .fam-directory-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .directory-section .section-heading {
    gap: 6%;
  }
}

@media (max-width: 760px) {
  .directory-section {
    padding-block: 65px;
  }
  .directory-section .section-heading {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 35px;
  }
  .directory-section .section-heading h2 {
    font-size: clamp(2.1rem, 7.5vw, 3.6rem);
    line-height: 1.08;
  }
  .directory-grid,
  .fam-directory-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .company-card,
  .fam-company-card {
    padding: 24px;
  }
  .company-card h3,
  .fam-company-card h3 {
    font-size: 24px;
  }
  .capability-overview,
  .fam-capability-grid {
    grid-template-columns: 1fr;
  }
  .capability-overview > a,
  .fam-capability-card {
    padding: 28px;
  }
  .filter-group,
  .fam-filter-group {
    gap: 7px;
  }
  .filter-button,
  .fam-filter-btn {
    font-size: 13px;
    padding: 10px 14px;
  }
}
