/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
  --bg: #0B0D12;
  --card: rgba(17, 21, 33, 0.4);
  --muted: #8993A4;
  --text: #E8ECF6;
  --brand: #D95B00;
  --brand2: #FF8C00;
  --ok: #FFA500;
  --accent: #00D4FF;
}

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

body, html {
  margin: 0;
  height: 100%;
  background: transparent;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  background: transparent;
}

.shadow {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(16, 20, 29, 0.82);
  z-index: -1;
}

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

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

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

/* ============================================
   HEADER Y NAVEGACIÓN
   ============================================ */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 13, 18, 0.5);
  /* Fallback color for browsers without backdrop-filter support */
  background-color: rgba(11, 13, 18, 0.5);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.3s ease;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.hex {
  width: 28px;
  height: 28px;
  position: relative;
}

.hex:before, 
.hex:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: conic-gradient(from 0deg, var(--brand), var(--brand2), var(--accent), var(--brand));
  mask: radial-gradient(circle at 50% 50%, transparent 45%, black 46%);
}

.menu {
  display: flex;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}

.menu a {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.3s ease;
}

.menu a:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.4);
  transform: translateY(-1px);
}

.menu-item {
  position: relative;
}

.menu-item > a {
  display: flex;
  align-items: center;
  gap: 4px;
}

.menu-item .dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.menu-item:hover .dropdown-arrow {
  transform: rotate(180deg);
}

/* ============================================
   DROPDOWN MENU (MEGAMENU)
   ============================================ */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: rgba(17, 21, 33, 0.98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 212, 255, 0.15);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.menu-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 12px 16px;
  margin: 2px 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.dropdown-menu a:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.4);
  transform: translateX(4px);
}

.dropdown-menu a::before {
  content: "→";
  margin-right: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dropdown-menu a:hover::before {
  opacity: 1;
}

/* ============================================
   BOTONES
   ============================================ */
.btn, 
.btn-secondary {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0, 212, 255, 0.2);
  border: 1px solid rgba(0, 212, 255, 0.5);
  color: var(--accent);
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 5px rgba(0, 212, 255, 0.5);
  transition: all 0.3s ease;
}

.btn-secondary:hover, 
.btn:hover {
  transform: translateY(-2px);
}

/* ============================================
   PARALLAX Y BACKGROUNDS
   ============================================ */
.parallax-bg {
  position: relative;
  background-size: cover;
  background-position: center 0;
  background-repeat: no-repeat;
}

.white-bg {
  position: relative;
  background-color: white !important;
  background-image: none !important;
  color: black;
  z-index: 1;
}

.white-bg h2 {
  color: black;
}

.white-bg .mini {
  color: black;
}

.white-bg strong {
  color: black;
  font-weight: 700;
}

.white-bg p {
  color: black;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  overflow: hidden;
  background-image: url('../img/Bckgrnd.webp');
  background-size: cover;
  background-position: center 0;
  background-repeat: no-repeat;
}

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

.hero .wrap {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
  padding: 56px 0;
}

.kicker {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 0.85rem;
}

h1 {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.1;
  margin: 10px 0 16px;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-card {
  background: radial-gradient(1200px 600px at 120% -10%, rgba(31, 109, 255, 0.15), transparent), 
              linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px;
  border-radius: 16px;
}

/* ============================================
   GRIDS Y CARDS
   ============================================ */
.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card h3 {
  margin: 16px 16px 6px;
}

.card h4 {
  margin: 0 16px 8px;
  text-align: left;
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.95rem;
}

.card p {
  margin: 0 16px 16px;
  color: var(--muted);
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  padding: 54px 0;
}

.section h2 {
  font-size: clamp(22px, 3.6vw, 34px);
  margin: 0 0 18px;
}

.tag {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: rgba(0, 212, 255, 0.2);
  border: 1px solid rgba(0, 212, 255, 0.5);
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.6rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 5px rgba(0, 212, 255, 0.5);
}

/* ============================================
   STEPS
   ============================================ */
.steps {
  counter-reset: step;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: 14px;
}

.step:before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand2), var(--brand));
}

.cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 36px 0;
  color: var(--text);
  text-shadow: 1px 1px 2px black;
  position: relative;
  background-image: url('../img/about/footer.webp');
  background-size: cover;
  background-position: center;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: -1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
  position: relative;
  z-index: 2;
}

