/* Eliminar pseudo-elementos que interfieren */
.equipo .row::before,
.equipo .row::after,
.equipo .dis::before,
.equipo .dis::after {
  display: none !important;
  content: none !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Cormorant Infant", serif;
  background: #f8f9fa;
  color: #222;
  line-height: 1.6;
}

/* Wrapper para centrar todo el contenido */
.wp-block-html {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

.container-fluid.equipo {
  width: 100%;
  max-width: 1400px;
  padding: 60px 20px;
  margin: 0 auto;
  display: block;
}

.equipo.agenteslista {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.equipo h1 {
  font-family: "Cormorant Infant", serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 60px;
  color: #222;
  position: relative;
  width: 100%;
}

.equipo h1::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: #871c25;
  margin: 20px auto 0;
  border-radius: 2px;
}

.equipo .dis {
  width: 100%;
  display: flex;
  justify-content: center;
}

.equipo .row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 30px !important;
  width: 100% !important;
  max-width: 1400px;
  justify-content: center !important;
  justify-items: center !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

.equipo .row .gestor,
.equipo .row .gestor.w-20 {
  width: 100% !important;
  max-width: 350px !important;
  flex: none !important;
  display: block !important;
  perspective: 1000px;
  margin: 0 auto;
}

/* TARJETA FLIP */
.tarjeta-flip {
  position: relative;
  width: 100%;
  height: 420px;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  cursor: pointer;
}

.gestor:hover .tarjeta-flip {
  transform: rotateY(180deg);
}

.cara-frontal,
.cara-trasera {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.cara-frontal {
  display: flex;
  flex-direction: column;
}

.cara-trasera {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

/* CARA FRONTAL */
.equipo .fotoagente {
  position: relative;
  width: 100%;
  padding-top: 75%;
  overflow: hidden;
  background: #e9ecef;
  flex-shrink: 0;
}

.equipo .fotoagente img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.4s ease;
}

.gestor:hover .fotoagente img {
  filter: none;
}

.equipo .fotoagente.innodeco::before {
  content: "Innodeco";
  position: absolute;
  top: 12px;
  right: 12px;
  background: #871c25;
  color: white;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: "Cormorant Infant", serif;
}

.equipo h6.nombre {
  font-family: "Cormorant Infant", serif;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  color: #222;
  margin: 20px 20px 8px;
  text-align: center;
}

.equipo p.cargo {
  font-family: "Cormorant Infant", serif;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: #666;
  margin: 0 20px 20px;
  text-align: center;
  font-weight: 400;
}

/* CARA TRASERA */
.datos-contacto {
  width: 100%;
  text-align: center;
}

.nombre-back {
  font-family: "Cormorant Infant", serif;
  font-size: clamp(1.2rem, 2.5vw, 1.4rem);
  font-weight: 700;
  color: #222;
  margin-bottom: 25px;
}

.info-item {
  margin-bottom: 15px;
  font-family: "Cormorant Infant", serif;
}

.info-item .label {
  display: block;
  font-weight: 600;
  color: #871c25;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item a,
.info-item span {
  color: #222;
  text-decoration: none;
  font-size: clamp(0.9rem, 2vw, 1rem);
  word-break: break-word;
}

.info-item a:hover {
  color: #871c25;
}

.btn-ficha {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 25px;
  background: #871c25;
  color: white !important;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 25px;
  font-family: "Cormorant Infant", serif;
  font-weight: 600;
  font-size: clamp(0.85rem, 2vw, 1rem);
  transition: all 0.3s ease;
}

.btn-ficha:hover {
  background: #222;
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1200px) {
  .container-fluid.equipo {
    padding: 50px 20px;
  }

  .equipo h1 {
    margin-bottom: 50px;
  }
}

@media (max-width: 992px) {
  .container-fluid.equipo {
    padding: 40px 20px;
  }

  .equipo .row {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 25px !important;
  }

  .tarjeta-flip {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .container-fluid.equipo {
    padding: 40px 15px;
  }

  .equipo h1 {
    margin-bottom: 40px;
  }

  .equipo .row {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    gap: 20px !important;
  }

  .tarjeta-flip {
    height: 380px;
  }

  .cara-trasera {
    padding: 25px 20px;
  }
}

@media (max-width: 576px) {
  .container-fluid.equipo {
    padding: 40px 15px;
  }

  .equipo .row {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .equipo .row .gestor,
  .equipo .row .gestor.w-20 {
    max-width: 100% !important;
  }

  .tarjeta-flip {
    height: 400px;
  }

  .cara-trasera {
    padding: 20px 15px;
  }

  .nombre-back {
    margin-bottom: 20px;
  }

  .info-item {
    margin-bottom: 12px;
  }
}

@media (max-width: 400px) {
  .container-fluid.equipo {
    padding: 30px 10px;
  }

  .tarjeta-flip {
    height: 380px;
  }

  .btn-ficha {
    padding: 10px 20px;
  }
}

/* Soporte para pantallas táctiles - alternativa al hover */
@media (hover: none) and (pointer: coarse) {
  .tarjeta-flip {
    cursor: pointer;
  }

  .gestor.active .tarjeta-flip {
    transform: rotateY(180deg);
  }
}

/* Reset de pseudo-elementos */
.equipo .row::before,
.equipo .row::after,
.equipo .dis::before,
.equipo .dis::after {
  display: none !important;
  content: none !important;
}

/* Contenedor principal centrado */
.container-fluid.equipo {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto !important;
  padding: 0 20px;
}

.equipo.agenteslista {
  width: 100%;
  margin: 0 auto;
}

.equipo h1 {
  font-family: "Cormorant Infant", serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 60px;
  color: #222;
  position: relative;
}

.equipo h1::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: #871c25;
  margin: 20px auto 0;
  border-radius: 2px;
}

.equipo .dis {
  width: 100%;
}

.equipo .row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 30px !important;
  width: 100% !important;
  justify-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

.equipo .row .gestor,
.equipo .row .gestor.w-20 {
  width: 100% !important;
  max-width: 350px !important;
  perspective: 1000px;
}

/* TARJETA FLIP */
.tarjeta-flip {
  position: relative;
  width: 100%;
  height: 480px;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  cursor: pointer;
}

.gestor:hover .tarjeta-flip {
  transform: rotateY(180deg);
}

.cara-frontal,
.cara-trasera {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
}

/* CARA FRONTAL - Fondo transparente */
.cara-frontal {
  background: transparent;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

/* CARA TRASERA - Mantiene fondo blanco y sombra */
.cara-trasera {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

/* CARA FRONTAL - FOTO */
.equipo .fotoagente {
  position: relative;
  width: 100%;
  height: 390px;
  overflow: hidden;
  background: transparent;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid #eee;
}

.equipo .fotoagente img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: filter 0.4s ease, transform 0.4s ease;
}

/* Hover en la foto - recupera color y zoom sutil */
.gestor:hover .fotoagente img {
  filter: grayscale(0%);
  transform: scale(1.05);
}

.equipo .fotoagente.innodeco::before {
  content: "Innodeco";
  position: absolute;
  top: 12px;
  right: 12px;
  background: #871c25;
  color: white;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: "Cormorant Infant", serif;
}

/* NOMBRE Y CARGO - Por delante, sobre fondo transparente */
.equipo h6.nombre {
  font-family: "Cormorant Infant", serif;
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: #222;
  margin: 15px 20px 5px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

.equipo p.cargo {
  font-family: "Cormorant Infant", serif;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: #666;
  margin: 0 20px 15px;
  text-align: center;
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

/* CARA TRASERA */
.datos-contacto {
  width: 100%;
  text-align: center;
}

.nombre-back {
  font-family: "Cormorant Infant", serif;
  font-size: clamp(1.2rem, 2.5vw, 1.4rem);
  font-weight: 700;
  color: #222;
  margin-bottom: 25px;
}

.info-item {
  margin-bottom: 15px;
  font-family: "Cormorant Infant", serif;
}

.info-item .label {
  display: block;
  font-weight: 600;
  color: #871c25;
  font-size: clamp(1.05rem, 2vw, 1.15rem);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item a,
.info-item span {
  color: #222;
  text-decoration: none;
  font-size: clamp(1.15rem, 2.3vw, 1.35rem);
  word-break: break-word;
}

.info-item a:hover {
  color: #871c25;
}

.btn-ficha {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 25px;
  background: #871c25;
  color: white !important;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 25px;
  font-family: "Cormorant Infant", serif;
  font-weight: 600;
  font-size: clamp(0.85rem, 2vw, 1rem);
  transition: all 0.3s ease;
}

.btn-ficha:hover {
  background: #222;
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1200px) {
  .container-fluid.equipo {
    padding: 0 20px;
  }

  .equipo h1 {
    margin-bottom: 50px;
  }

  .equipo .row {
    grid-template-columns: repeat(auto, 1fr) !important;
  }
}

@media (max-width: 992px) {
  .equipo .row {
    grid-template-columns: repeat(auto, 1fr) !important;
    gap: 25px !important;
  }

  .tarjeta-flip {
    height: 460px;
  }

  .equipo .fotoagente {
    height: 370px;
  }
}

@media (max-width: 768px) {
  .container-fluid.equipo {
    padding: 0 15px;
  }

  .equipo h1 {
    margin-bottom: 40px;
  }

  .equipo .row {
    grid-template-columns: repeat(auto, 1fr) !important;
    gap: 20px !important;
  }

  .tarjeta-flip {
    height: 440px;
  }

  .equipo .fotoagente {
    height: 350px;
  }

  .cara-trasera {
    padding: 25px 20px;
  }
}

@media (max-width: 576px) {
  .equipo .row {
    gap: 20px !important;
    width: 100% !important;
  }

  .equipo .row .gestor,
  .equipo .row .gestor.w-20 {
    max-width: none !important; /* ✅ Sin límite de ancho máximo */
    width: 100% !important;
  }

  .tarjeta-flip {
    height: 520px; /* ✅ Altura aumentada para foto más grande */
    width: 100%;
  }

  .equipo .fotoagente {
    height: 430px; /* ✅ Foto más grande */
    width: 100%;
  }

  .cara-trasera {
    padding: 25px 20px;
  }

  .nombre-back {
    margin-bottom: 20px;
  }

  .info-item {
    margin-bottom: 12px;
  }
}

@media (max-width: 400px) {
  .container-fluid.equipo {
    padding: 0 10px;
  }

  .tarjeta-flip {
    height: 460px;
  }

  .equipo .fotoagente {
    height: 370px;
  }

  .btn-ficha {
    padding: 10px 20px;
  }
}

/* Soporte para pantallas táctiles */
@media (hover: none) and (pointer: coarse) {
  .gestor.active .tarjeta-flip {
    transform: rotateY(180deg);
  }
}
