/* --- Fuentes y Librerías Externas --- */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap");

/* --- Configuración Global y Variables --- */
:root {
  --primary-color: #007bff;
  --primary-hover-color: #0056b3;
  --dark-color: #212529;
  --dark-grey-color: #343a40;
  --light-grey-color: #6c757d;
  --background-light: #f8f9fa;
  --background-white: #ffffff;
  --gradient-primary: linear-gradient(45deg, var(--primary-color), #0056b3);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 75px;
}

body {
  font-family: "Roboto", sans-serif;
  background-color: #000;
  color: var(--dark-grey-color);
  overflow-x: hidden;
}

/* --- Loader de Carga --- */
.loader-wrapper {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.loader {
  position: relative;
  width: 200px;
  height: 200px;
}

.loader span {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 0 5px var(--primary-color);
}

.spinner {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  box-shadow:
    3px 0 1px -1px rgba(255, 255, 255, 1),
    5px 0 5px rgba(30, 144, 255, 0.5),
    inset -10px 0 10px -5px rgba(30, 144, 255, 0.5);
  animation: loading 1.5s linear infinite;
}

@keyframes loading {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#page-content {
  transition: opacity 0.8s ease-in-out;
}

/* --- Barra de Navegación --- */
.navbar {
  transition:
    background-color 0.4s ease-in-out,
    padding 0.4s ease-in-out,
    box-shadow 0.4s ease-in-out;
  background-color: transparent !important;
  padding-top: 15px;
  padding-bottom: 15px;
}

.navbar-brand img {
  /* height: 90px !important; */
  height: 150px !important;
  transition:
    height 0.4s ease-in-out,
    transform 0.3s ease;
}

.navbar-brand:hover img {
  transform: scale(1.05);
}

.navbar.navbar-scrolled {
  background-color: rgba(10, 10, 10, 0.9) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
  padding-top: 10px;
  padding-bottom: 10px;
}

.navbar-scrolled .navbar-brand img {
  height: 80px !important;
}

.nav-link {
  color: #ffffff !important;
  font-weight: 700 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding-bottom: 5px;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 0;
  background: rgba(0, 123, 255, 0.1);
  transform: translateY(-50%);
  transition:
    height 0.3s ease,
    opacity 0.3s ease;
  opacity: 0;
  border-radius: 4px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color) !important;
  transform: translateY(-2px);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover::before {
  height: 100%;
  opacity: 1;
}

.navbar-toggler {
  border: none;
  transition: transform 0.3s ease;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- Sección Hero --- */
.hero {
  color: white;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  height: 100vh;
}

.hero-video-background {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: -2;
  transform: translateX(-50%) translateY(-50%);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: -1;
}

.hero h1 {
  font-size: 4.5rem;
  letter-spacing: -1px;
}
.hero p.lead {
  font-size: 1.75rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero .btn-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: bold;
  padding: 15px 35px;
  border-radius: 50px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 5px 20px rgba(0, 123, 255, 0.4);
  position: relative;
  overflow: hidden;
}

.hero .btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.hero .btn-primary:hover {
  background-color: var(--primary-hover-color);
  border-color: var(--primary-hover-color);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 35px rgba(0, 123, 255, 0.6);
}

.hero .btn-primary:hover::before {
  left: 100%;
}

/* --- Secciones Generales --- */
section {
  padding: 80px 0;
  overflow: hidden;
}
.bg-light {
  background-color: var(--background-light) !important;
}

section h2.service-title,
section h2.fw-bold {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.75rem;
  display: inline-block;
}

section h2.service-title::after,
section h2.fw-bold::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -5px;
  width: 0;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.6s ease;
  animation: expandLine 2s ease-out 0.5s forwards;
}

@keyframes expandLine {
  to {
    width: 80px;
  }
}

section p.lead {
  font-size: 1.25rem;
  max-width: 850px;
  margin: auto;
}

/* --- Estilo de Tarjetas Mejorado --- */
.card-elevated {
  background-color: var(--background-white);
  border: 1px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card-elevated::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.card-elevated:hover {
  transform: translateY(-8px) rotateX(2deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.card-elevated:hover::before {
  transform: scaleX(1);
}

.icon-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  transition: transform 0.3s ease;
}

.card-elevated:hover .icon-gradient {
  transform: scale(1.1) rotate(5deg);
  animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
  0%,
  100% {
    transform: scale(1.1) rotate(5deg);
  }
  50% {
    transform: scale(1.2) rotate(-2deg);
  }
}

/* --- Botones Mejorados --- */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width 0.4s ease,
    height 0.4s ease;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* --- Sección Proceso (Timeline) --- */
.timeline {
  list-style-type: none;
  position: relative;
  padding-left: 25px;
  margin: 0;
}

.timeline:before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 2px;
  background: #e9ecef;
}

.timeline li {
  position: relative;
  margin-bottom: 20px;
  padding-left: 20px;
  transition: transform 0.3s ease;
}

.timeline li:hover {
  transform: translateX(5px);
}

.timeline li:before {
  content: "";
  position: absolute;
  left: -8px;
  top: 5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--background-white);
  border: 3px solid var(--primary-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
}

.timeline li:hover:before {
  transform: scale(1.3);
  box-shadow: 0 0 0 10px rgba(0, 123, 255, 0.1);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

.timeline li strong {
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.2rem;
  transition: color 0.3s ease;
}

.timeline li:hover strong {
  color: var(--primary-color);
}

/* --- Portafolio de Servicios (Filtros) --- */
#portfolio-services .filter-controls .btn {
  transition: all 0.3s ease;
  font-weight: 600;
  position: relative;
}

#portfolio-services .filter-controls .btn::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

#portfolio-services .filter-controls .btn:hover::after,
#portfolio-services .filter-controls .btn.active::after {
  width: 100%;
}

#portfolio-services .filter-controls .btn.active {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
  transform: translateY(-2px);
}

#services-grid .service-item {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#services-grid .service-item.hide {
  transform: scale(0.9);
  opacity: 0;
  display: none;
}

