/* =========================================================
   IMPORTS (orden correcto)
   ========================================================= */
@import url("./CSS/hero.css");
@import url("./CSS/productos.css");

/* =========================================================
   THEME / VARIABLES GLOBALES
   ========================================================= */
:root {
  /* Brand */
  --color-primary: #0077b6;
  --color-primary-dark: #005f8a;
  --color-secondary: #00b4d8;
  --color-accent: #90e0ef;
  --color-light: #caf0f8;

  /* Fondo UNIFORME */
  --bg-solid: #01162f;

  /* Texto */
  --text: rgba(234, 243, 255, 0.92);
  --text-weak: rgba(234, 243, 255, 0.72);

  /* Glass / UI */
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(159, 227, 255, 0.14);
  --glass-shadow: 0 18px 55px rgba(0, 0, 0, 0.18);

  /* Layout */
  --transition: all 0.3s ease;
  --nav-h: 76px;
  --container: 1100px;
}

/* =========================================================
   RESET / BASE
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-solid);
}

body {
  position: relative; /* requerido para capas y fondos */
  overflow-x: hidden;
  background: var(--bg-solid);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    "Apple Color Emoji",
    "Segoe UI Emoji";
}

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

/* =========================================================
   SCROLLBAR (global)
   ========================================================= */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(159, 227, 255, 0.35) rgba(0, 0, 0, 0.25);
}
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
}
::-webkit-scrollbar-thumb {
  background: rgba(159, 227, 255, 0.35);
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.35);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(159, 227, 255, 0.5);
}
::-webkit-scrollbar-corner {
  background: rgba(0, 0, 0, 0.25);
}

/* =========================================================
   ANCHORS (evita que el navbar tape #id al hacer scroll)
   ========================================================= */
section[id],
main[id],
div[id] {
  scroll-margin-top: var(--nav-h);
}

/* =========================================================
   STACKING / CAPAS (FIX DEFINITIVO)
   - Navbar debe estar encima sin meter padding-top
   - Burbujas siempre atrás
   - Contenido encima de burbujas, debajo del navbar
   ========================================================= */

/* Burbujas globales: SIEMPRE por debajo */
.bubble-field--global {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.55;
}

/* Contenido general por encima de burbujas */
main,
section,
footer {
  position: relative;
  z-index: 1;
}

/* El nav se inyecta dentro del placeholder, así que este debe
   estar por encima del contenido para no “encerrar” el nav */
#nav-placeholder {
  position: relative;
  z-index: 99998;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Navbar siempre por encima de TODO */
.navbar,
.navbar.sticky-top {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 99999;

  background: rgba(0, 29, 46, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  padding: 0.8rem 0;
  transition: var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Estado scrolled */
.navbar.scrolled {
  padding: 0.5rem 0;
  background: rgba(0, 29, 46, 0.92);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Hero: debe poder estar “pegado” arriba, pero nunca tapar el nav */
.hero,
.hero-3d,
.hero-overlay,
.hero-3d spline-viewer {
  position: relative;
  z-index: 1;
}

/* =========================================================
   HERO pegado arriba (sin offsets)
   ========================================================= */
.hero {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* =========================================================
   NAVBAR: Logo
   ========================================================= */
.logo {
  font-size: 1.6rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 1px;
  transition: var(--transition);
}
.logo:hover {
  transform: scale(1.02);
  text-decoration: none;
}
.logo-ocean {
  color: #fff;
  font-weight: 600;
}
.logo-ify {
  color: var(--color-secondary);
  font-weight: 700;
}

/* =========================================================
   NAVBAR: Links
   ========================================================= */
.nav-link {
  color: #fff !important;
  font-weight: 500;
  font-size: 0.95rem;
  margin: 0 0.2rem;
  padding: 0.5rem 1rem !important;
  position: relative;
  transition: var(--transition);
  letter-spacing: 0.5px;
}
.nav-link:hover {
  color: var(--color-accent) !important;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  border-radius: 2px;
  transform: translateX(-50%);
  transition: var(--transition);
  background: rgba(159, 227, 255, 0.55);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 70%;
}
.nav-link.active {
  color: var(--color-secondary) !important;
}

/* =========================================================
   NAVBAR: Carrito
   ========================================================= */
.carrito-icon {
  position: relative;
}

.btn-carrito {
  background: transparent;
  border: 2px solid var(--color-secondary);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  transition: var(--transition);
  font-size: 1.1rem;
}
.btn-carrito:hover {
  background: var(--color-secondary);
  color: #01162f;
  transform: scale(1.05);
}

.carrito-contador {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff6b6b;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.5);
}

/* =========================================================
   NAVBAR: Mobile
   ========================================================= */
@media (max-width: 991px) {
  .navbar-collapse {
    background: rgba(0, 29, 46, 0.96);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  }

  .nav-link {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
  }
  .nav-item:last-child .nav-link {
    border-bottom: none;
  }
  .nav-link::after {
    display: none;
  }
}

/* =========================================================
   CONTACTO
   ========================================================= */
.contact {
  position: relative;
  overflow: hidden;
  padding: 70px 20px 24px;
  background: transparent;
  margin-bottom: 0 !important;
  padding-bottom: 24px;
  color: #fff;
}

/* Evita colapso de márgenes internos */
.contact::after {
  content: "";
  display: block;
  height: 0;
  clear: both;
}

.contact__container {
  max-width: var(--container);
  margin: 0 auto;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;

  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .contact__container {
    grid-template-columns: 1fr;
  }
}

/* Info */
.contact__title {
  font-size: 2.1rem;
  margin: 0 0 14px 0;
}
.contact__text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.92;
}
.contact__details {
  margin: 18px 0 0 0;
  list-style: none;
  padding: 0;
}
.contact__details li {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

/* Form */
.contact__form {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  padding: 26px;
  border-radius: 18px;

  display: flex;
  flex-direction: column;
  gap: 12px;

  margin: 0;
}

.contact__input,
.contact__textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  outline: none;
  font-size: 0.95rem;

  background: rgba(0, 0, 0, 0.18);
  color: rgba(234, 243, 255, 0.95);
}

.contact__textarea {
  min-height: 120px;
  resize: none;
}

.contact__button {
  margin-top: 6px;
  margin-left: auto;
  width: min(260px, 100%);

  background: linear-gradient(135deg, #1cb5e0, #0077b6);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 650;
  cursor: pointer;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.contact__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(28, 181, 224, 0.35);
}

/* =========================================================
   BURBUJAS ESPECÍFICAS (contacto)
   ========================================================= */
.contact .bubble-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* =========================================================
   FOOTER PRO
   ========================================================= */
.site-footer {
  margin: 0 !important;
  padding: 26px 16px 30px;
  background: transparent;
  position: relative;
  z-index: 1; /* debajo del nav, encima burbujas */
}

/* Burbuja contenedora */
.footer-bubble {
  max-width: 1100px;
  margin: 0 auto;

  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);

  background: linear-gradient(
    180deg,
    rgba(0, 180, 216, 0.1),
    rgba(1, 22, 47, 0.88)
  );

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);

  padding: 22px 22px 14px;
}

/* Grid de columnas */
.footer-wrap {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1.15fr 1.15fr;
  gap: 20px 26px;
  align-items: start;
}

/* Tipografía base */
.site-footer,
.site-footer p,
.site-footer a,
.site-footer li {
  font-family: sans-serif;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(234, 243, 255, 0.86);
  margin: 0;
}

/* Columna */
.footer-col {
  min-width: 0;
}

/* Brand */
.footer-logo {
  margin: 0 0 10px 0;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  color: rgba(234, 243, 255, 0.95);
  font-weight: 900;
}

.footer-desc {
  color: rgba(234, 243, 255, 0.74);
  max-width: 44ch;
}

/* Títulos */
.footer-title {
  margin: 0 0 10px 0;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(234, 243, 255, 0.92);
  font-size: 0.72rem;
}

.footer-title-center {
  text-align: center;
}

/* Links columna navegación */
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;

  display: grid;
  gap: 8px;
}

