/* ================= VARIABLES ================= */
:root {
  --bg-base: #0a122a;
  --bg-surface: #131a33;
  --bg-surface-high: #212942;
  --bg-surface-light: rgba(255, 255, 255, 0.05);
  --primary: #00f0ff;
  --primary-hover: #4cd6fb;
  --secondary: #4cd6fb;
  --text-main: #dbe1ff;
  --text-muted: #849495;
  --text-dark: #002022;
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.3s ease;
}

/* ================= RESET Y BASE ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.85; 
  /* ESPACIADO ENTRE LETRAS AMPLIADO */
  letter-spacing: 0.03em; 
  padding-top: 80px; 
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

/* ================= LAYOUT Y ESPACIADOS ================= */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* CORRECCIÓN: Contenido pegado arriba, sin altura forzada ni centrado vertical */
.section-padding { padding: 60px 0 80px 0; display: block; }
.py-large { padding: 60px 0; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 40px; }
.mt-4 { margin-top: 40px; }

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.grid-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 50px; align-items: start; }
.grid-footer { display: grid; grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr; gap: 30px; }

/* ================= HEADER ================= */
.header { position: fixed; top: 0; left: 0; width: 100%; height: 80px; background: rgba(5, 13, 37, 0.95); backdrop-filter: blur(15px); z-index: 1000; border-bottom: 1px solid var(--bg-surface-light); }
.header .container { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--primary); display: flex; align-items: center; gap: 10px; letter-spacing: 0em; }
.nav-links { display: flex; gap: 18px; }
.nav-links a { font-weight: 600; color: var(--text-muted); font-size: 0.95rem; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }

/* ================= TIPOGRAFÍA ================= */
.title-xl { font-size: 3.5rem; font-weight: 800; line-height: 1.2; letter-spacing: 0.01em; }
.title-lg { font-size: 2.2rem; font-weight: 700; line-height: 1.3; }
.title-md { font-size: 1.4rem; font-weight: 700; }
.title-sm { font-size: 1.15rem; font-weight: 700; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }

/* ================= IMAGEN DE CABECERA (Páginas Internas) ================= */
.page-header { position: relative; width: 100%; height: 280px; border-radius: 20px; overflow: hidden; margin-bottom: 40px; border: 1px solid var(--bg-surface-light); background-color: var(--bg-surface-high); }
.page-header img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; transition: var(--transition); }
.page-header:hover img { opacity: 0.7; transform: scale(1.02); }
.page-header .overlay-content { position: absolute; bottom: 30px; left: 30px; z-index: 10; }
.page-header-title { font-size: 2.8rem; font-weight: 800; color: #fff; text-shadow: 0 4px 15px rgba(0,0,0,0.8); }

/* ================= COMPONENTES ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: 12px; font-weight: 700; font-size: 0.95rem; cursor: pointer; border: none; text-align: center; letter-spacing: 0.04em; }
.btn-primary { background-color: var(--primary); color: var(--text-dark); box-shadow: 0 4px 15px rgba(0, 240, 255, 0.2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 240, 255, 0.4); }
.btn-outline { background-color: transparent; color: var(--primary); border: 1px solid rgba(0,240,255,0.3); }
.btn-outline:hover { background-color: rgba(0,240,255,0.1); }

.card { background-color: var(--bg-surface); border-radius: 20px; padding: 30px; border: 1px solid var(--bg-surface-light); transition: var(--transition); }
.card:hover { transform: translateY(-4px); box-shadow: 0 15px 30px rgba(0,0,0,0.4); border-color: rgba(0,240,255,0.3); }
.card-light { background-color: var(--bg-surface-high); border-radius: 12px; padding: 20px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: rgba(0, 240, 255, 0.15); color: var(--primary); border-radius: 30px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-solid { background: var(--primary); color: var(--text-dark); }

/* Acordeón FAQ */
.faq-item { background: var(--bg-surface); border-radius: 12px; margin-bottom: 12px; overflow: hidden; border: 1px solid var(--bg-surface-light); }
.faq-btn { width: 100%; padding: 20px; display: flex; justify-content: space-between; align-items: center; background: none; border: none; color: var(--text-main); font-weight: 700; font-size: 1.05rem; cursor: pointer; text-align: left; }
.faq-content { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease; color: var(--text-muted); font-size: 0.95rem; }
.faq-btn[aria-expanded="true"] + .faq-content { max-height: 400px; padding: 0 20px 20px 20px; }
.faq-icon { transition: transform 0.3s ease; color: var(--primary); }
.faq-btn[aria-expanded="true"] .faq-icon { transform: rotate(180deg); }

/* Formulario */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; }
.form-control { width: 100%; padding: 15px; background-color: rgba(5, 13, 37, 0.5); border: 1px solid var(--bg-surface-light); border-radius: 10px; color: var(--text-main); font-family: inherit; font-size: 0.95rem; transition: var(--transition); letter-spacing: 0.02em; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.2); }
textarea.form-control { min-height: 100px; resize: vertical; }

