/* =========================================================
   INICIO (home) — estilos propios de la página
   Se carga DESPUÉS de main.css para poder sobrescribirlo.
   Vista: app/Views/home/  ·  JS: assets/js/pages/home.js
   ========================================================= */

/* =========================================================
  BANNER DE EVENTO MEJORADO
========================================================= */
.event-banner {
  background: linear-gradient(90deg, #1a8fd1, #1565c0);
  padding: 35px 0;
  margin: 40px auto;
}

.event-banner .container {
  max-width: 1200px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 25px 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.event-banner p {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  font-family: 'Poppins', sans-serif;
}

.event-banner p strong {
  font-weight: 800;
}

.btn-event {
  display: inline-block;
  border: 2px solid #fff;
  color: #fff;
  padding: 12px 32px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.25s;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
}

.btn-event:hover {
  background: #fff;
  color: #1565c0;
  transform: scale(1.05);
}

/* =========================================================
   NUEVA SECCIÓN DE SERVICIOS - ESTILO EDITORIAL HORIZONTAL
   CON HOVER MÁS OSCURO Y CARRUSELES INDEPENDIENTES
========================================================= */

/* Variables de paleta azul del sitio */
:root {
  --sb-bg1: #eaf4fb;   
  --sb-bg2: #ddeef8;   
  --sb-accent: #1a8fd1;   
  --sb-strong: #0d4d7a;
  --sb-muted: #4a7499;   
  --sb-divider: rgba(26,143,209,0.15);
  --sb-hover-bg: #0f5a8a;
  --sb-hover-text: #ffffff;
}

.services-editorial {
  width: 100%;
  background: var(--sb-bg1);
}

.service-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 460px; /* Altura fija para mantener consistencia */
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

/* Bloques impares: texto izquierda, imagen derecha */
.service-block:nth-child(odd) { direction: ltr; }

/* Bloques pares: imagen izquierda, texto derecha */
.service-block:nth-child(even) { direction: rtl; }
.service-block:nth-child(even) .service-text-panel,
.service-block:nth-child(even) .service-img-panel { direction: ltr; }

/* Fondo de bloques alternado */
.service-block:nth-child(odd)  .service-text-panel { background: var(--sb-bg1); }
.service-block:nth-child(even) .service-text-panel { background: var(--sb-bg2); }

/* Hover en el bloque completo */
.service-block:hover .service-text-panel {
  background: var(--sb-hover-bg);
  transition: background 0.3s ease;
}

.service-block:hover .service-number,
.service-block:hover .service-title,
.service-block:hover .service-desc {
  color: var(--sb-hover-text);
}

.service-block:hover .service-link {
  color: var(--sb-hover-text);
}

.service-block:hover .service-link::after {
  background: var(--sb-hover-text);
}

.service-block:hover .service-title {
  color: var(--sb-hover-text);
}

/* Panel de texto */
.service-text-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  transition: background 0.3s ease;
}

/* Línea decorativa izquierda */
.service-text-panel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--sb-accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.6s ease 0.2s;
}

.service-block:hover .service-text-panel::before {
  background: var(--sb-hover-text);
}

.service-block.visible .service-text-panel::before {
  transform: scaleY(1);
}

.service-number {
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--sb-accent);
  text-transform: uppercase;
  margin-bottom: 18px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s, color 0.3s;
}

.service-block.visible .service-number { opacity: 1; transform: translateY(0); }

.service-title {
  font-family: 'Raleway', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--sb-strong);
  line-height: 1.15;
  margin-bottom: 22px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.55s ease 0.2s, transform 0.55s ease 0.2s, color 0.3s;
}

.service-block.visible .service-title { opacity: 1; transform: translateY(0); }

.service-desc {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--sb-muted);
  line-height: 1.75;
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.55s ease 0.32s, transform 0.55s ease 0.32s, color 0.3s;
}

.service-block.visible .service-desc { opacity: 1; transform: translateY(0); }

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sb-accent);
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.42s, transform 0.5s ease 0.42s, color 0.3s;
}

.service-link::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: var(--sb-accent);
  transition: width 0.3s ease, background 0.3s;
}

.service-link:hover { 
  color: var(--sb-strong); 
}
.service-link:hover::after { 
  width: 40px; 
  background: var(--sb-strong);
}

.service-block.visible .service-link { opacity: 1; transform: translateY(0); }

/* Panel de imagen y carruseles - MANTIENE PARÁMETROS FIJOS */
.service-img-panel {
  position: relative;
  overflow: hidden;
  min-height: 460px; /* Altura fija */
  background: #1a1a1a; /* Fondo oscuro por si hay espacios */
}

