/* ==============================
   FQC - Empresas Representadas (solo esta vista)
   ============================== */

/* ===== HERO EMPRESAS REPRESENTADAS ===== */
body .page-title.hero-empresas{
  --hero-h: clamp(360px, 45vh, 520px);
  min-height: var(--hero-h);
  display:flex;
  align-items:center;
  width:100%;
  overflow:hidden;

  background-image:none !important;
  background-color:#f5f9fc !important;

  background: url("../imagenes/EmpresasRepresentadas_2.png?v=1") right center / auto 100% no-repeat,
              #f5f9fc !important;
}
body .page-title.hero-empresas::before,
body .page-title.hero-empresas::after{ content:none !important; display:none !important; }
body .page-title.hero-empresas > .container{ position:relative; z-index:1; }
body .page-title.hero-empresas .white-bg{ background:transparent !important; box-shadow:none !important; border:0 !important; }
body .page-title.hero-empresas .page-breadcrumb{ border-top:0 !important; }

/* ===== Imagen real móvil/tablet ===== */
body .page-title.hero-empresas .hero-bg-mobile{ display:none; }
@media (max-width: 991.98px){
  body .page-title.hero-empresas{
    background:#f5f9fc !important;
    min-height:auto !important;
    height:auto !important;
    overflow:hidden !important;
    position:relative;
    padding:0 !important;
  }
  body .page-title.hero-empresas .hero-bg-mobile{
    display:block;
    width:100%;
    height:auto;
    max-width:100%;
    object-fit:contain;
  }
  body .page-title.hero-empresas > .container{
    position:absolute !important;
    left:0; right:0;
    top:0;
    z-index:2;
  }
  body .page-title.hero-empresas .white-bg{ margin-top:0.75rem; }
}

/* ===== Breadcrumb responsive ===== */
@media (max-width: 991.98px){
  body .page-title .page-breadcrumb .breadcrumb{
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:center !important;
  }
  body .page-title .page-breadcrumb .breadcrumb .breadcrumb-item.active{
    flex:0 0 100% !important;
    width:100% !important;
    display:inline-flex !important;
    align-items:center !important;
    margin-top:.25rem !important;
    padding-left: inherit !important;
    white-space: normal !important;
  }
  body .page-title .page-breadcrumb .breadcrumb .breadcrumb-item.active::before{
    display:inline-block !important;
    float:none !important;
  }
  body .page-title .page-breadcrumb .breadcrumb .breadcrumb-item + .breadcrumb-item::before{
    display:inline-block !important;
    float:none !important;
  }
}

/* ===== GRID empresas ===== */
.empresas-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:24px;
}
@media (max-width:1400px){ .empresas-grid{ grid-template-columns:repeat(4,1fr); } }
@media (max-width:1200px){ .empresas-grid{ grid-template-columns:repeat(4,1fr); } }
@media (max-width:992px){  .empresas-grid{ grid-template-columns:repeat(3,1fr); } }
@media (max-width:768px){  .empresas-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:576px){  .empresas-grid{ grid-template-columns:1fr; } }

.empresa-card{
  background:#fff;
  border:1px solid #e9eaed;
  border-radius:.5rem;
  padding:16px;
  text-align:center;
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
}

.empresa-logo{
  height:110px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom:12px;
  overflow:hidden;
  position:relative;
  z-index:1;
}
.empresa-logo img{
  max-height:100%;
  max-width:100%;
  object-fit:contain;
  display:block;
}

.empresa-logo .logo-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.empresa-logo .logo-link img{
  transition: transform .25s ease, filter .25s ease, box-shadow .25s ease;
}
.empresa-logo .logo-link:hover img,
.empresa-logo .logo-link:focus img{
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 6px 12px rgba(32,91,140,.25));
}

/* ✅ FIX PRO: Reset del H2 SOLO aquí para que no aplique estilos globales del theme */
.empresa-card h2.empresa-nombre{
  margin: 0 0 6px !important;
  padding: 0 !important;
  font-size: 0.95rem !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  color: #205b8c !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* ✅ evita “tarjetas disparejas” si algún nombre es largo */
.empresa-card h2.empresa-nombre{
  display: -webkit-box;
  -webkit-line-clamp: 2;       /* máximo 2 líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(0.95rem * 1.25 * 2); /* reserva espacio para 2 líneas */
}

/* Descripción */
.empresa-desc{
  margin:0;
  line-height:1.5;
  color:#205b8c;
  position:relative;
  z-index:2;
}

/* “…” */
.desc-more{
  border:0;
  background:transparent;
  cursor:pointer;
  font-weight:700;
  padding:0 2px;
  color:#ff8f0f;
  line-height:1;
}
.desc-more:hover,
.desc-more:focus{
  color:#205b8c;
  outline:none;
  text-decoration:underline;
}

.empresa-nombre-link{
  color: inherit;
  text-decoration: none;
}
.empresa-nombre-link:hover,
.empresa-nombre-link:focus{
  text-decoration: underline;
}

/* =========================================================
   FIX SOLO para empresa.php (DETALLE) en desktop/laptop
   - En detalle existe .empresa-logo con inline height:180px
   - Usamos :has() para detectar esa vista sin tocar PHP
   - Agregamos “colchón” inferior para que el footer no solape
   ========================================================= */

@media (min-width: 992px){
  body:has(.empresa-logo[style*="height:180px"]) .container-fluid.light-bg{
    padding-bottom: 220px !important; /* ajusta 180-280 si tu footer es más alto */
  }
}