/* =========================================================
   ARSVITA — styles.css (CORREGIDO)
   ========================================================= */

:root {
  --blue: #2d36ff;
  --orange: #ff6a3d;
  --bone: #f7f1e7;
  --ink: #0f1020;
  --muted: #b6b6d6;

  --shadow: 0 12px 30px rgba(10, 10, 40, 0.25);
  --round: 22px;

  --r-fino: 36px;
  --r-alpha1: 0.16;
  --r-alpha2: 0.10;

  --logo-h: 70px;
  --margin-desktop: 2cm;
  --header-height: 80px;
}

/* =========================================================
   RESETEO GENERAL
========================================================= */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html {
  height: 100%;
  overflow-x: hidden;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  overflow-x: hidden;
  width: 100%;
  position: relative;
  max-width: 100vw;
}

body.lang-es .lang-en { display: none !important; }
body.lang-en .lang-es { display: none !important; }

body {
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, 'Inter', sans-serif;
  color: #fff;
  background:
    radial-gradient(1200px 600px at 80% -10%, #6c73ff22, transparent 60%),
    radial-gradient(900px 500px at -10% 20%, #ff6a3d22, transparent 60%),
    var(--blue);
  padding-top: var(--header-height);
}

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

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--margin-desktop);
}
.container-wide { width: min(1600px, 98vw); margin: auto; }

/* =========================================================
   HEADER FIJO - SÓLIDO Y SIN GLITCHES
========================================================= */
header.nav-full {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--header-height);
  background-color: #2d36ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--margin-desktop);
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  /* CRÍTICO: Forzar aceleración GPU para scroll suave */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Evita que el contenido quede tapado */
body {
  padding-top: var(--header-height);
}

