/* ==================== CSS VARIABLES ==================== */
:root {
  /* Colores corporativos Destia */
  --primary: #0052cc;
  --primary-dark: #003d99;
  --primary-light: #4c9aff;
  --secondary: #00c7b7;
  --secondary-light: #00e6d3;
  --accent: #ff6b35;

  /* Oscuros */
  --dark: #0a1628;
  --dark-light: #1a2744;

  /* Escala de grises */
  --gray-900: #172b4d;
  --gray-700: #344563;
  --gray-500: #5e6c84;
  --gray-300: #a5adba;
  --gray-100: #f4f5f7;
  --white: #ffffff;

  /* Gradients */
  --gradient-primary: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  --gradient-hero: linear-gradient(
    135deg,
    #0a1628 0%,
    #1a2744 50%,
    #0052cc 100%
  );
  --gradient-card: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 40px rgba(0, 82, 204, 0.3);

  /* Spacing */
  --section-padding: clamp(4rem, 10vw, 8rem);
}

/* ==================== RESET & BASE ==================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-700);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1rem 2rem;
  z-index: 1000;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
  padding: 0.75rem 2rem;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--secondary);
}

.navbar.scrolled .logo {
  color: var(--dark);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.navbar.scrolled .nav-links a {
  color: var(--gray-700);
}

.nav-links a:hover {
  color: var(--secondary);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
}

.navbar.scrolled .menu-toggle {
  color: var(--dark);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--secondary);
  color: var(--dark);
}

.btn-primary:hover {
  background: var(--secondary-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 199, 183, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.navbar.scrolled .btn-outline {
  color: var(--primary);
  border-color: var(--primary);
}

/* ==================== LOADER / LOADING SCREEN ==================== */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a2332 0%, #2a3548 50%, #1a65d1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

.loader-logo {
  margin-bottom: 2rem;
  animation: loaderPulse 2s ease-in-out infinite;
}

.loader-logo img {
  max-width: 150px;
  height: auto;
  display: block;
  margin: 0 auto;
}

@keyframes loaderPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.loader-bar {
  width: min(200px, 80vw);
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  mask-image: -webkit-radial-gradient(white, black);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.loader-progress {
  height: 100%;
  background: linear-gradient(90deg, #00b8aa, #00d4c4);
  border-radius: 10px;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  animation: loading 1.8s ease-in-out forwards;
  will-change: transform;
}

@keyframes loading {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

/* ==================== COMMON ANIMATIONS ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== SECTION COMMON STYLES ==================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
}

.section-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(0, 82, 204, 0.1);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 50px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ==================== FOOTER ==================== */
.footer {
  background: var(--dark);
  color: var(--white);
  padding: 4rem 2rem 2rem;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer-column h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--white);
}

.footer-column ul {
  list-style: none;
}

.footer-column li {
  margin-bottom: 0.75rem;
}

.footer-column a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-column a:hover {
  color: var(--secondary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--secondary);
}

/* ==================== WHATSAPP FLOATING BUTTON ==================== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: all 0.3s ease;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
}

.whatsapp-float svg {
  transition: transform 0.3s ease;
}

.whatsapp-float:hover svg {
  transform: rotate(-10deg);
}

.page-contacto .whatsapp-float {
  bottom: 110px;
}

/* ==================== BACK TO TOP BUTTON ==================== */
.back-to-top {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--primary, #1a65d1);
  color: white;
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 998;
  box-shadow: 0 4px 15px rgba(26, 101, 209, 0.3);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark, #0d4fa8);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(26, 101, 209, 0.4);
}

.back-to-top svg {
  transition: transform 0.3s ease;
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

.page-contacto .back-to-top {
  bottom: 185px;
}

/* ==================== RESPONSIVE - MOBILE ==================== */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  .navbar.scrolled {
    padding: 0.5rem 1rem;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    color: var(--gray-700);
    font-size: 1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .whatsapp-float {
    bottom: 20px;
    right: 16px;
    width: 50px;
    height: 50px;
  }

  .whatsapp-float svg {
    width: 24px;
    height: 24px;
  }

  .page-contacto .whatsapp-float {
    bottom: 95px;
  }

  .back-to-top {
    bottom: 85px;
    right: 16px;
    width: 44px;
    height: 44px;
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
  }

  .page-contacto .back-to-top {
    bottom: 175px;
  }
}

/* ==================== LOGO SCROLL ==================== */
.logo-scroll {
  display: none;
}

#navbar.scrolled .logo-normal {
  display: none;
}

#navbar.scrolled .logo-scroll {
  display: block;
}