/* --- Imágenes con Efectos --- */
.img-fluid {
  transition:
    transform 0.4s ease,
    filter 0.4s ease;
}

.service-item:hover .img-fluid {
  transform: scale(1.05);
  filter: brightness(1.1) contrast(1.1);
}

/* --- Sección CTA --- */
.bg-gradient-primary {
  background: var(--gradient-primary);
}

#cta .btn-light {
  font-weight: bold;
  color: var(--primary-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

#cta .btn-light::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 123, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

#cta .btn-light:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

#cta .btn-light:hover::before {
  left: 100%;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--dark-color);
  color: rgba(255, 255, 255, 0.7);
  padding: 60px 0 0 0;
}
.footer-logo {
  height: 50px;
  transition: transform 0.3s ease;
}
.footer-logo:hover {
  transform: scale(1.05);
}
.footer-heading {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
}
.footer-links a,
.footer-contact a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.footer-links a::before,
.footer-contact a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: rgba(0, 123, 255, 0.1);
  transition: width 0.3s ease;
  z-index: -1;
}

.footer-links a:hover,
.footer-contact a:hover {
  color: #ffffff;
  padding-left: 8px;
  transform: translateX(3px);
}

.footer-links a:hover::before,
.footer-contact a:hover::before {
  width: 100%;
}

.footer-contact i {
  margin-right: 10px;
  color: var(--primary-color);
  transition: transform 0.3s ease;
}

.footer-contact a:hover i {
  transform: scale(1.2) rotate(5deg);
}

.footer-bottom {
  background-color: #000000;
  padding: 20px 0;
  margin-top: 40px;
}

/* --- Animaciones de Scroll --- */
[data-anim] {
  opacity: 0;
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

[data-anim="fade-in"] {
  transform: translateY(30px);
}

[data-anim="fade-in-up"] {
  transform: translateY(50px);
}
[data-anim="fade-in-left"] {
  transform: translateX(-50px);
}
[data-anim="fade-in-right"] {
  transform: translateX(50px);
}
[data-anim="zoom-in"] {
  transform: scale(0.9);
}

[data-anim].visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Aplicar retrasos a elementos hijos */
.visible [data-anim-child] {
  opacity: 0;
  animation-name: fadeInUp;
  animation-duration: 0.8s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
}

.visible [data-anim-child]:nth-child(1) {
  animation-delay: 0.1s;
}
.visible [data-anim-child]:nth-child(2) {
  animation-delay: 0.2s;
}
.visible [data-anim-child]:nth-child(3) {
  animation-delay: 0.3s;
}
.visible [data-anim-child]:nth-child(4) {
  animation-delay: 0.4s;
}
.visible [data-anim-child]:nth-child(5) {
  animation-delay: 0.5s;
}
.visible [data-anim-child]:nth-child(6) {
  animation-delay: 0.6s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Sección Contacto - TU VERSIÓN ORIGINAL --- */
#contact .form-control {
  border-radius: 8px;
  padding: 12px 15px;
  font-size: 1rem;
  border: 1px solid #ced4da;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

#contact .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

#contact .btn-primary {
  border-radius: 8px;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
}

#contact .btn-primary:hover {
  background-color: var(--primary-hover-color);
  transform: translateY(-2px);
}

.contact-info-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.75rem;
}