/* Sombra más pronunciada al scrollear */
header.nav-full.scrolled {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.logo {
  flex-shrink: 0;
  z-index: 10000;
  height: var(--logo-h);
  display: flex;
  align-items: center;
}

.logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

header.nav-full .links {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  flex: 1;
  position: relative;
  z-index: 9999;
}

header.nav-full .links a {
  color: #fff;
  font-weight: 600;
  opacity: 0.95;
  font-size: 0.95rem;
  transition: opacity 0.25s ease;
  white-space: nowrap;
}

header.nav-full .links a:hover {
  opacity: 1;
}

.cta {
  background: var(--orange);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, filter 0.25s ease;
  border: none;
}
.cta:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* Switch idioma */
.lang-switch {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.lang-btn {
  border: 1px solid #ffffff33;
  background: #ffffff12;
  color: #fff;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.2s ease, background 0.2s ease;
}
.lang-btn:hover { transform: translateY(-1px); background: #ffffff18; }
.lang-btn.active { background: #fff; color: #111; border-color: transparent; }

/* Botón hamburguesa */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 10001;
  flex-shrink: 0;
}

.menu-toggle span {
  width: 24px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* =========================================================
   HERO
========================================================= */
.hero { 
  position: relative; 
  padding: 80px 0 30px; 
  overflow: hidden;
  /* CRÍTICO: Evitar que el contenido se superponga al header */
  z-index: 1;
}
.hero-grid { display: grid; grid-template-columns: 1fr; align-items: center; gap: 20px; }

.title {
  font-size: clamp(40px, 8vw, 120px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -1.5px;
}
.highlight-orange { color: var(--orange); }

.hero-sub {
  color: #f2eefb;
  opacity: .9;
  font-size: clamp(15px, 2vw, 20px);
  line-height: 1.7;
  margin-top: 16px;
  margin-bottom: 30px;
  max-width: 70ch;
}

/* =========================================================
   CINTA NARANJA
========================================================= */
#ribbon-orange {
  padding: 0;
  margin: 0 0 30px 0;
  width: 100%;
  overflow: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

#ribbon-orange .r-inner {
  position: relative;
  width: 100%;
  margin: 0;
  height: var(--r-fino);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0)),
    linear-gradient(90deg,
      rgba(255,106,61,var(--r-alpha1)),
      rgba(255,106,61,var(--r-alpha2))
    );
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
  overflow: hidden;
  backdrop-filter: blur(1px) saturate(110%);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

#ribbon-orange .r-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  animation: scroll-left 30s linear infinite;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}

#ribbon-orange .r-item {
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  font-size: 13px;
}

#ribbon-orange .r-item:not(:last-child)::after {
  content: '•';
  margin-left: 28px;
  opacity: .85;
}

@keyframes scroll-left {
  0% { transform: translateX(0) translateZ(0); }
  100% { transform: translateX(-50%) translateZ(0); }
}

/* =========================================================
   SECCIONES
========================================================= */
section { 
  padding: 50px 0;
  position: relative;
  z-index: 1;
}

#servicios { padding-top: 30px; }

h2 {
  font-size: clamp(26px, 4.5vw, 56px);
  margin-bottom: 18px;
  font-weight: 900;
  text-align: left;
  line-height: 1.1;
}
.sub {
  color: #e7e3ff;
  opacity: .9;
  max-width: 80ch;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 35px;
}

/* =========================================================
   SERVICIOS
========================================================= */
.grid { display: grid; gap: 20px; margin-top: 35px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.service {
  border-radius: var(--round);
  padding: 35px 24px;
  background: linear-gradient(180deg, #ffffff14, #ffffff08);
  border: 1px solid #ffffff26;
  text-align: center;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.service-icon {
  width: 85px;
  height: 85px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.service-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.service h3 {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
}

/* =========================================================
   RUBROS
========================================================= */
.rubros-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 35px;
}
.rubros-col { display: flex; flex-direction: column; gap: 18px; }

.rubro-item {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  min-height: 68px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.22);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
  transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .7s;
  opacity: 0;
}
.rubro-item.from-left { transform: translateX(-80px); }
.rubro-item.from-right { transform: translateX(80px); }
.rubro-item.visible { transform: translateX(0); opacity: 1; }

/* =========================================================
   VIDEO
========================================================= */
#banner-video { padding: 45px 0; }
.banner-full {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid #ffffff26;
}
.banner-full video {
  width: 100%;
  height: auto;
  border-radius: 22px;
  display: block;
}

/* =========================================================
   CONTACTO
========================================================= */
#contacto { padding: 45px 0; }
.contact-box {
  background: linear-gradient(180deg, #ffffff12, #ffffff05);
  border: 1px solid #ffffff26;
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 45px 35px;
}
.form {
  display: grid;
  gap: 14px;
  max-width: 1100px;
  margin: 0 auto;
  grid-template-columns: 1fr 1fr;
}
.input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid #ffffff40;
  background: #ffffffdd;
  color: #111;
  font-size: 0.95rem;
}
textarea.input { grid-column: 1 / -1; min-height: 130px; resize: vertical; }
.btn-dark {
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  padding: 13px 22px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  grid-column: 1 / -1;
  font-size: 0.95rem;
  transition: transform .2s ease, filter .3s ease;
}
.btn-dark:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-dark:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mensajes del formulario */
.form-message {
  grid-column: 1 / -1;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  margin-top: 8px;
  display: none;
}

.form-message.success {
  display: block;
  background: #10b98144;
  color: #fff;
  border: 1px solid #10b98166;
}

.form-message.error {
  display: block;
  background: #ef444444;
  color: #fff;
  border: 1px solid #ef444466;
}

/* =========================================================
   FOOTER
========================================================= */
footer { padding: 45px 0 0; }
.fgrid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 35px;
  flex-wrap: wrap;
}
.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-left img, .footer-right img {
  height: 45px;
  width: auto;
  object-fit: contain;
  transition: opacity .3s ease;
}
.footer-left a:hover img { opacity: 0.8; }

.footer-bottom {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border-top: 1px solid rgba(255,255,255,.15);
  padding: 22px 0;
}
.footer-credits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.credits-left p, .credits-right p {
  color: rgba(255,255,255,.75);
  font-size: 0.85rem;
}
.credits-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dev-logo { height: 32px; }

/* =========================================================
   TABLET
========================================================= */
@media (max-width: 1100px) {
  :root { 
    --logo-h: 60px; 
    --margin-desktop: 3vw; 
    --header-height: 75px; 
  }
  
  header.nav-full .links a {
    font-size: 0.88rem;
    gap: 16px;
  }
  
  .cta {
    padding: 7px 16px;
    font-size: 0.85rem;
  }
}

/* =========================================================
   MÓVIL - HAMBURGUESA CORREGIDA
========================================================= */
@media (max-width: 768px) {
  :root { 
    --logo-h: 45px; 
    --margin-desktop: 4vw; 
    --header-height: 60px;
    --r-fino: 28px;
  }
  
  /* HEADER MÓVIL */
  header.nav-full {
    padding: 0 var(--margin-desktop);
    gap: 10px;
    height: var(--header-height);
  }
  
  /* Mostrar hamburguesa */
  .menu-toggle {
    display: flex;
  }
  
  /* OVERLAY AZUL SÓLIDO QUE CUBRE TODO */
  header.nav-full::before {
    content: '';
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #2d36ff;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
    pointer-events: none;
  }
  
  header.nav-full.menu-open::before {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  
  /* BLOQUEAR SCROLL CUANDO EL MENÚ ESTÁ ABIERTO */
  body.menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100vh !important;
  }
  
  /* Menú móvil - AZUL SÓLIDO 100% */
  header.nav-full .links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    background: #2d36ff;
    padding: 40px 20px;
    gap: 8px;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0.3s ease;
    box-shadow: none;
    z-index: 9999;
    overflow-y: auto;
    justify-content: flex-start;
  }
  
  header.nav-full .links.active {
    transform: translateX(0);
    visibility: visible;
  }
  
  header.nav-full .links a {
    font-size: 1.1rem;
    padding: 14px 0;
    width: 100%;
    text-align: center;
    opacity: 1;
  }
  
  .cta {
    padding: 12px 24px;
    font-size: 0.95rem;
    width: auto;
    display: inline-block;
    margin-top: 10px;
  }
  
  .lang-switch {
    gap: 6px;
    z-index: 10001;
  }
  
  .lang-btn {
    padding: 7px 11px;
    font-size: 0.8rem;
  }
  
  /* CONTENIDO */
  .hero {
    padding: 60px 0 20px;
  }
  
  .title {
    font-size: clamp(32px, 9vw, 48px);
    letter-spacing: -1px;
  }
  
  .hero-sub {
    font-size: 14px;
    line-height: 1.6;
    margin-top: 12px;
    margin-bottom: 20px;
  }
  
  h2 {
    font-size: clamp(22px, 6vw, 36px);
    margin-bottom: 14px;
  }
  
  .sub {
    font-size: 0.9rem;
    margin-bottom: 28px;
    line-height: 1.6;
  }
  
  section {
    padding: 35px 0;
  }
  
  #servicios { 
    padding-top: 40px;
  }
  
  /* SERVICIOS */
  .grid.cols-3 { 
    grid-template-columns: 1fr; 
    gap: 14px;
  }
  
  .service {
    min-height: 200px;
    padding: 25px 18px;
  }
  
  .service-icon {
    width: 65px;
    height: 65px;
    margin-bottom: 16px;
  }
  
  .service h3 {
    font-size: 1.1rem;
  }
  
  /* RUBROS */
  .rubros-cols { 
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .rubros-col {
    gap: 14px;
  }
  
  .rubro-item {
    font-size: 0.95rem;
    padding: 16px 20px;
    min-height: 56px;
  }
  
  /* VIDEO - MISMO ANCHO QUE CONTACTO */
  #banner-video {
    padding: 35px 0;
  }
  
  .banner-full {
    max-width: 100%;
    width: calc(100% - (var(--margin-desktop) * 2));
    margin: 0 auto;
  }
  
  /* CONTACTO */
  .form { 
    grid-template-columns: 1fr; 
    gap: 12px;
  }
  
  .contact-box {
    padding: 28px 20px;
  }
  
  .input {
    padding: 11px 13px;
    font-size: 16px !important;
  }
  
  textarea.input {
    min-height: 110px;
  }
  
  .btn-dark {
    padding: 11px 20px;
    font-size: 0.9rem;
  }
  
  /* FOOTER */
  .fgrid {
    flex-direction: column;
    gap: 25px;
    padding-bottom: 30px;
  }
  
  .footer-left, .footer-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
  
  .footer-left img, .footer-right img {
    height: 38px;
  }
  
  .footer-credits {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .credits-left p, .credits-right p {
    font-size: 0.8rem;
  }
  
  .credits-right {
    flex-direction: column;
    gap: 8px;
  }
  
  .dev-logo {
    height: 26px;
  }
  
  /* RIBBON */
  #ribbon-orange {
    margin: 40px 0 0;
  }
  
  #ribbon-orange .r-item {
    font-size: 10px;
  }
}