.mini {
  font-size: 0.92rem;
  color: var(--muted);
}

footer .mini {
  color: var(--text);
}

.list {
  display: grid;
  gap: 10px;
}

.list a {
  color: var(--text);
}

.whatsapp {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #1fbf72;
  border: 1px solid rgba(31, 191, 114, 0.5);
}

/* ============================================
   HAMBURGER MENU (MOBILE)
   ============================================ */
.hamburger {
  display: none;
  width: 30px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
}

.hamburger span, 
.hamburger:after, 
.hamburger:before {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
}

.hamburger:before {
  top: 0;
}

.hamburger:after {
  bottom: 0;
}

.hamburger span {
  top: 50%;
  transform: translateY(-50%);
}

/* ============================================
   SECCIONES ESPECÍFICAS
   ============================================ */
#assessment {
  position: relative;
  background-image: url('../img/assessment/operational assessment.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#assessment::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1;
}

#assessment .container {
  position: relative;
  z-index: 2;
}

/* ============================================
   MEDIA QUERIES - RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    padding-left: 16px;
    padding-right: 16px;
  }
  
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
  
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
  
  .grid.cols-4 {
    grid-template-columns: 1fr;
  }
  
  .step:not(:last-child)::after {
    top: calc(100% + 1px);
    left: 18px;
    width: 2px;
    height: 16px;
    background: linear-gradient(180deg, var(--brand), var(--accent), var(--brand));
    background-size: 400% 400%;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
  
  .menu.active {
    display: flex;
  }
  
  .hamburger {
    display: block;
  }
}

/* ============================================
   UTILIDADES
   ============================================ */
.logo-img {
  height: 60px;
}

.mt-16 {
  margin-top: 16px;
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.linkedin-link {
  background: #1f6dff;
  border-color: rgba(31, 109, 255, 0.5);
}

.mt-22 {
  margin-top: 22px;
}

.social-icon {
  width: 16px;
  height: 16px;
}

h1, h2, h3 {
  font-family: Orbitron, sans-serif;
}

h3.mt-16 {
  text-align: left;
  font-style: normal;
  font-size: 1.5rem;
  color: var(--text);
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(100% + 1px);
  width: 16px;
  height: 2px;
  background: linear-gradient(270deg, var(--brand), var(--accent), var(--brand));
  background-size: 400% 400%;
  animation: flow_animation 3s linear infinite;
}

@keyframes flow_animation {
  0% {
    background-position: 0 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.hover-effect {
  transition: all 0.3s ease;
}

#servicios h2, 
#servicios h3, 
#servicios p {
  color: black;
}

#como-lo-hacemos, 
#servicios {
  background-color: white;
}

.hover-effect:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4), 0 0 12px rgba(0, 212, 255, 0.25);
}

#go-up-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--brand);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  text-decoration: none;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

#go-up-btn.show {
  opacity: 1;
  visibility: visible;
}

.lang-switch {
  font-weight: 600;
  font-size: 0.8rem;
}

.lang-switch a {
  color: var(--text);
  opacity: 0.9;
  padding: 2px 4px;
}

.lang-switch a.active {
  color: var(--brand2);
  font-weight: 800;
  text-decoration: underline;
  padding: 2px 6px;
  border-radius: 6px;
}

/* ============================================
   SECCIONES DE SERVICIOS
   ============================================ */
#opt-procesos {
  position: relative;
  background-image: url('../img/services/Serv 1 optimizacion de procesos.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#opt-procesos::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1;
}

#opt-procesos .container {
  position: relative;
  z-index: 2;
}

#opt-informacion {
  position: relative;
  background-image: url('../img/services/serv 2 flujo de informacion.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#opt-informacion::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1;
}

#opt-informacion .container {
  position: relative;
  z-index: 2;
}

#opt-gemelos {
  position: relative;
  background-image: url('../img/services/serv 3 digital twin.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#opt-gemelos::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1;
}

#opt-gemelos .container {
  position: relative;
  z-index: 2;
}

.card-cta {
  text-align: center;
  margin-top: auto;
  padding: 16px;
}

.card-cta .btn {
  display: inline-block;
  width: auto;
}

#erp {
  background-color: white;
}

#erp .tag, 
#erp h2, 
#erp h3, 
#erp p {
  color: black;
}

#erp .card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

#servicios .card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
}