/* ================= FOOTER ================= */
.footer { background-color: #050d25; padding: 50px 0 20px; margin-top: auto; border-top: 1px solid rgba(0, 240, 255, 0.2); }
.footer h4 { color: white; margin-bottom: 15px; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 8px; border-left: 3px solid var(--primary); padding-left: 10px; }
.footer ul li { margin-bottom: 12px; color: var(--text-muted); display: flex; align-items: flex-start; gap: 8px; font-size: 0.9rem; }
.footer ul li a { display: flex; align-items: center; gap: 5px; }
.footer ul li a:hover { color: var(--primary); transform: translateX(3px); }
.footer-icon { color: var(--primary); font-size: 1.1rem; margin-top: 2px; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: 0.85rem; flex-wrap: wrap; gap: 15px; }

/* ================= ANIMACIONES ================= */
@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Al aplicar esto a <main>, garantizamos que TODO el contenido 
   haga el efecto de desplazamiento hacia arriba cada vez que entras a una página */
main {
  animation: slideUpFade 0.7s ease-out forwards;
}

/* ================= MENÚ MÓVIL ================= */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}
.mobile-menu-btn span { font-size: 2.2rem; }

/* ================= DISEÑO RESPONSIVO ================= */
@media (max-width: 1024px) {
  .grid-layout, .grid-2 { grid-template-columns: 1fr; }
  .grid-footer { grid-template-columns: 1fr 1fr; }
  .page-header-title { font-size: 2.2rem; }
}

@media (max-width: 768px) {
  .title-xl { font-size: 2.5rem; }
  .grid-footer { grid-template-columns: 1fr; }
  .page-header { height: 200px; }
  
  /* Logica del Menú Móvil */
  .mobile-menu-btn { display: block; }
  .btn-header-cotizar { display: none; } /* Ocultamos el botón grande arriba para ahorrar espacio */
  
  .nav-links {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: rgba(5, 13, 37, 0.98);
    backdrop-filter: blur(15px);
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px 0;
    border-bottom: 1px solid var(--bg-surface-light);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    display: none; /* Oculto por defecto en móvil */
  }
  
  /* Clase que JS activará para mostrar el menú */
  .nav-links.active-mobile {
    display: flex;
  }
}

/* ================= ACCESIBILIDAD Y ESTADOS ================= */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--text-dark);
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.skip-link:focus {
  transform: translateY(0);
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.header--scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  background: rgba(5, 13, 37, 0.98);
}
.nav-links a[aria-current="page"] {
  color: var(--primary);
}

/* ================= VENTANA MODAL ================= */
.site-modal {
  width: min(92vw, 560px);
  max-width: 560px;
  margin: auto;
  padding: 30px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.site-modal::backdrop {
  background: rgba(2, 8, 24, 0.78);
  backdrop-filter: blur(5px);
}
.site-modal[open] {
  animation: modalAppear 0.22s ease-out;
}
@keyframes modalAppear {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.site-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.site-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  color: var(--text-main);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
}
.site-modal__close:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.site-modal__text {
  margin: 18px 0 26px;
  color: var(--text-muted);
}
.site-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ================= FORMULARIO: FEEDBACK Y AYUDA ================= */
.form-help {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.form-privacy {
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.form-feedback {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.form-feedback .material-symbols-outlined {
  flex: 0 0 auto;
}
.form-feedback--success {
  color: #9cebd4;
  background: rgba(25, 135, 84, 0.14);
  border: 1px solid rgba(25, 135, 84, 0.35);
}
.form-feedback--error {
  color: #ffc1c1;
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.35);
}
#btnSubmitForm:disabled {
  cursor: wait;
  opacity: 0.72;
}

/* ================= AJUSTES PARA PANTALLAS PEQUEÑAS ================= */
@media (max-width: 768px) {
  .site-modal {
    padding: 22px;
  }
  .site-modal__actions {
    flex-direction: column;
  }
  .site-modal__actions .btn {
    width: 100%;
  }
}
@media (max-width: 480px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .title-xl {
    font-size: 2.05rem;
  }
  .page-header-title {
    font-size: 1.75rem;
  }
  .section-padding {
    padding: 42px 0 56px;
  }
  .site-modal__header .title-lg {
    font-size: 1.55rem;
  }
}

/* Respeta la preferencia del usuario de reducir animaciones. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* Acceso discreto al panel administrativo desde el pie de página */
.footer-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 10px;
  color: var(--primary);
  background: rgba(0, 240, 255, 0.045);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.footer-admin-link .material-symbols-outlined { font-size: 1.1rem; }
.footer-admin-link:hover {
  color: var(--text-main);
  background: rgba(0, 240, 255, 0.11);
  border-color: rgba(0, 240, 255, 0.55);
  transform: translateY(-1px);
}
.footer-admin-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

/* ================= MAPA INTERACTIVO EN FOOTER ================= */
.footer-map-box {
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: var(--bg-surface-high);
}
.footer-map-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none; /* Permite que el clic pase al enlace superior */
}
.footer-map-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px;
  background: linear-gradient(to top, rgba(5, 13, 37, 0.78), transparent 55%);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}
.footer-map-overlay:hover {
  background: linear-gradient(to top, rgba(0, 240, 255, 0.22), transparent 65%);
  color: #ffffff;
}

/* ================= GALERÍA ================= */
.card.gallery-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card.gallery-card img {
  width: 100%;
  max-width: 100%;
  height: 290px;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease;
}
.card.gallery-card:hover img {
  transform: scale(1.05);
}
.gallery-caption {
  padding: 18px 20px;
  flex: 1;
}
