/* Importar paleta de colores */
@import url('colors.css');

/* Reset y estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--texto-oscuro);
  background-color: var(--color-blanco);
}

/* Main content */
main {
  margin-top: 120px; /* Espacio para la barra de contacto + header fijo */
}

/* Secciones generales */
.section {
  padding: 1rem 0; /* Aumenta el padding vertical */
  background-color: var(--color-blanco);
  position: relative;
  margin-top: 5rem;
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-principal), var(--color-secundario));
  border-radius: 2px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--color-secundario);
  font-weight: bold;
}

/* Botón general para contenido */
.btn {
  background: linear-gradient(135deg, var(--color-secundario) 0%, var(--color-secundario-hover) 100%);
  color: var(--color-blanco);
  padding: 0.7rem 1.5rem;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(4, 50, 77, 0.2);
  border: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
  text-decoration: none;
  display: inline-block;
}

.btn::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;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  background: linear-gradient(135deg, var(--color-secundario-hover) 0%, var(--color-secundario) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(4, 50, 77, 0.4);
  color: var(--color-blanco);
}

.ver-mas-container {
  text-align: center;  /* ✅ centra contenido inline-block como botones */
  margin-top: 20px;    /* opcional para separar del grid */
}

/* ===== HEADER Y NAVEGACIÓN ===== */

/* Barra de contacto superior */
.top-contact-bar {
  background: var(--color-secundario);
  color: var(--color-blanco);
  padding: 0.5rem 0;
  font-size: 0.85rem;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1001;
}

.contact-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.separator {
  color: rgba(255,255,255,0.5);
  font-weight: 300;
}

/* Header principal */
header {
  background: linear-gradient(135deg, var(--color-blanco) 0%, var(--color-tercero) 100%);
  color: var(--texto-oscuro);
  padding: 0.6rem 0;
  position: fixed;
  top: 38px; /* Espacio para la barra de contacto */
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between; /* Cambia a space-between */
  height: 60px;
  position: relative;
}

/* Logo totalmente a la izquierda */
header .logo {
  position: static; /* Elimina absolute */
  left: 0;
  margin-left: 0; /* Asegura que no tenga margen extra */
}

.logo-img-header {
  height: 40px;
  width: auto;
  transition: all 0.3s ease;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-principal);
  letter-spacing: -0.5px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

header .logo:hover .logo-img-header {
  transform: scale(1.1);
}

header .logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-principal), var(--color-secundario));
  transition: width 0.3s ease;
}

header .logo:hover::after {
  width: 100%;
}

/* Navegación principal */
.main-nav {
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2.6rem;
}

.main-nav ul li {
  margin: 0;
}

.main-nav ul li a {
  color: var(--texto-oscuro);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: all 0.3s ease;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  position: relative;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.main-nav ul li a.active,
.main-nav ul li a:hover {
  color: var(--color-principal);
  background: linear-gradient(135deg, rgba(0, 155, 0, 0.08), rgba(4, 50, 77, 0.08));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 155, 0, 0.15);
}

/* Línea SIEMPRE visible en el enlace activo */
.main-nav ul li a.active::before {
  width: 80%;
  opacity: 1;
}

/* Línea animada SOLO en hover */
.main-nav ul li a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-principal), var(--color-secundario));
  transition: width 0.3s ease;
  transform: translateX(-50%);
  opacity: 1;
}

.main-nav ul li a:hover::before {
  width: 80%;
}

/* Botones del header */
.header-buttons {
  display: flex;
  align-items: center;
  position: static; /* Elimina absolute */
  margin-left: auto;
  margin-right: 0;
}

.header-buttons .dropdown {
  position: relative;
  display: inline-block;
}

.header-buttons .dropdown-toggle {
  cursor: pointer;
}

.header-buttons .dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 110%;
  min-width: 220px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  z-index: 100;
  padding: 0.5rem 0;
}

.header-buttons .dropdown-menu.show {
  display: block;
}

.header-buttons .dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.2rem;
  color: var(--texto-oscuro);
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s;
}

.header-buttons .dropdown-menu .dropdown-item:hover {
  background: rgba(0, 155, 0, 0.08);
  color: var(--color-principal);
}

/* Menú hamburguesa */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.8rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  color: var(--texto-oscuro);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%; /* justo debajo del header */
  left: 0;
  width: 100%;
  background: #fff;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  z-index: 999;
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.mobile-nav li { margin-bottom: 0.75rem; }