#erp .btn, 
#servicios .btn {
  color: black;
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
  text-shadow: none;
}

#erp .tag, 
#servicios .tag {
  color: black;
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
  text-shadow: none;
}

/* ============================================
   CAROUSEL PLAB
   ============================================ */
.plab {
  overflow: hidden;
}

.plab .container h1, 
.plab .container h2 {
  color: var(--text);
}

#como-lo-hacemos .container h1, 
#como-lo-hacemos .container h2 {
  color: black;
}

.plab__carousel {
  position: relative;
  width: 100%;
  /* Taller carousel so card background images have more vertical room.
    Keep some margin-top to preserve section spacing. */
  height: 640px;
  margin-top: 32px;
  min-height: 480px;
}

.plab__track {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  perspective: 1500px;
}

.plab__card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  /* Less wide on desktop, taller overall because container height increased. */
  width: 42%;
  height: 100%;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease, filter 0.5s ease, opacity 0.5s ease;
  cursor: pointer;
  filter: saturate(0.2) contrast(0.9) brightness(0.85);
}

.plab__card[data-pos="0"] {
  transform: scale(1) translateZ(50px);
  z-index: 5;
  filter: none;
}

.plab__card[data-pos="1"] {
  transform: translateX(45%) rotateY(-20deg) scale(0.75) translateZ(-50px);
  z-index: 4;
}

.plab__card[data-pos="2"] {
  transform: translateX(85%) rotateY(-30deg) scale(0.6) translateZ(-100px);
  z-index: 3;
  filter: brightness(0.7);
}

.plab__card[data-pos="-1"] {
  transform: translateX(-45%) rotateY(20deg) scale(0.75) translateZ(-50px);
  z-index: 4;
}

.plab__card[data-pos="-2"] {
  transform: translateX(-85%) rotateY(30deg) scale(0.6) translateZ(-100px);
  z-index: 3;
  filter: brightness(0.7);
}

.plab__card[data-pos="-3"], 
.plab__card[data-pos="3"] {
  opacity: 0;
  pointer-events: none;
}

.plab__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  border-radius: 0 0 16px 16px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.plab__card[data-active=true] .plab__overlay {
  opacity: 1;
}

.plab__overlay h3 {
  margin: 0 0 8px;
  color: white;
  font-family: Orbitron, sans-serif;
}

.plab__overlay p {
  margin: 0 0 16px;
  color: white;
}

.plab__cta {
  display: none;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0, 212, 255, 0.2);
  border: 1px solid rgba(0, 212, 255, 0.5);
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.plab__card[data-active=true] .plab__cta {
  display: inline-block;
}

.plab__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: var(--brand2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
}

.plab__nav--prev {
  left: 20px;
}

.plab__nav--next {
  right: 20px;
}

/* Responsive adjustments for the plab carousel so images keep their visual area
   without overlapping adjacent sections. Tweak heights per breakpoint. */
@media (max-width: 1024px) {
  .plab__carousel {
    height: 460px;
  }
}

@media (max-width: 768px) {
  .plab__carousel {
    height: 420px;
  }
  .plab__card {
    width: 75%; /* use more width on smaller screens */
  }
}

@media (max-width: 480px) {
  .plab__carousel {
    height: 360px; /* allow tighter height on small phones */
  }
  .plab__card {
    width: 90%;
    border-radius: 12px;
  }
}

/* ============================================
   ABOUT SECTION
   ============================================ */
#about {
  position: relative;
  background-image: url('../img/about/footer.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#about::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  z-index: 1;
}

#about .container {
  position: relative;
  z-index: 2;
}

#about h2, 
#about p {
  color: black;
}

#about .btn {
  color: black;
}

/* ============================================
   METRICS
   ============================================ */
.metric-number {
  font-family: Orbitron, sans-serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--brand2);
  margin: 0 0 1rem 0;
  text-align: center;
}

.metric-label {
  font-size: 1.1rem;
  color: white;
  text-align: center;
  line-height: 1.4;
  margin: 0;
}

.section .card:has(.metric-number) {
  background: linear-gradient(135deg, #1a1d2e 0, #0f1219 100%);
  border: 2px solid var(--brand2);
  padding: 2.5rem 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.section .card:has(.metric-number):hover {
  background: linear-gradient(135deg, #0f1219 0, #1a1d2e 100%);
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 140, 0, 0.4);
}