/* Estilos para carruseles independientes */
.service-carousel {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.service-carousel .swiper-wrapper {
  height: 100%;
}

.service-carousel .swiper-slide {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Las imágenes mantienen sus proporciones sin distortion */
.service-carousel .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Mantiene proporción recortando si es necesario */
  object-position: center center; /* Centra la imagen */
  display: block;
  transform: scale(1.02);
  filter: brightness(0.92);
  transition: transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.9s ease;
}

/* Para imágenes que necesitan ser mostradas completas sin recorte */
.service-carousel .swiper-slide img.contain-fit {
  object-fit: contain;
  background: #1a1a1a;
}

/* También puedes usar una clase específica si prefieres contain en lugar de cover */
.service-carousel.contain-mode .swiper-slide img {
  object-fit: contain;
  background: #1a1a1a;
}

.service-block.visible .service-carousel .swiper-slide img {
  transform: scale(1);
  filter: brightness(1);
}

.service-block:hover .service-carousel .swiper-slide img {
  filter: brightness(0.7);
  transform: scale(1.05);
}

/* Navegación del carrusel */
.service-carousel .carousel-nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 15px;
  pointer-events: none;
  z-index: 10;
}

.service-carousel .swiper-button-prev,
.service-carousel .swiper-button-next {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  background: rgba(26, 143, 209, 0.85);
  border-radius: 50%;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.service-carousel .swiper-button-prev:after,
.service-carousel .swiper-button-next:after {
  font-size: 18px;
  color: white;
  font-weight: bold;
}

.service-carousel .swiper-button-prev:hover,
.service-carousel .swiper-button-next:hover {
  background: var(--sb-strong);
  transform: scale(1.1);
}

/* Paginación */
.service-carousel .swiper-pagination {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 10;
}

.service-carousel .swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.8);
  opacity: 1;
  width: 10px;
  height: 10px;
  transition: all 0.3s;
}

.service-carousel .swiper-pagination-bullet-active {
  background: var(--sb-accent);
  transform: scale(1.2);
}

/* Efecto overlay en hover */
.service-img-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(26,143,209,0.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 2;
}

.service-block:hover .service-img-panel::after {
  background: linear-gradient(135deg, rgba(13,77,122,0.4) 0%, rgba(0,0,0,0.2) 60%);
}

.service-img-tag {
  position: absolute;
  bottom: 28px;
  right: 28px;
  background: var(--sb-accent);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 18px;
  border-left: 3px solid var(--sb-strong);
  z-index: 3;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease 0.5s, transform 0.5s ease 0.5s, background 0.3s;
  backdrop-filter: blur(4px);
}

.service-block:hover .service-img-tag {
  background: var(--sb-hover-bg);
  border-left-color: var(--sb-hover-text);
}

.service-block.visible .service-img-tag { opacity: 1; transform: translateY(0); }

.service-block + .service-block {
  border-top: 1px solid var(--sb-divider);
}

/* =========================================================
   SECCIÓN SERVICIOS HTML (3 CUADROS) - HOVER MÁS OSCURO
========================================================= */
.services-html-section {
  padding: 60px 0;
  background: #f9f9f9;
}
.services-html-section .section-heading {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 40px;
  font-family: 'Raleway', sans-serif;
  position: relative;
}
.services-html-section .section-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: #1a8fd1;
  margin: 12px auto 0;
  border-radius: 2px;
}
.service-html-item {
  background: #fff;
  border-radius: 12px;
  padding: 30px 25px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  height: 100%;
  text-align: center;
}
.service-html-item:hover {
  background: #0d4d7a;
  transform: translateY(-5px);
}
.service-html-item:hover .service-icon i,
.service-html-item:hover h3,
.service-html-item:hover p {
  color: #fff;
}
.service-html-item .service-icon {
  margin-bottom: 20px;
}
.service-html-item .service-icon i {
  font-size: 48px;
  color: #1a8fd1;
  transition: color 0.3s;
}
.service-html-item h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: #222;
  transition: color 0.3s;
}
.service-html-item p {
  color: #666;
  line-height: 1.6;
  margin: 0;
  transition: color 0.3s;
}

