/* --- VARIABLES --- */
:root {
  --blanco: #ffffff;
  --naranja: #fb8300;
  --azul-oscuro: #022f46;
  --gris: #97a3aa;
  --gris-claro: #f4f6f7;
}

/* --- PRELOADER (PANTALLA DE CARGA) --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* Fondo blanco limpio */
    z-index: 9999; /* Por encima de TODO, incluso de los modales */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* El círculo giratorio */
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(2, 47, 70, 0.2); /* Azul clarito de fondo */
    border-top: 5px solid var(--naranja);   /* Naranja girando */
    border-left: 5px solid var(--azul-oscuro); /* Azul girando */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animación de giro */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Clase para ocultarlo suavemente */
#preloader.hide-loader {
    opacity: 0;
    visibility: hidden;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Open Sans", sans-serif;
  color: var(--azul-oscuro);
  background-color: var(--blanco);
  line-height: 1.6;
}

section {
  scroll-margin-top: 100px;
}

h1,
h2,
h3,
h4 {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
}

a {
  text-decoration: none;
  transition: 0.3s;
}

ul {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

/* --- BOTONES --- */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 5px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--naranja);
  color: var(--blanco);
  border: 2px solid var(--naranja);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--naranja);
}

.btn-whatsapp {
  background-color: #25d366;
  border: 2px solid #25d366;
  color: white;
}

.btn-whatsapp:hover {
  background-color: transparent;
  color: #25d366;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--blanco);
  color: var(--blanco);
}

.btn-outline:hover {
  background-color: var(--blanco);
  color: var(--azul-oscuro);
}

/* --- NAVBAR --- */
header {
  background-color: var(--azul-oscuro);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid rgb(251 131 0);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo img {
  height: 50px;
  width: auto;
  image-rendering: -webkit-optimize-contrast;
}

/* Enlaces del menú (Desktop) */
.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  color: var(--blanco);
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.9;
}

.nav-links a:hover {
  color: var(--naranja);
  opacity: 1;
}

/* Botón Hamburguesa (Oculto en PC) */
.menu-toggle {
  display: none;
  color: var(--blanco);
  font-size: 1.8rem;
  cursor: pointer;
}

/* --- HERO SECTION Y FORMAS --- */
.hero {
  background-color: var(--azul-oscuro);
  color: var(--blanco);
  padding: 100px 0 120px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  z-index: 1;
  animation: flotar 6s ease-in-out infinite;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: rgba(151, 163, 170, 0.1);
  top: -150px;
  left: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: rgba(251, 131, 0, 0.05);
  bottom: -50px;
  right: -50px;
  animation-delay: 1s;
}

.shape-3 {
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.05);
  top: 40px;
  right: 15%;
  animation-delay: 2s;
}

.shape-4 {
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.05);
  top: 10%;
  right: 40%;
  animation-delay: 2s;
}

@keyframes flotar {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }

  100% {
    transform: translateY(0px);
  }
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  line-height: 1.2;
  position: relative;
  z-index: 2;
}

.hero h1 span {
  color: var(--naranja);
}

.hero p {
  font-size: 1.2rem;
  color: var(--gris);
  max-width: 700px;
  margin: 0 auto 40px auto;
  position: relative;
  z-index: 2;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  position: relative;
  z-index: 2;
}

/* --- SERVICIOS --- */
.services {
  padding: 80px 0;
  background-color: var(--gris-claro);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--azul-oscuro);
}

.section-header p {
  color: var(--gris);
  font-weight: 600;
}

