:root {
  --blue-primary: #071899;
  --white: #FFFFFF;
  --gray-light: #F4F4F4;
  --text-primary: #333333;
  --font-family: 'Montserrat', sans-serif;
}

/* --- Global Styles & Resets --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-weight: 400;
  color: var(--text-primary);
  background-color: var(--white);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--blue-primary);
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--blue-primary);
  outline-offset: 2px;
}

/* --- Reusable Components --- */

/* Button */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-family);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
  text-align: center;
  margin: 5px;
}

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

.btn-primary:hover:not(:disabled) {
  background-color: #1a2fb9;
  transform: translateY(-2px);
}

.btn:disabled {
  background-color: #cccccc;
  color: #666666;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--white);
  border: 2px solid var(--white); /* Borde blanco */
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--white); /* Fondo blanco al pasar el mouse */
  color: var(--blue-primary); /* Texto azul */
  transform: translateY(-2px);
}


/* Section */
.section-container {
  padding: 80px 20px;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
}

/* Card */
.card {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.card-icon {
  font-size: 3rem;
  color: var(--blue-primary);
  margin-bottom: 20px;
  height: 64px; /* Fixed height for alignment */
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-icon img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.card-description {
  font-size: 1rem;
  color: #666;
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background-color: var(--white);
}

.top-bar {
  background-color: var(--blue-primary);
  color: var(--white);
  padding: 8px 40px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 0.85rem;
  height: 35px;
}

.top-bar-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-bar a:hover {
    text-decoration: underline;
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  height: 75px;
    position: relative;

}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo-img {
  height: 50px; /* Adjust height as needed */
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links a {
  font-weight: 700;
  color: var(--blue-primary);
  padding-bottom: 5px;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--blue-primary);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle-btn {
  display: none; /* Oculto en desktop */
  background: none;
  border: none;
  color: var(--blue-primary);
  font-size: 1.8rem; /* Tamaño del ícono */
  cursor: pointer;
  z-index: 1002; /* Debe estar por encima del menú móvil */
}


/* --- Hero Section --- */
.hero-section {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden; /* Hide parts of images that overflow */
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  will-change: opacity;
}

.hero-slide.active {
  opacity: 1;
}


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

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 20px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-slogan {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #FFFFFF;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap; /* Para que se apilen en móviles si no caben */
  justify-content: center;
  gap: 15px; /* Espacio entre botones */
  margin-top: 10px;
}

/* --- Nosotros Section --- */
.nosotros-intro {
  max-width: 800px;
  margin: 0 auto 60px auto;
  text-align: center;
}

.nosotros-intro p {
  font-size: 1.4rem;
  line-height: 1.7;
  color: #555;
}

/* --- Servicios Section --- */
.servicios-section {
  background-color: var(--gray-light);
}

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

/* --- Historia Section --- */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* --- Contacto Section --- */
.contacto-section {
  background-color: var(--gray-light);
}

.contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}

.contact-form .form-group {
    position: relative;
    margin-bottom: 30px;
}

.contact-form label {
    position: absolute;
    top: 16px;
    left: 16px;
    color: #999;
    background: var(--white);
    padding: 0 4px;
    transition: all 0.2s ease;
    pointer-events: none;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    background-color: var(--white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(7, 24, 153, 0.15);
}

.contact-form input:focus + label,
.contact-form textarea:focus + label,
.contact-form input:not(:placeholder-shown) + label,
.contact-form textarea:not(:placeholder-shown) + label {
    top: 0;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--blue-primary);
    font-weight: 700;
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.recaptcha-field {
    margin-bottom: 20px;
}
.contact-form .btn {
    width: 100%;
}
.map-container {
    height: 100%;
    min-height: 400px;
    border-radius: 10px;
    overflow: hidden;
}
.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.form-success-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
    text-align: center;
}

.form-error-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
    text-align: center;
}

/* --- Footer --- */
.footer {
  background-color: var(--blue-primary);
  color: var(--white);
  padding: 60px 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}
.footer-column .footer-logo-img {
  width: 150px; /* Adjust as needed */
  margin-bottom: 15px;
}
.footer-column h3 {
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 15px;
}
.footer-column p, .footer-column a {
    display: block;
    margin-bottom: 8px;
    color: #ddd;
    transition: color 0.3s ease;
}
.footer-column a:hover {
    color: var(--white);
}

/* --- Responsive Design --- */

/* Tablet */
@media (max-width: 1024px) {
    .section-title {
        font-size: 2rem;
    }
    .hero-slogan {
        font-size: 2.8rem;
    }
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .contacto-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-column .footer-logo-img {
      margin: 0 auto 15px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .section-container {
        padding: 60px 15px;
    }
      .main-nav {
        /* Ya no es columna, es fila con espacio entre logo y botón */
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: 70px; /* Altura fija para el nav móvil */
        padding: 10px 20px; /* Padding izquierdo/derecho */
    }
    .nav-logo {
        position: static;
        transform: none;
        margin-bottom: 0; /* Quitamos el margen inferior */
        /* Aseguramos que el logo esté a la izquierda */
        display: flex;
        justify-content: flex-start;
    }


    .nav-logo-img {
      height: 40px;
    }

    /* Mostramos el botón de hamburguesa */
    .nav-toggle-btn {
      display: block;
    }

    .nav-links {
        /* Convertimos el menú en un panel deslizable */
        position: fixed; /* Fijo en la pantalla */
        top: 0;
        right: 0;
        bottom: 0;
        width: 70%; /* Ancho del panel */
        max-width: 300px;

        /* Oculto por defecto (fuera de la pantalla a la derecha) */
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;

        /* Estilos del panel */
        flex-direction: column;
        justify-content: center; /* Centramos los links verticalmente */
        align-items: center;
        background-color: var(--white);
        box-shadow: -5px 0 15px rgba(0,0,0,0.15);
        padding-top: 80px; /* Espacio para el top-bar y nav */
        gap: 25px; /* Espacio entre links */
        z-index: 1001;
    }

    /* Clase que se añade con JS para mostrar el menú */
    .nav-links.nav-open {
        transform: translateX(0);
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
      font-size: 1.2rem; /* Hacemos los links más grandes */
      padding: 10px 0;
    }
    .top-bar {
        justify-content: center;
        padding: 8px 15px;
        text-align: center;
    }
    .hero-slogan {
        font-size: 2rem;
    }
    .servicios-grid {
        grid-template-columns: 1fr;
    }
}

.whatsapp-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366; /* Verde de WhatsApp */
    color: var(--white);
    width: 60px; /* Un poco más grande para el logo */
    height: 60px;
    border-radius: 50%;
    border: none;

    font-size: 2.2rem; /* (Aprox 35px) para que se vea bien en el botón de 60px */

    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    z-index: 1000; /* Aseguramos que esté por encima de otro contenido */
}

.whatsapp-button:hover {
    background-color: #128C7E; /* Verde más oscuro de WhatsApp */
    transform: translateY(-20px); /* Mantenemos el efecto de elevación */
}

.whatsapp-button.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        transition: none;
    }
    .moving-track {
        animation: none !important;
    }
}
