/* ==============================
   FQC HOME (index.php)
   NO cambia diseño/funcionalidad.
   Optimización ligera de carga visual.
   ============================== */

/* ==============================
   BOTONES HERO (Nosotros / Contacto)
   ============================== */
.boton-personalizado{
  position: relative;
  display: inline-block;
  padding: 10px 20px;
  font-size: 1rem;
  color: #ffffff;
  text-decoration: none;
  border: none;
  font-weight: bold;
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.4s ease;
  z-index: 1;
}
.boton-personalizado::before{
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  z-index: -1;
  transition: all 0.4s ease;
}

.btn-nosotros{ background-color: #205b8c; }
.btn-nosotros::before{ background-color: #ff8f0f; }
.btn-nosotros:hover{
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 143, 15, 0.3);
}
.btn-nosotros:hover::before{ left: 0; }

.btn-contacto{ background-color: #ff8f0f; }
.btn-contacto::before{ background-color: #205b8c; }
.btn-contacto:hover{
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(32, 91, 140, 0.3);
}
.btn-contacto:hover::before{ left: 0; }

/* ==============================
   HERO - estable para bajar CLS
   ============================== */
.hero-wrap{
  margin-top: 0;
  min-height: clamp(520px, 70vh, 760px);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  --video-shift: clamp(12px, 2vw, 28px);
}

.hero-bg{
  background-color: #e9eef2;
  background-image: url('/imagenes/FQC_Almacen_2400blur.avif');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  width: 100%;
  min-height: clamp(520px, 70vh, 760px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Pantallas GRANDES (monitores) */
@media (min-width: 1700px){
  .hero-bg{
    background-image: url('/imagenes/FQC_Almacen_2400blur.avif');
  }
}

/* CELULARES */
@media (max-width: 575.98px){
  .hero-bg{
    background-image: url('/imagenes/FQC_Almacen_45.avif');
    background-position: center top;
    background-size: cover;
    min-height: 640px;
  }
}

/* En desktop: mostrar la imagen completa, sin zoom agresivo */
@media (min-width: 1200px){
  .hero-bg{
    background-size: 118% auto !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
  }
}

/* Overlay estable */
.hero-wrap .hero-overlay{
  min-height: clamp(520px, 70vh, 760px);
  width: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

/* Contenedor y fila con altura reservada */
.hero-wrap .container{
  width: 100%;
}

.hero-wrap .row{
  width: 100%;
  min-height: clamp(440px, 58vh, 640px);
}

/* Columnas del hero alineadas sin brincar */
.hero-wrap .video-col,
.hero-wrap .hero-card{
  will-change: auto;
}

.hero-wrap .video-col{
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-wrap .video-col iframe{
  width: 100%;
  max-width: 560px;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  flex: 0 0 auto;
}

/* Ajuste: corre el video ligeramente a la izquierda solo en >= LG */
@media (min-width: 992px){
  .hero-wrap .video-col{
    transform: translateX(calc(var(--video-shift) * -1));
  }
}

/* Tarjeta de texto estable */
.hero-card{
  background: rgba(255,255,255,.86);
  border-radius: 14px;
  padding: clamp(14px, 2vw, 26px);
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  border: 1px solid rgba(255,255,255,.35);
  width: 100%;
  max-width: 620px;
  min-height: 320px;
  box-sizing: border-box;
}

@supports ((-webkit-backdrop-filter: blur(6px)) or (backdrop-filter: blur(6px))){
  .hero-card{
    background: rgba(255,255,255,.74);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
}

/* IMPORTANTE: tu <p> trae inline color:white; aquí lo forzamos a azul FQC */
.hero-card p{
  color: #205b8c !important;
  margin-bottom: 0;
  line-height: 1.55 !important;
}

/* Alturas y ritmo tipográfico más estables */
.hero-card h1{
  line-height: 1.15;
  margin-bottom: 18px !important;
}

.hero-card .fqc-home-inline-link,
.hero-card .fqc-home-inline-link:visited {
  color: #ff8f0f !important;
  font-family: Century Gothic !important;
  text-decoration: none;
  transition: color .2s ease;
}

.hero-card .fqc-home-inline-link:hover,
.hero-card .fqc-home-inline-link:focus {
  color: #205b8c !important;
  font-family: Century Gothic !important;
  text-decoration: underline;
}

@media (max-width: 991.98px){
  .hero-wrap{
    min-height: auto;
  }

  .hero-bg{
    min-height: auto;
    background-size: cover !important;
  }

  .hero-wrap .hero-overlay{
    min-height: auto;
  }

  .hero-wrap .row{
    min-height: auto;
  }

  .hero-card{
    min-height: unset;
    padding: 16px;
    border-radius: 12px;
  }

  .hero-wrap .video-col{
    transform: none !important;
  }
}

/* ==============================
   EMPRESAS REPRESENTADAS
   ============================== */
.owl-carousel .client-logo{
  text-align: center;
  display: flex;
  justify-content: center;
}
.owl-carousel .client-logo img{
  display: inline-block;
  margin: 0 auto;
}

/* ==============================
   MERCADOS (CONSOLIDADO)
   ============================== */

/* Icono negro -> blanco al hover */
#mercados .featured-item .icon-hover{ display: none; }
#mercados .featured-item:hover .icon-default{ display: none; }
#mercados .featured-item:hover .icon-hover{ display: inline; }

/* Tarjeta base + transición */
#mercados .featured-item{
  background: #fff;
  border: 1px solid #e9eaed;
  padding: 24px 18px;
  height: 100%;
  transition: background-color .25s ease, color .25s ease, box-shadow .25s ease;
  text-align: center;
}

/* Hover con azul corporativo */
#mercados .featured-item:hover{
  background: #205b8c !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

/* Texto a blanco en hover */
#mercados .featured-item:hover .featured-title h5,
#mercados .featured-item:hover .featured-desc,
#mercados .featured-item:hover .featured-desc p,
#mercados .featured-item:hover a,
#mercados .featured-item:hover .fqc_naranja,
#mercados .featured-item:hover .fqc_azul{
  color: #fff !important;
  text-decoration: none;
}

/* Tamaño seguro de iconos */
#mercados .featured-item .featured-icon img{
  width: 64px;
  height: 64px;
}

/* Centrar icono */
#mercados .featured-item .featured-icon{
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Centrar título */
#mercados .featured-item .featured-title,
#mercados .featured-item .featured-title h5{
  text-align: center !important;
  margin-left: auto;
  margin-right: auto;
}

/* ===== 5 columnas por fila (pantallas grandes) ===== */
#mercados .row{
  display: flex;
  flex-wrap: wrap;
}
#mercados .row > [class*="col-"]{
  flex: 0 0 20%;
  max-width: 20%;
  padding-left: 12px;
  padding-right: 12px;
}

/* Reset para la fila del encabezado: 100% */
#mercados .row.mb-4 > [class*="col-"]{
  flex: 0 0 100%;
  max-width: 100%;
}

/* Responsivo cómodo */
@media (max-width: 1199.98px){
  #mercados .row > [class*="col-"]{ flex: 0 0 25%; max-width: 25%; }
}
@media (max-width: 991.98px){
  #mercados .row > [class*="col-"]{ flex: 0 0 33.3333%; max-width: 33.3333%; }
}
@media (max-width: 767.98px){
  #mercados .row > [class*="col-"]{ flex: 0 0 50%; max-width: 50%; }
}
@media (max-width: 575.98px){
  #mercados .row > [class*="col-"]{ flex: 0 0 100%; max-width: 100%; }
}

#mercados .row.mb-4{ text-align: center; }
#mercados .row.mb-4 p{ max-width: 800px; margin: 0 auto; }
#mercados .row.mb-4 .col-12{
  display: flex;
  flex-direction: column;
  align-items: center;
}
#mercados .row.mb-4 h2,
#mercados .row.mb-4 p{
  text-align: center !important;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* EN: que no parezca enlace cuando anulamos clic */