.section-header .line {
  width: 60px;
  height: 4px;
  background-color: var(--naranja);
  margin: 10px auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.service-card {
  background: var(--blanco);
  padding: 40px 30px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, border-bottom 0.3s ease;
  border-bottom: 4px solid transparent;
  text-align: center;
}

.service-card:hover {
  transform: translateY(-10px);
  border-bottom: 4px solid var(--naranja);
}

.service-card .read-more {
  margin-top: 25px;
  width: 100%;
  justify-content: center;
}

.service-card .logo-service {
  font-size: 3rem;
  color: var(--azul-oscuro);
  margin-bottom: 20px;
}

.service-card h3 {
  margin-bottom: 15px;
  color: var(--azul-oscuro);
}

.service-card p {
  color: #555;
  font-size: 0.95rem;
}

/* --- NUEVA SECCIÓN: NOSOTROS --- */
.about-section {
  padding: 80px 0;
  background-color: var(--gris-claro);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text h3 {
  color: var(--naranja);
  font-size: 1.1rem;
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.about-text h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  line-height: 1.3;
}

.about-text p {
  color: #555;
  margin-bottom: 20px;
}

/* Tarjetas de valores visuales */
.about-values {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.value-item {
  display: flex;
  align-items: center;
  background: var(--blanco);
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--naranja);
}

.value-item i {
  font-size: 2rem;
  color: var(--azul-oscuro);
  margin-right: 20px;
}

.value-item h4 {
  margin-bottom: 5px;
  color: var(--azul-oscuro);
}

.value-item p {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

/* --- CTA --- */
.cta-section {
  padding: 80px 0;
  background-color: var(--blanco);
  text-align: center;
}

.cta-content {
  background: linear-gradient(135deg, var(--azul-oscuro) 0%, #034061 100%);
  border-radius: 15px;
  padding: 60px;
  color: var(--blanco);
}

.cta-content h2 {
  margin-bottom: 20px;
}

/* --- FOOTER --- */
footer {
  background-color: var(--azul-oscuro);
  color: var(--blanco);
  padding: 60px 0 20px 0;
  border-top: 5px solid var(--naranja);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: var(--naranja);
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.footer-col p,
.footer-col a {
  color: var(--gris);
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--blanco);
}

.footer-logo-img {
  height: 40px;
  margin-bottom: 20px;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(151, 163, 170, 0.2);
  color: var(--gris);
  font-size: 0.8rem;
}

/* --- ANIMACIONES DE ENTRADA (SCROLL REVEAL) --- */

.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease-out;
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.service-card.reveal {
  transition-delay: 0.1s;
}

/* --- RESPONSIVE / MENU MOVIL --- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .cta-content {
    padding: 30px;
  }

  .shape-1 {
    width: 300px;
    height: 300px;
    left: -100px;
  }

  .shape-2 {
    width: 150px;
    height: 150px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--azul-oscuro);
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 20px;
    display: none;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  }

  .nav-links.active {
    display: flex;
  }
}

/* --- TECH STACK (SPLIDE OPTIMIZADO) --- */
.tech-stack {
    background-color: var(--blanco);
    border-bottom: 1px solid #f0f0f0;
    /* Quitamos el padding del contenedor general porque se lo daremos al track */
    padding: 10px 0; 
}

/* El contenedor principal de Splide */
.splide {
    width: 100%;
}

/* AQUÍ ESTÁ LA SOLUCIÓN AL CORTE: */
/* Damos "aire" interno a la pista para que los elementos puedan crecer */
.splide__track {
    padding-top: 20px;    /* Espacio para que el logo crezca hacia arriba */
    padding-bottom: 50px; /* Espacio EXTRA abajo para el logo crecido + Tooltip */
}

.splide__slide {
    display: flex;
    align-items: center;
    justify-content: center;
    
    opacity: 0.6;
    filter: grayscale(100%);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Transición suave */
    cursor: grab;
    
    position: relative; 
    /* Importante: evitar que el usuario seleccione la imagen al arrastrar */
    user-select: none;
}

.splide__slide:active {
    cursor: grabbing;
}

.splide__slide img {
    max-height: 60px;
    width: auto;
    max-width: 160px;
    
    /* Aseguramos que la imagen no tenga márgenes propios */
    display: block; 
}

/* Efecto Hover: Zoom */
.splide__slide:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.15); /* Hacemos el zoom un poco más notorio */
    z-index: 10; /* Asegura que el logo crecido quede por encima de los vecinos */
}

/* --- TOOLTIP MEJORADO --- */
.splide__slide::after {
    content: attr(data-name);
    position: absolute;
    
    /* SOLUCIÓN AL TRASLAPE CON EL LOGO: */
    /* Lo bajamos mucho más (-35px) para separarlo de la imagen */
    bottom: -35px; 
    
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--azul-oscuro);
    color: var(--blanco);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 4px;
    white-space: nowrap;
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    
    /* Para que el mouse no interactúe con el tooltip */
    pointer-events: none; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Triangulito del Tooltip (Opcional, detalle estético) */
.splide__slide::before {
    content: '';
    position: absolute;
    bottom: -10px; /* Posición justo encima del tooltip */
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent var(--azul-oscuro) transparent;
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Mostrar ambos al hacer hover */
.splide__slide:hover::after,
.splide__slide:hover::before {
    opacity: 1;
    visibility: visible;
}

/**** --- SECCIÓN DE PROYECTOS --- ****/

.projects-section {
  padding: 80px 0;
  background-color: var(--blanco);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.project-card {
  background: var(--blanco);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #eee;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.project-img-placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blanco);
}

.project-img-placeholder i {
  font-size: 4rem;
  opacity: 0.3;
}

.project-content {
  padding: 25px;
  text-align: left;
}

.project-tag {
  display: inline-block;
  background-color: rgba(2, 47, 70, 0.1);
  color: var(--azul-oscuro);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.project-content h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--azul-oscuro);
}

.project-content p {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.read-more {
  color: var(--naranja);
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.read-more:hover {
  gap: 12px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(2, 47, 70, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: var(--blanco);
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  max-width: 450px;
  width: 90%;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-icon {
  font-size: 3rem;
  color: var(--naranja);
  margin-bottom: 20px;
  text-align: center;
}

.modal-title {
  color: var(--azul-oscuro);
  font-size: 1.8rem;
  margin-bottom: 10px;
  text-align: center;
}

.modal-description {
  color: #666;
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  color: #aaa;
  cursor: pointer;
  transition: color 0.3s;
}

.close-modal:hover {
  color: var(--naranja);
}

.close-btn-action {
  width: 100%;
}

/* --- BOTÓN SCROLL TO TOP --- */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--naranja);
  color: var(--blanco);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  z-index: 999;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.scroll-top:hover {
  background-color: var(--azul-oscuro);
  transform: translateY(-5px);
  color: var(--blanco);
}

.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

.swal2-html-container {
  text-align: left;
}
.swal2-html-container p {
  color: #666;
  margin-bottom: 30px;
  font-size: 0.95rem;
}