/* =========================================================
   MÓVIL PEQUEÑO
========================================================= */
@media (max-width: 480px) {
  :root { 
    --logo-h: 40px; 
    --header-height: 56px;
    --r-fino: 26px;
  }
  
  header.nav-full {
    padding: 0 var(--margin-desktop);
  }
  
  .menu-toggle span {
    width: 22px;
    height: 2px;
  }
  
  .lang-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  
  .title {
    font-size: clamp(28px, 10vw, 40px);
  }
  
  .hero-sub {
    font-size: 13px;
  }
  
  h2 {
    font-size: clamp(20px, 7vw, 32px);
  }
  
  .sub {
    font-size: 0.85rem;
  }
  
  .service h3 {
    font-size: 1rem;
  }
  
  .rubro-item {
    font-size: 0.9rem;
    padding: 14px 16px;
  }
  
  #ribbon-orange .r-item {
    font-size: 9px;
  }
}

/* =========================================================
   FIXES FINALES
========================================================= */
* {
  max-width: 100%;
}

img, video {
  max-width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

footer a {
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

footer img {
  pointer-events: none;
}

footer {
  position: relative;
  z-index: 10;
}

/* Los anclajes no quedan debajo del header fijo */
:target, section[id] { scroll-margin-top: calc(var(--header-height) + 20px); }