/* =========================================================
   SECCIÓN CLIENTES
========================================================= */
.clients-section {
  padding: 60px 0 50px;
  background: #fff;
}
.clients-section .section-heading {
  text-align: center;
  font-size: 1.45rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 40px;
  font-family: 'Raleway', sans-serif;
}
.clients-section .section-heading::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: #1a8fd1;
  margin: 10px auto 0;
  border-radius: 2px;
}
.clients-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 32px 40px;
}
.clients-logos .client-logo {
  max-width: 130px;
  opacity: 0.75;
  transition: opacity 0.3s;
}
.clients-logos .client-logo:hover {
  opacity: 1;
}
.clients-logos .client-logo img {
  max-height: 60px;
  width: auto;
  object-fit: contain;
}

/* =========================================================
   SECCIÓN CURSOS
========================================================= */
.courses-section {
  padding: 60px 0;
  background: #f4f7fa;
}
.courses-section .section-heading {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #222;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  font-family: 'Raleway', sans-serif;
  text-transform: uppercase;
}
.courses-section .section-heading::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: #1a8fd1;
  margin: 10px auto 30px;
  border-radius: 2px;
}
.course-card {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s, box-shadow 0.25s;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}
.course-card .card-top-btn {
  background: #3bbfb8;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.3s;
}
.course-card .card-top-btn span {
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.5px;
}
.course-card .card-top-btn:hover { 
  background: #2a8a84; 
}
.course-card .card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid #eee;
}
.course-card .card-body-inner {
  padding: 18px;
  flex: 1;
}
.course-card .badge-tipo {
  display: inline-block;
  background: #3bbfb8;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  font-family: 'Poppins', sans-serif;
}
.course-card .card-body-inner h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
  font-family: 'Raleway', sans-serif;
}
.course-card .card-body-inner p {
  font-size: 0.87rem;
  color: #666;
  line-height: 1.55;
  margin: 0;
}

/* =========================================================
   BANNER CTA (LLÁMANOS)
========================================================= */
.cta-banner {
  background: linear-gradient(90deg, #1565c0 0%, #1a8fd1 100%);
  padding: 50px 0;
}
.cta-banner .cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.cta-banner .cta-text h3 {
  color: #fff;
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 4px;
  font-family: 'Raleway', sans-serif;
}
.cta-banner .cta-text p {
  color: rgba(255,255,255,0.85);
  margin: 0;
  font-size: 1rem;
  font-family: 'Open Sans', sans-serif;
}
.btn-cta {
  display: inline-block;
  border: 2px solid #fff;
  color: #fff;
  padding: 12px 32px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.25s;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
}
.btn-cta:hover {
  background: #fff;
  color: #1565c0;
  transform: scale(1.05);
}

/* =========================================================
   SECCIÓN PRODUCTOS
========================================================= */
.products-section {
  padding: 60px 0 70px;
  background: #fff;
}
.products-section .section-heading {
  text-align: center;
  font-size: 1.45rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
  font-family: 'Raleway', sans-serif;
}
.products-section .section-heading::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: #1a8fd1;
  margin: 10px auto 36px;
  border-radius: 2px;
}
.product-card {
  border: 1px solid #e8edf2;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.25s;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.10);
  transform: translateY(-3px);
}
.product-card .product-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: filter 0.3s;
}
.product-card:hover .product-img {
  filter: brightness(0.85);
}
.product-card .product-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-card .product-body h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
  font-family: 'Raleway', sans-serif;
}
.product-card .product-body p {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.55;
  flex: 1;
  margin-bottom: 14px;
}
.product-card .product-link {
  color: #1a8fd1;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}
.product-card .product-link:hover { 
  color: #0d4d7a; 
}
.product-card .product-link i { font-size: 0.9rem; }

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 900px) {
  .service-block {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .service-block:nth-child(even) {
    direction: ltr;
  }
  .service-img-panel {
    min-height: 380px;
    height: auto;
    order: -1;
  }
  .service-text-panel {
    padding: 40px 32px;
  }
  .service-title { font-size: 1.55rem; }
  
  .service-carousel .carousel-nav {
    padding: 0 10px;
  }
  
  .service-carousel .swiper-button-prev,
  .service-carousel .swiper-button-next {
    width: 32px;
    height: 32px;
  }
  
  .service-carousel .swiper-button-prev:after,
  .service-carousel .swiper-button-next:after {
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .event-banner p { font-size: 0.92rem; }
  .cta-banner .cta-text h3 { font-size: 1.3rem; }
  .cta-banner .cta-inner { justify-content: center; text-align: center; }
  .btn-event, .btn-cta { padding: 10px 24px; font-size: 0.85rem; }
  .service-text-panel { padding: 32px 24px; }
  .service-title { font-size: 1.3rem; }
  .service-html-item h3 { font-size: 1.3rem; }
  .service-img-panel {
    min-height: 300px;
  }
}