.contact-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  color: var(--primary-color);
  background-color: rgba(0, 123, 255, 0.1);
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease;
}

.contact-info-item:hover .contact-icon {
  background-color: var(--primary-color);
  color: #fff;
  transform: scale(1.1);
}

/* Colores específicos para WhatsApp, Facebook e IG */
.contact-icon.whatsapp {
  color: #25d366;
  background-color: rgba(37, 211, 102, 0.1);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}
.contact-info-item:hover .contact-icon.whatsapp {
  background-color: #25d366;
  color: #ffffff;
}

.contact-icon.facebook {
  color: #1877f2;
  background-color: rgba(24, 119, 242, 0.1);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}
.contact-info-item:hover .contact-icon.facebook {
  background-color: #1877f2;
  color: #ffffff;
}

.contact-icon.instagram {
  color: #e4405f;
  background-color: #fceef2;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}
.contact-info-item:hover .contact-icon.instagram {
  background-color: #e4405f;
  color: #ffffff;
}

.contact-info-item div a {
  color: var(--light-grey-color);
  text-decoration: none;
  transition: color 0.3s ease;
  display: block;
}

.contact-info-item div a:hover {
  color: var(--primary-color);
}

.contact-info-item div strong {
  color: var(--dark-grey-color);
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

/* --- Estilo de Listas de Servicios --- */
.service-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.service-list li {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  line-height: 1.5;
  transition: all 0.3s ease;
  position: relative;
}

.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(0, 123, 255, 0.05);
  transition: width 0.3s ease;
  z-index: -1;
}

.service-list li:hover {
  transform: translateX(8px);
  color: var(--primary-color);
}

.service-list li:hover::before {
  width: 100%;
}

.service-list li:last-child {
  margin-bottom: 0;
}

.service-list .bi {
  color: var(--primary-color);
  margin-right: 10px;
  margin-top: 5px;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-list li:hover .bi {
  transform: scale(1.2) rotate(10deg);
  filter: drop-shadow(0 2px 4px rgba(0, 123, 255, 0.3));
}

/* --- Animación para títulos de servicio --- */
.service-title {
  position: relative;
  transition: color 0.3s ease;
}

.service-title::before {
  content: "";
  position: absolute;
  top: 0;
  left: -10px;
  width: 4px;
  height: 0;
  background: var(--gradient-primary);
  transition: height 0.4s ease;
  border-radius: 2px;
}

.service-item:hover .service-title {
  color: var(--primary-color);
}

.service-item:hover .service-title::before {
  height: 100%;
}

/* --- Responsive Design --- */
@media (max-width: 991px) {
  .navbar-brand img {
    height: 65px !important;
    transition:
      height 0.4s ease-in-out,
      transform 0.3s ease;
  }

  .navbar-scrolled .navbar-brand img {
    height: 60px !important;
  }

  .navbar-collapse {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    margin-top: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar-nav .nav-link {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar-nav .nav-link:hover {
    background: rgba(0, 123, 255, 0.1);
    padding-left: 10px;
    border-radius: 5px;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 3rem;
  }

  .hero p.lead {
    font-size: 1.25rem;
  }

  section h2.service-title,
  section h2.fw-bold {
    font-size: 2.2rem;
  }
}

@media (max-width: 576px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p.lead {
    font-size: 1.15rem;
  }

  .hero .btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
  }

  .card-elevated:hover {
    transform: translateY(-4px) rotateX(1deg);
  }
}

.text-justify {
  text-align: justify;
}

/* --- Solución de Espaciado para Servicios en Móvil --- */
@media (max-width: 991.98px) {
  .service-item .img-fluid.rounded.shadow-lg {
    margin-bottom: 2rem;
  }
}

/* =========================
   WhatsApp Flotante
========================= */
.whatsapp-flotante {
  position: fixed;
  bottom: 100px;
  right: 50px;
  width: 85px;
  height: 85px;
  background-color: #25d366;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
  animation: pulse-whatsapp 2.5s infinite ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.whatsapp-flotante i {
  font-size: 3rem;
  transition: transform 0.3s ease-in-out;
  line-height: 1;
}

.whatsapp-flotante:hover {
  transform: scale(1.1);
  animation: none;
  color: #fff;
}

.whatsapp-flotante:hover i {
  transform: rotate(15deg);
}

@keyframes pulse-whatsapp {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

@media (max-width: 768px) {
  .whatsapp-flotante {
    width: 65px;
    height: 65px;
    bottom: 20px;
    right: 20px;
  }
  .whatsapp-flotante i {
    font-size: 2rem;
  }
}

#contactModal .modal-dialog {
  max-width: 700px;
}