.mobile-nav a {
  display: block;
  width: 100%;
  text-decoration: none;
  font-size: 1rem;
  color: var(--texto-oscuro);
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mobile-nav a:hover { color: var(--color-principal); }

/* Estado visible (se fuerza por si quedó algún !important previo) */
.mobile-nav.active { 
  display: flex !important; 
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Estilos para el botón de inicio de sesión */
.btn-login {
  background: linear-gradient(135deg, #168030 0%, #2b9b2b 100%);
  color: #fff;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.7rem 2rem;
  box-shadow: 0 4px 15px rgba(67, 234, 108, 0.15);
  border: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-login:hover,
.btn-login:focus {
  background: linear-gradient(135deg, #2b9b2b 0%, #168030 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(67, 234, 108, 0.22);
}

.menu-toggle:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-secundario), var(--color-principal));
  margin: 2px 0;
  transition: all 0.3s ease;
  border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Clearfix para el header */
header::after {
  content: "";
  display: table;
  clear: both;
}

/* ===== FOOTER ===== */

/* Footer nuevo estilo */
.main-footer {
  background: #16263a;
  color: #fff;
  padding: 3rem 0 1.5rem 0;
  font-size: 0.9rem;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start; /* Cambia a flex-start para alinear arriba */
  margin: 0 auto;
  gap: 8rem;
  padding-bottom: 2rem;
}

.footer-logo .logo-img {
  width: 300px; /* Ajusta el tamaño si el logo es muy grande */
  height: auto;
  margin-bottom: 0;
}

.footer-info h3,
.footer-links h4,
.footer-contact h4,
.footer-social h4 {
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  font-weight: bold;
  color: #fff; /* Títulos blancos */
}

.footer-info p,
.footer-links ul,
.footer-contact ul {
  margin-bottom: 1.5rem;
}

.footer-info p{
  max-width: 170px;
}

.footer-links ul,
.footer-contact ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li,
.footer-contact li {
  margin-bottom: 0.7rem;
  color: #dbe7f6;
}

.footer-contact i {
  margin-right: 0.5rem;
  color: #43ea6c;
  font-size: 1rem;
}

.footer-social a {
  font-size: 1.2rem;
  margin-right: 0.7rem;
  transition: transform 0.2s;
  display: inline-block;
}

.footer-social a:hover {
  transform: scale(1.15);
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  color: #b0c4de;
  font-size: 0.9rem;
}

.footer-bottom hr {
  border: none;
  border-top: 1px solid #2c3e50;
  margin-bottom: 1rem;
}

.footer-credit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #bbb;
}

.footer-credit .logo-img-credit {
  height: 50px;
  width: auto;
}

.footer-credit .credit-text {
  display: flex;
  flex-direction: column; /* Fuerza spans uno debajo del otro */
  line-height: 1.3;
  text-align: left;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Responsive: tablets */
@media (max-width: 900px) {
  .top-contact-bar {
    font-size: 14px;
    padding: 6px 0;
  }
  .top-contact-bar .contact-item i {
    font-size: 14px;
  }
  
  .menu-toggle { display: flex; }
  .main-nav { display: none; }

  .mobile-nav {
    top: calc(100% - 12px); /* ajusta este valor a tu gusto */
  }

  /* Botón Inicio Sesión más pequeño y centrado */
  .header-buttons {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
  }
  .btn-login {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
  }

  .footer-top {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
  }
  .footer-logo {
    margin-bottom: 1rem;
    margin-right: 0;
    justify-content: center;
  }
  .footer-logo .logo-img {
    width: 170px;
    margin-bottom: 0.7rem;
  }
  .footer-info,
  .footer-links,
  .footer-contact,
  .footer-social {
    max-width: 100%;
    margin-bottom: 1.5rem;
  }
  .footer-social a {
    font-size: 1.1rem;
    margin-right: 0.5rem;
  }
}

/* Responsive: móviles */
@media (max-width: 600px) {
  .top-contact-bar {
    font-size: 8px;
    padding: 6px 0;
  }
  .top-contact-bar .contact-item {
    display: block; /* opcional: hace que se apilen */
    margin: 2px 0;
  }
  .top-contact-bar .separator {
    display: none; /* quita los | en móviles si quieres */
  }

  .logo-img-header {
    display: none;
  }

  .menu-toggle {
    margin-right: 20px; /* más separación en móviles */
  }

  .main-footer {
    padding: 2rem 0 1rem 0;
    font-size: 0.85rem;
  }
  .footer-top {
    gap: 1.2rem;
    padding-bottom: 1rem;
  }
  .footer-logo .logo-img {
    width: 70px;
    margin-bottom: 0.7rem;
  }
  .footer-info h3,
  .footer-links h4,
  .footer-contact h4,
  .footer-social h4 {
    font-size: 1rem;
    margin-bottom: 0.7rem;
  }
  .footer-bottom {
    font-size: 0.8rem;
  }

  .footer-credit {
    flex-direction: column;
    text-align: center;
  }

  .footer-credit .credit-text {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .logo-img-header {
    display: none;
  }

  .menu-toggle {
    margin-right: 20px; /* más separación en móviles */
  }
  .header-buttons .dropdown-menu {
    right: -30px;
  }
}