#mercados .featured-title .no-link{
  cursor: default;
  text-decoration: none;
}

/* ==============================
   INTERACTUANDO
   ============================== */
#interactuando{ padding-bottom: 64px; margin-bottom: 24px; }

/* Apaga overlays del theme */
#interactuando .cases-item,
#interactuando .cases-item::before,
#interactuando .cases-item::after,
#interactuando .cases-item .overlay,
#interactuando .cases-item .img-overlay,
#interactuando .cases-item .cases-overlay{
  content: none !important;
  display: none !important;
  background: transparent !important;
  opacity: 0 !important;
}

/* Tarjeta clickeable */
#interactuando .interact-card{
  width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

/* Contenedor img */
#interactuando .interact-card .thumb{
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Imagen completa (contain) + suave zoom */
#interactuando .interact-card .thumb img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: none !important;
  transition: transform .35s ease;
}
#interactuando .interact-card:hover .thumb img{ transform: scale(1.06); }

/* Etiqueta en hover */
#interactuando .interact-card .label{
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: #205b8c;
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
  padding: .35rem .6rem;
  line-height: 1;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
}
#interactuando .interact-card:hover .label{
  opacity: 1;
  transform: translateY(0);
}

/* SR only */
#interactuando .sr-only{
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 576px){
  #interactuando .interact-card{ width: 220px; }
  #interactuando .interact-card .thumb{ height: 180px; }
}

