/**
 * Estilos para Servicios Interactivos 360 (Acordeón + Preview Sincronizado)
 * Diseño Figma azul noche con interacción fluida estilo Framer
 */

.h-servicios-widget-container {
  width: 100%;
  position: relative;
  box-sizing: border-box;
}

.h-servicios-section {
  width: 100%;
  background-color: #04152F;
  padding: 90px 20px;
  position: relative;
  box-sizing: border-box;
}

.h-servicios-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center !important;
  justify-content: space-between;
  gap: 60px;
  box-sizing: border-box;
}

/* ==========================================================================
   1. COLUMNA IZQUIERDA: IMAGEN PREVIEW SINCRONIZADA
   ========================================================================== */
.h-servicios-col-image {
  flex: 0 0 46%;
  width: 46%;
  max-width: 46%;
  position: relative;
  align-self: center !important;
  display: flex !important;
  flex-direction: column;
  justify-content: center !important;
  align-items: center !important;
  margin-top: auto;
  margin-bottom: auto;
  box-sizing: border-box;
}

.h-servicios-images-wrapper {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 460px;
  min-height: unset;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  background-color: #030F22;
  margin: 0 auto;
  box-sizing: border-box;
}

.h-servicios-image-card {
  display: block !important;
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
}

.h-servicios-image-card.is-active {
  display: block !important;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: 2;
}

.h-servicios-image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}


.h-servicios-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 21, 47, 0.05) 0%, rgba(4, 21, 47, 0.25) 100%);
  pointer-events: none;
}

/* ==========================================================================
   2. COLUMNA DERECHA: ACORDEÓN INTERACTIVO
   ========================================================================== */
.h-servicios-col-accordion {
  flex: 1 1 54%;
  width: 54%;
  display: flex !important;
  flex-direction: column;
  justify-content: center !important;
  align-self: center !important;
  margin-top: auto;
  margin-bottom: auto;
  box-sizing: border-box;
}

.h-servicios-accordion-list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  margin: auto 0;
  box-sizing: border-box;
}

.h-servicios-item {
  cursor: pointer;
  user-select: none;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-sizing: border-box;
  position: relative;
  outline: none;
}

/* Item Inactivo */
.h-servicios-item:not(.is-active) {
  padding: 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  border-radius: 8px;
}

.h-servicios-item:not(.is-active):hover {
  background-color: rgba(255, 255, 255, 0.025);
}

.h-servicios-item:not(.is-active):hover .h-servicios-title {
  color: #E2E8F0;
}

/* Item Activo */
.h-servicios-item.is-active {
  padding: 24px 22px;
  background-color: #041C3F;
  border: 1px solid #0E3263;
  border-radius: 14px;
  margin: 10px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Fila Superior del Item */
.h-servicios-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.h-servicios-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

/* Caja del Icono */
.h-servicios-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
  background-color: rgba(0, 83, 183, 0.18);
  color: #0066FF;
}

.h-servicios-item.is-active .h-servicios-icon-box {
  background-color: #0B5AB9;
  color: #FFFFFF;
}

.h-servicios-icon-box i {
  font-size: 15px;
}

.h-servicios-icon-box svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* Número de Servicio */
.h-servicios-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2B7FFF;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  flex-shrink: 0;
  line-height: 1;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.h-servicios-item.is-active .h-servicios-num {
  color: #388BFD;
}

/* Título */
.h-servicios-title {
  margin: 0;
  font-size: clamp(1.05rem, 1.25vw, 1.25rem);
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}

/* Chevron / Flecha derecha que rota a abajo */
.h-servicios-chevron {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8B9EB7;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.3s ease;
}

.h-servicios-chevron svg {
  display: block;
}

.h-servicios-item.is-active .h-servicios-chevron {
  transform: rotate(90deg);
  color: #388BFD;
}

/* ==========================================================================
   3. CONTENIDO EXPANDIBLE DEL ACORDEÓN (ANIMACIÓN SUAVE CSS GRID)
   ========================================================================== */
.h-servicios-item-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.h-servicios-item.is-active .h-servicios-item-body {
  grid-template-rows: 1fr;
}

.h-servicios-item-body-inner {
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.h-servicios-item.is-active .h-servicios-item-body-inner {
  opacity: 1;
  transition: opacity 0.35s ease 0.08s;
}

.h-servicios-desc {
  margin: 14px 0 0 54px;
  font-size: clamp(0.92rem, 1.05vw, 1rem);
  line-height: 1.62;
  color: #8B9EB7;
  font-weight: 400;
}

/* Oculto por defecto en desktop */
.h-servicios-item-mobile-image {
  display: none;
}

/* ==========================================================================
   4. RESPONSIVE (TABLETS & MÓVIL < 992px)
   ========================================================================== */
@media (max-width: 991px) {
  .h-servicios-section {
    padding: 60px 16px;
  }

  .h-servicios-container {
    flex-direction: column;
    gap: 0;
  }

  /* Ocultar la columna de imagen superior para que la imagen quede dentro de la pestaña activa */
  .h-servicios-col-image {
    display: none !important;
  }

  .h-servicios-col-accordion {
    flex: 1 1 100%;
    width: 100%;
  }

  .h-servicios-title {
    white-space: normal;
    text-overflow: unset;
    font-size: 1.05rem;
  }

  .h-servicios-desc {
    margin: 12px 0 0 0;
    font-size: 0.95rem;
  }

  /* Imagen móvil integrada directamente debajo del título y texto de la pestaña activa */
  .h-servicios-item-mobile-image {
    display: block;
    margin-top: 18px;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 280px;
    border-radius: 16px;
    overflow: hidden;
    background-color: #030F22;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }

  .h-servicios-item-mobile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
  }

  .h-servicios-item:not(.is-active) {
    padding: 18px 10px;
  }

  .h-servicios-item.is-active {
    padding: 20px 16px;
  }
}
