/* ===== VARIABLES CSS ===== */
:root {
  /* Colores principales */
  --primary-blue: #001B42;
  --primary-blue-hover: #002C6E;
  --secondary-blue: #4d78b8;
  --primary-blue-2: #214988;
  --blue-light: #C1E3FC;
  --text-gray: #302E2F;
  --white: #ffffff;
  --black: #111111;
  --gray-light: #cccccc;
  --gray-medium: #eeeeee;
  --gray-dark: #323232;
  --purple: #3E2247;
  --purple-dark: #2E1939;
  --purple-medium: #72498E;
  --purple-medium-hover: #5a3570;
  
  /* Tipografías */
  --font-family: 'Open Sans', sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 900;
  
  /* Espaciado */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-xxl: 4rem;
  
  /* Bordes */
  --border-radius-sm: 8px;
  --border-radius-md: 10px;
  --border-radius-lg: 25px;
  --border-radius-xl: 50px;
  
  /* Sombras */
  --shadow-sm: 5px 5px 5px var(--gray-dark);
  --shadow-md: 10px 10px 5px var(--gray-dark);
  --shadow-lg: 0px 4px 10px rgba(0, 0, 0, 0.3);
  
  /* Transiciones */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* ===== RESET Y BASE ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  background: var(--white);
  color: var(--black);
  overflow-x: hidden; /* Previene scroll horizontal */
}

body, h1, h2, h3, h4, h5, h6, p, a, li, button {
  font-family: var(--font-family);
}

/* ===== HEADER ===== */
header {
  background: var(--white);
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--gray-light);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.logo {
  flex: 0 0 auto;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  gap: var(--spacing-xl);
  margin: 0;
  padding: 0;
  flex: 1;
}

.nav-links li a {
  text-decoration: none;
  color: var(--black);
  font-weight: var(--font-weight-semibold);
  transition: var(--transition-fast);
  font-size: 1rem;
  text-transform: uppercase;
}

.nav-links li a:hover {
  color: var(--primary-blue);
}

/* ===== SEARCH BAR ===== */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input {
  padding: 8px 20px;
  border: 3px solid var(--primary-blue);
  border-radius: 50px;
  width: 250px;
  height: 40px;
  font-size: 16px;
  outline: none;
  transition: all var(--transition-normal);
  box-sizing: border-box;
  padding-left: 45px;
}

.search-input::placeholder {
  color: #888;
}

.search-button {
  background-color: var(--primary-blue);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-normal);
  padding: 0;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  position: absolute;
  left: 0;
  top: 0;
}

.search-button:hover {
  background-color: var(--primary-blue-hover);
}

.search-button img {
  width: 16px;
  height: 16px;
  /* filter: brightness(0) invert(1); */
}

.hamburger {
  display: none;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--primary-blue);
  transition: all 0.3s ease-in-out;
}

@media (max-width: 992px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 150px; /* Lowered to appear below the search bar */
    left: 0;
    width: 100%;
    background-color: var(--white);
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--gray-light);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

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

  .nav-links li {
    text-align: center;
    padding: var(--spacing-sm) 0;
  }

  .search-container {
    display: none;
    width: 100%;
    padding: var(--spacing-md);
    background-color: var(--white);
    position: absolute;
    top: 68px; /* Placed at the top of the mobile menu */
    left: 0;
    border-top: 1px solid var(--gray-light);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  .search-container.active {
    display: flex;
    justify-content: center;
    gap: 0; /* Removed gap to allow absolute positioning */
  }
  
  .search-input {
    flex-grow: 1;
    padding: 8px 20px 8px 52px; /* Added left padding for the icon */
  }

  .search-button {
    position: absolute;
    left: 24px; /* Positioned icon on the left inside the input */
    top: 50%;
    transform: translateY(-50%);
  }

  .hamburger {
    display: block;
  }

  .hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

@media (max-width: 768px) {
  .search-input {
    width: 200px;
    height: 36px;
    padding: 8px 15px 8px 46px;
  }
  
  .search-button {
    width: 34px;
    height: 34px;
  }
  
  .search-button img {
    width: 16px;
    height: 16px;
  }

  .footer-list li::after {
    display: none;
  }

  footer {
    padding: var(--spacing-xxl) var(--spacing-lg);
  }

  .contact-info {
    flex-direction: column;
    gap: var(--spacing-lg);
  }

  footer .contact-item {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-blue);
  color: var(--white);
  text-decoration: none;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  transition: background-color var(--transition-normal);
  cursor: pointer;
  padding: 0 32px;
  height: clamp(50px, 4.4vw, 76px); /* 76px es 4.4% de 1728px */
  min-width: clamp(280px, 27.5vw, 476px); /* 476px es 27.5% de 1728px */
  font-size: clamp(18px, 1.16vw, 20px);
}

.btn:hover {
  background-color: var(--primary-blue-hover);
  color: var(--white);
}


/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== FOCUS STYLES ===== */
button:focus,
a:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}


/* ===== FOOTER ===== */
footer {
  background-color: var(--primary-blue);
  width: 100%;
  height: clamp(400px, 25vw, 450px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(20px, 1.16vw, 40px);
}

footer h2 {
  color: white;
  font-size: clamp(24px, 1.39vw, 32px);
  font-weight: 500;
  margin-bottom: clamp(32px, 1.85vw, 40px);
}

footer .contact-button {
  background-color: transparent;
  color: white;
  border: 4px solid white;
  width: clamp(260px, 17.53vw, 303px); /* 303px / 1728px = 17.53% */
  height: clamp(48px, 3.7vw, 64px); /* 64px / 1728px = 3.7% */
  border-radius: 50px;
  font-size: clamp(20px, 1.39vw, 24px); /* 24px / 1728px = 1.39% */
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-bottom: clamp(60px, 4.63vw, 80px); /* Aumentado el espacio */
}

footer .contact-button:hover {
  background-color: white;
  color: var(--primary-blue);
}

footer .contact-info {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
  flex-wrap: wrap;
}

footer .contact-item {
  display: flex;
  align-items: center;
  gap: clamp(12px, 0.93vw, 16px);
  color: white;
  text-decoration: none;
  font-size: clamp(20px, 1.39vw, 24px); /* 24px / 1728px = 1.39% */
  font-weight: var(--font-weight-medium);
}

footer .contact-item:hover {
  opacity: 0.7;
}

footer .contact-item img {
  width: clamp(24px, 1.39vw, 24px);
  height: 24px;
  object-fit: contain;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (min-width: 768px) {
  .footer-list {
    gap: var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .footer-list {
    flex-direction: column;
    gap: var(--spacing-xs);
  }
  
  .footer-list li::after {
    display: none;
  }

  .contact-info {
    flex-direction: column;
    gap: var(--spacing-lg);
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}
