/* ======================================================
   HA INGENIEROS – DESIGN SYSTEM
   Modo Claro / Modo Oscuro
   ====================================================== */

/* -------------------------------
   VARIABLES DE TEMA
--------------------------------*/
:root {
  --font-base: 'Open Sans', system-ui, sans-serif;

  /* Brand */
  --primary: #0b6db6;
  --primary-dark: #135479;
  --secondary: #0e0573;

  /* UI */
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.25s ease;
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, .08);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .12);
}

/* -------------------------------
   MODO CLARO
--------------------------------*/
html[data-theme="light"] {
  --bg-main: #f5f7fa;
  --bg-surface: #ffffff;
  --bg-muted: #eef2f6;

  --text-main: #000000;
  --text-muted: #5f6b7a;
  --text-invert: #ffffff;

  --border-color: #dfe5ec;
}

/* -------------------------------
   MODO OSCURO
--------------------------------*/
html[data-theme="dark"] {
  --bg-main: #0f1720;
  --bg-surface: #16202b;
  --bg-muted: #1c2a38;

  --text-main: #ffffff;
  --text-muted: #9fb0c0;
  --text-invert: #ffffff;

  --border-color: #243547;
}

/* ======================================================
   BASE
====================================================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--bg-main);
  color: var(--text-main);
  /* transition: background var(--transition), color var(--transition); */
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Aplicar transición a componentes específicos, no a todo */
.card,
.navbar,
.btn,
input {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
/* ======================================================
   TIPOGRAFÍA
====================================================== */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: .4em;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3 {
  color: var(--primary);
}

h1 {
  font-size: 2.4rem;
}

h2 {
  font-size: 1.9rem;
}

h3 {
  font-size: 1.4rem;
}

p {
  line-height: 1.7;
  color: var(--text-muted);
}

.subtitle {
  font-weight: 300;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary);
}

/* ======================================================
   BOTONES
====================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.4rem;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-invert);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-invert);
}

/* ======================================================
   CARDS
====================================================== */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 1.6rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.card-header {
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: .6rem;
}

/* ======================================================
   CONTENEDORES Y SECCIONES
====================================================== */
.section {
  padding: 4rem 1.5rem;
}

.container {
  max-width: 1200px;
  margin: auto;
}

/* ======================================================
   BADGES
====================================================== */
.badge {
  display: inline-block;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--secondary);
  color: #fff;
}

/* ======================================================
   LINKS
====================================================== */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* ======================================================
   INPUTS
====================================================== */
input,
textarea,
select {
  width: 100%;
  padding: .75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  transition: border var(--transition), box-shadow var(--transition);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(11, 109, 182, .25);
}

/* ======================================================
   HEADER / NAV (Elite Version)
====================================================== */
.navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  /* Barra pegajosa */
  top: 0;
  z-index: 1000;
  height: 70px;
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 1.5rem;
}

/* Links del Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  position: relative;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0;
}

/* --- ANIMACIÓN HOVER & ACTIVO --- */
.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  /* Clase active controlada por JS */
  width: 100%;
}

.nav-link.active {
  color: var(--primary);
}

/* --- BOTÓN DARK MODE --- */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  background-color: var(--bg-muted);
  transform: rotate(15deg);
}

/* Ocultar icono según el tema */
html[data-theme="light"] .icon-sun {
  display: none;
}

html[data-theme="dark"] .icon-moon {
  display: none;
}

/* --- HAMBURGUESA (Móvil) --- */
.hamburger {
  display: none;
  /* Oculto en PC */
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--text-main);
  transition: 0.3s;
}

/* ======================================================
   RESPONSIVE (Móvil)
====================================================== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    z-index: 1001;
  }

  /* Animación botón X */
  .hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }

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

  .hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 75%;
    /* Ancho del cajón */
    height: 100vh;
    background: var(--bg-surface);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);

    /* Animación de entrada (Slide In) */
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
  }

  .nav-menu.active {
    transform: translateX(0);
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
  }

  .nav-link {
    font-size: 1.2rem;
  }
}

/* ======================================================
   FOOTER ELITE (CORREGIDO)
====================================================== */
.footer {
  background-color: var(--bg-muted);
  color: var(--text-muted);
  /* CAMBIO: Agregamos 1.5rem a los lados para que no pegue en el borde */
  padding: 4rem 1.5rem 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
}

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

/* --- ESTILOS DE COLUMNAS --- */
.footer-brand {
  color: var(--primary-dark);
  margin-top: 0;
}

html[data-theme="dark"] .footer-brand {
  color: var(--primary);
}

.footer-text {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Enlaces del Footer */
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-nav a,
.contact-email {
  color: var(--text-muted);
  transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-nav a:hover {
  color: var(--primary);
  padding-left: 5px;
}

/* Contacto */
.contact-item {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.contact-item strong {
  color: var(--text-main);
}

/* Barra Inferior (Sub-footer) */
.footer-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 0 0 2rem 0;
  opacity: 0.5;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

/* --- TU MARCA (DOUBLEVISTUDIO) --- */
.developer-credit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.developer-credit:hover {
  color: var(--text-main);
  transform: translateY(-2px);
}

.dev-brand {
  font-weight: 700;
  color: var(--text-main);
}

.dev-highlight {
  color: var(--primary);
}

/* ======================================================
   RESPONSIVE (MÓVIL)
====================================================== */
@media (max-width: 768px) {

  /* Centramos todo el contenido del grid en móviles */
  .footer-grid {
    text-align: center;
    gap: 2.5rem;
  }

  /* Centramos los enlaces de navegación */
  .footer-nav {
    align-items: center;
  }

  /* Centramos la barra inferior */
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  /* Quitamos el efecto de moverse a la derecha en móvil para que no se sienta raro */
  .footer-nav a:hover {
    padding-left: 0;
    color: var(--primary);
  }
}
/* ======================================================
   SCROLLBAR PERSONALIZADO (Look Moderno)
====================================================== */

/* Para Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-muted);
}

/* Para Chrome, Edge y Safari */
::-webkit-scrollbar {
  width: 10px;
  /* Ancho de la barra vertical */
  height: 10px;
  /* Alto de la barra horizontal */
}

/* El "carril" de fondo */
::-webkit-scrollbar-track {
  background: var(--bg-muted);
  border-radius: 4px;
}

/* La "manija" que mueves */
::-webkit-scrollbar-thumb {
  background-color: #9fb0c0;
  /* Un gris suave por defecto */
  border-radius: 4px;
  border: 2px solid var(--bg-muted);
  /* Crea un efecto de espacio alrededor */
  transition: background-color 0.3s;
}

/* Cuando pasas el mouse por encima */
::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary);
  /* Se pinta de tu azul corporativo */
}

/* Modo Oscuro: Ajuste sutil para que no brille tanto */
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background-color: #3b4d61;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary);
}