.footer-links a {
  color: rgba(144, 224, 239, 0.95);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(144, 224, 239, 0.6);
}

/* Info */
.footer-info {
  list-style: none;
  padding: 0;
  margin: 0;

  display: grid;
  gap: 8px;
}

.footer-info li {
  color: rgba(234, 243, 255, 0.84);
}

/* Equipo */
.dev-list {
  list-style: none;
  padding: 0;
  margin: 0;

  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.dev-list a {
  color: rgba(144, 224, 239, 0.95);
  text-decoration: none;
  font-weight: 650;
}

.dev-list a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(144, 224, 239, 0.6);
}

/* Franja inferior */
.footer-bottom {
  grid-column: 1 / -1;
  margin-top: 14px;
  padding-top: 12px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copy {
  color: rgba(234, 243, 255, 0.72);
}

/* Redes */
.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;

  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(159, 227, 255, 0.14);

  color: rgba(234, 243, 255, 0.85);
  text-decoration: none;
  font-weight: 900;

  transition:
    transform 0.15s ease,
    border-color 0.2s ease;
}

.footer-social a:hover {
  transform: translateY(-1px);
  border-color: rgba(234, 243, 255, 0.28);
}

/* =========================================================
   RESPONSIVE (Footer)
   ========================================================= */
@media (max-width: 980px) {
  .footer-wrap {
    grid-template-columns: 1fr 1fr;
  }

  .footer-title-center {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .footer-bubble {
    padding: 18px 14px 12px;
  }

  .footer-wrap {
    grid-template-columns: 1fr;
  }

  .dev-list {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* =========================================================
   BURBUJA INDIVIDUAL (animación)
   ========================================================= */
.bubble {
  position: absolute;
  left: var(--x);
  bottom: -12vh;

  width: var(--size);
  height: var(--size);
  border-radius: 999px;

  background:
    radial-gradient(
      circle at 30% 28%,
      rgba(255, 255, 255, 0.32),
      transparent 38%
    ),
    radial-gradient(
      circle at 55% 60%,
      rgba(159, 227, 255, 0.12),
      transparent 55%
    ),
    rgba(255, 255, 255, 0.03);

  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow:
    0 0 18px rgba(234, 243, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  opacity: var(--alpha);

  animation:
    bubbleRise var(--dur) linear infinite,
    bubbleDrift var(--driftDur) ease-in-out infinite;
}

@keyframes bubbleRise {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0, -125vh, 0) scale(1.08);
  }
}

@keyframes bubbleDrift {
  0% {
    margin-left: 0;
  }
  50% {
    margin-left: var(--drift);
  }
  100% {
    margin-left: 0;
  }
}