/* ==============================
   MERCADOS - FIX: tarjetas mismo tamaño
   ============================== */
#mercados .col-mercado{
  flex: 0 0 20%;
  max-width: 20%;
  padding-left: 12px;
  padding-right: 12px;
  display: flex;
}

@media (max-width: 1199.98px){
  #mercados .col-mercado{ flex: 0 0 25%; max-width: 25%; }
}
@media (max-width: 991.98px){
  #mercados .col-mercado{ flex: 0 0 33.3333%; max-width: 33.3333%; }
}
@media (max-width: 767.98px){
  #mercados .col-mercado{ flex: 0 0 50%; max-width: 50%; }
}
@media (max-width: 575.98px){
  #mercados .col-mercado{ flex: 0 0 100%; max-width: 100%; }
}

#mercados .col-mercado > a{
  width: 100%;
  display: flex !important;
}

#mercados .featured-item{
  width: 100%;
  min-height: 170px;
  height: 100%;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center;
  align-items: center;
  padding: 22px 18px;
  text-align: center;
}

#mercados .featured-icon{
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

#mercados .featured-item .featured-icon img{
  width: 64px !important;
  height: 64px !important;
  object-fit: contain;
  display: block;
}

#mercados .featured-title{
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mercados .featured-title h5{
  margin: 0 !important;
  line-height: 1.15;
  max-width: 100%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

#mercados .featured-item.style-1{
  height: 100% !important;
}

/* ==============================
   MERCADOS - FIX: iconos hover
   ============================== */
#mercados .featured-icon{
  position: relative;
}

#mercados .featured-icon .icon-default,
#mercados .featured-icon .icon-hover{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

#mercados .featured-icon .icon-default,
#mercados .featured-icon .icon-hover{
  width: 64px !important;
  height: 64px !important;
  object-fit: contain !important;
}

#mercados .featured-item .icon-hover{ opacity: 0; }
#mercados .featured-item:hover .icon-hover{ opacity: 1; }
#mercados .featured-item:hover .icon-default{ opacity: 0; }

/* ==============================
   Optimización ligera de render
   Solo secciones debajo del hero
   ============================== */
#mercados,
#interactuando{
  content-visibility: auto;
  contain-intrinsic-size: 800px;
}


/* ==============================
   VIDEO HERO - optimización móvil
   Desktop conserva iframe normal
   Mobile usa portada + play
   ============================== */
.fqc-video-desktop{
  width: 100%;
  justify-content: center;
  align-items: center;
}

.fqc-video-mobile{
  width: 100%;
}

.fqc-video-lite{
  position: relative;
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}

.fqc-video-lite img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fqc-video-play{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 54px;
  border-radius: 14px;
  background: rgba(0,0,0,.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform .2s ease, background-color .2s ease;
}

.fqc-video-play::before{
  content: "";
  display: block;
  margin-left: 4px;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 20px solid #fff;
}

.fqc-video-lite:hover .fqc-video-play,
.fqc-video-lite:focus .fqc-video-play{
  transform: translate(-50%, -50%) scale(1.05);
  background: #ff0000;
}

@media (max-width: 991.98px){
  .fqc-video-mobile iframe{
    width: 100%;
    max-width: 560px;
    height: auto;
    aspect-ratio: 16 / 9;
    display: block;
    margin: 0 auto;
  }
}

/* =========================
   VIDEO HERO FQC
   ========================= */
.fqc-video-shell {
  width: 100%;
}

.fqc-video-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0;
  background: #000;
}

.fqc-video-lite,
.fqc-video-box iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.fqc-video-lite {
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.fqc-video-lite img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.fqc-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 78px;
  height: 54px;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.68);
  pointer-events: none;
}

.fqc-video-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-35%, -50%);
  width: 0;
  height: 0;
  border-left: 18px solid #fff;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

/* opcional: si en móvil quieres que no se vea gigante */
@media (max-width: 991.98px) {
  .fqc-video-box {
    max-width: 100%;
  }
}