:root {
  --bg-black: #000000;
  --bg-navy: #0E1121;
  --accent: #724BFF;
  --text-90: #E6E6E7;
  --text-70: #B5B5B8;
  --transition: 0.3s ease;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --border-radius: 8px;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-navy);
  color: var(--text-90);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--text-90);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

ul {
  list-style: none;
}

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

button {
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--transition);
}

button:focus, a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

section {
  padding: 6rem 1rem;
  text-align: center;
}

h1, h2, h3 {
  font-weight: 800;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 3rem;
  text-align: center;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.5rem;
}

/* Utility Classes */
.gradient {
  background: linear-gradient(90deg, var(--accent), #9747FF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent), #9747FF);
  color: white;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  border: none;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(114, 75, 255, 0.4);
}

.btn-outline {
  color: var(--text-90);
  border: 1px solid var(--text-70);
  background: transparent;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  font-weight: 600;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  color: var(--text-90);
  background: transparent;
  padding: 12px 24px;
  font-weight: 600;
  position: relative;
}

.btn-ghost::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, var(--accent), #9747FF);
  transition: width var(--transition);
}

.btn-ghost:hover::after {
  width: 100%;
}

/* HEADER */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
}

.topbar.scrolled {
  background: rgba(0, 0, 0, .8);
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
}

#burger {
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
}

/* OVERLAY */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 17, 33, .95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transform: translateX(100%);
  transition: .4s ease;
  z-index: 100;
  max-width: 90vw;
  right: 0;
  left: auto;
}

.overlay.open {
  transform: translateX(0);
}

.overlay .close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: 0;
}

.overlay ul {
  list-style: none;
  text-align: center;
  font-size: 1.5rem;
  gap: 2rem;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.overlay a {
  color: #fff;
  text-decoration: none;
}

.overlay .social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.overlay .social a {
  font-size: 1.2rem;
  margin: 0 .4rem;
}

/* HERO */
.hero {
  height: 100vh;
  width: 100%;
  color: #fff;
}

.hero .swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
}

.hero .swiper-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 0 1rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.grad {
  background: linear-gradient(90deg, #06b6d4 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .sub {
  font-size: 1.125rem;
  margin-bottom: 2.5rem;
  color: var(--text-90);
}

.swiper-pagination-bullet {
  background: #fff;
  opacity: .6;
}

.swiper-pagination-bullet-active {
  background: var(--accent);
  opacity: 1;
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-70);
  margin-left: auto;
  margin-right: 1.5rem;
}

.lang-toggle button {
  color: var(--text-70);
  font-size: 0.875rem;
  padding: 0.25rem;
}

.lang-toggle button.active {
  color: var(--text-90);
  font-weight: 600;
}

/* Hide heading visually but keep for accessibility */
.visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* FULL-WIDTH section (kill side padding from parent) */
.services.full {
  padding: 0;
}

/* Services Section - NEW MOSAIC STYLES */
#services {
  background: var(--bg-navy);
}

/* Gapless grid */
.mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 320px);
  gap: 0;
}

.mosaic .card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 0;
  background: var(--bg-black);
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: flex-end;
}

/* Imagen de fondo cubre y se adapta a la altura */
.mosaic .card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--img) center/cover no-repeat;
  transition: transform .5s ease;
  transform: scale(1.05);
  z-index: 0;
}

.mosaic .card:hover::before {
  transform: scale(1.05) translateX(-15px);
}

.mosaic .label {
  position: relative;
  z-index: 1;
  margin: 0 0 2rem 0;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  font-weight: 600;
  font-size: .9rem;
  color: #fff;
  letter-spacing: .3px;
  text-shadow: 0 0 4px #000;
}

/* Layout específico por fila y columna */
.mosaic .card-1 { grid-row: 1; grid-column: 1 / 2; }
.mosaic .card-2 { grid-row: 1; grid-column: 2 / 4; }
.mosaic .card-3 { grid-row: 2; grid-column: 1 / 3; }
.mosaic .card-4 { grid-row: 2; grid-column: 3 / 4; }
.mosaic .card-5 { grid-row: 3; grid-column: 1 / 2; }
.mosaic .card-6 { grid-row: 3; grid-column: 2 / 4; }

/* Ajuste para la fila 2: card-3 ocupa 2/3, card-4 ocupa 1/3 */
@media (min-width: 800px) {
  .mosaic {
    grid-template-columns: 1fr 2fr;
    grid-template-rows: repeat(3, 320px);
  }
  .mosaic .card-1 { grid-row: 1; grid-column: 1; }
  .mosaic .card-2 { grid-row: 1; grid-column: 2; }
  .mosaic .card-3 { grid-row: 2; grid-column: 1 / span 2; }
  .mosaic .card-4 { 
    grid-row: 2; 
    grid-column: 2; 
    z-index: 2;
    /* Para que card-4 esté encima de card-3 en la intersección */
    margin-left: auto;
    width: 100%;
    max-width: unset;
  }
  .mosaic .card-5 { grid-row: 3; grid-column: 1; }
  .mosaic .card-6 { grid-row: 3; grid-column: 2; }
  /* Ajuste visual: card-3 ocupa 2/3, card-4 encima en el último tercio */
  .mosaic .card-3 {
    grid-column: 1 / 2;
    /* Ocupa dos tercios usando grid-area y grid-template-columns override */
  }
  .mosaic .card-4 {
    grid-column: 2 / 3;
  }
  .mosaic {
    grid-template-columns: 2fr 1fr;
  }
}

/* SOLO la segunda fila: cambia a 2fr 1fr */
@media (min-width: 800px) {
  .mosaic {
    grid-template-columns: 1fr 2fr;
    grid-template-rows: repeat(3, 320px);
  }
  /* Primera fila: 1fr 2fr */
  .mosaic .card-1 { grid-row: 1; grid-column: 1; }
  .mosaic .card-2 { grid-row: 1; grid-column: 2; }
  /* Segunda fila: 2fr 1fr */
  .mosaic .card-3 { grid-row: 2; grid-column: 1; }
  .mosaic .card-4 { grid-row: 2; grid-column: 2; }
  .mosaic .card-5 { grid-row: 3; grid-column: 1; }
  .mosaic .card-6 { grid-row: 3; grid-column: 2; }
  /* Cambia SOLO la segunda fila a 2fr 1fr */
  .mosaic .card-3, .mosaic .card-4 {
    grid-row: 2;
  }
  .mosaic .card-3 {
    grid-column: 1 / 2;
  }
  .mosaic .card-4 {
    grid-column: 2 / 3;
  }
  /* Hack: cambia el ancho de columnas solo en la segunda fila usando grid-template-areas */
  .mosaic {
    grid-template-areas:
      "card-1 card-2"
      "card-3 card-4"
      "card-5 card-6";
    grid-template-columns: 1fr 2fr;
  }
  .mosaic .card-1 { grid-area: card-1; }
  .mosaic .card-2 { grid-area: card-2; }
  .mosaic .card-3 { grid-area: card-3; }
  .mosaic .card-4 { grid-area: card-4; }
  .mosaic .card-5 { grid-area: card-5; }
  .mosaic .card-6 { grid-area: card-6; }
  /* Segunda fila: override columnas solo para esa fila */
  .mosaic .card-3, .mosaic .card-4 {
    grid-row: 2;
  }
  .mosaic .card-3 {
    grid-column: 1 / 2;
  }
  .mosaic .card-4 {
    grid-column: 2 / 3;
  }
  /* Cambia el grid-template-columns solo para la segunda fila */
  .mosaic .card-3,
  .mosaic .card-4 {
    /* Segunda fila: primer servicio ocupa 2fr, segundo 1fr */
    /* Usamos un contenedor interno para la segunda fila */
  }
  /* Usar grid-template-columns: 2fr 1fr solo en la segunda fila */
  .mosaic .card-3 {
    grid-column: 1 / 2;
  }
  .mosaic .card-4 {
    grid-column: 2 / 3;
  }
  .mosaic .card-3,
  .mosaic .card-4 {
    /* Para la segunda fila, cambia el ancho de columnas */
    /* No es posible cambiar grid-template-columns solo para una fila en CSS puro,
       pero puedes simularlo invirtiendo el orden de las columnas y usando grid-area. */
  }
  /* Solución efectiva: cambia el orden de las columnas en la segunda fila */
  .mosaic {
    grid-template-areas:
      "card-1 card-2"
      "card-3 card-4"
      "card-5 card-6";
    grid-template-columns: 2fr 1fr;
  }
  .mosaic .card-1 { grid-area: card-1; }
  .mosaic .card-2 { grid-area: card-2; }
  .mosaic .card-3 { grid-area: card-3; }
  .mosaic .card-4 { grid-area: card-4; }
  .mosaic .card-5 { grid-area: card-5; }
  .mosaic .card-6 { grid-area: card-6; }
}

/* Responsive: stack en una columna */
@media (max-width: 900px) {
  .mosaic {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, 220px);
  }
  .mosaic .card {
    grid-column: 1 !important;
    grid-row: auto !important;
    height: 220px;
  }
  .mosaic .card-4 { display: flex; }
}

/* Lightbox dialog */
#svcBox {
  width: 90%;
  max-width: 1200px;
  height: 50%;
  max-height: 400px;
  margin: auto;
  inset: 0;                   /* center horizontally & vertically */
  border: none;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  background: #111;
  color: #fff;
}

#svcBox::backdrop {
  background: rgba(0, 0, 0, .85);
}

.box-inner {
  display: flex;
}

.box-inner img {
  width: 60%;
  min-height: 100%;
  object-fit: cover;
}

.box-inner .text {
  padding: 2rem;
}

#svcBox h3 {
  margin-bottom: 1rem;
  font-weight: 700;
  font-size: 1.5rem;
}

#svcBox p {
  line-height: 1.6;
  color: var(--text-90);
}

#svcBox .close {
  position: absolute;
  top: .8rem;
  right: 1rem;
  background: none;
  border: 0;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  z-index: 10;
}

/* Align nav arrows vertically center of box */
#svcBox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1;
  font-size: 2.6rem;
  color: #fff;
  cursor: pointer;
  opacity: .6;
  z-index: 10;
}

#svcBox .prev {
  left: .4rem;
}

#svcBox .next {
  right: .4rem;
}

#svcBox .nav:hover {
  opacity: 1;
}

@media(max-width:600px) {
  .box-inner {
    flex-direction: column;
  }
  .box-inner img {
    width: 100%;
    height: 220px;
  }
}

/* Services Section */
.services {
  background-color: var(--bg-black);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(384px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.service-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(114, 75, 255, 0.3);
}

.service-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00C2FF, #9747FF);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.service-icon span {
  font-size: 24px;
}

.service-card h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.service-card p {
  color: var(--text-70);
  margin-bottom: 0;
}

/* How it Works Section - Timeline */
.how {
  padding: 6rem 1rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, 
    rgba(114, 75, 255, 0.1), 
    rgba(114, 75, 255, 0.5), 
    rgba(114, 75, 255, 0.1));
  transform: translateX(-50%);
  z-index: 0;
}

.timeline-step {
  display: flex;
  margin-bottom: 3rem;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-step.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.step-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), #9747FF);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.step-content {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  width: 45%;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.timeline-step:nth-child(odd) .step-content {
  margin-left: auto;
}

.step-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.step-content h3 {
  margin-bottom: 0.5rem;
}

.step-content p {
  color: var(--text-70);
  margin-bottom: 0;
}

/* FAQ Section */
.faq {
  background-color: var(--bg-black);
  text-align: center;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

details {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 0;
}

summary {
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  padding-right: 2rem;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-75%) rotate(45deg);
  transition: transform var(--transition);
}

details[open] summary::after {
  transform: translateY(-25%) rotate(-135deg);
}

.faq-answer {
  margin-top: 1rem;
  color: var(--text-70);
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

/* Footer */
footer {
  background-color: var(--bg-black);
  padding: 3rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer-container {
  display: flex;
  justify-content: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

footer .social-links {
  margin-top: 1rem;
  justify-content: center;
}

/* Modal */
.modal {
  border: none;
  border-radius: var(--border-radius);
  padding: 0;
  max-width: 500px;
  width: 90%;
  background-color: var(--bg-navy);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  padding: 2rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--text-70);
  background: none;
  border: none;
  cursor: pointer;
}

.modal h2 {
  text-align: left;
  margin-bottom: 1.5rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

input, textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-90);
  font-family: 'Inter', sans-serif;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.radio-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }
  
  .timeline-step {
    flex-direction: column;
  }
  
  .step-number {
    left: 20px;
    transform: none;
  }
  
  .step-content {
    width: 100%;
    margin-left: 40px !important;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  section {
    padding: 4rem 1rem;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Sección a full-width sin padding */
#services.full-width {
  padding: 0;
  margin: 0;
}

/* GRID 3 columnas sin gap */
#services .mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 col iguales */
  grid-auto-rows: minmax(22vw, 1fr);    /* altura proporcional desktop */
  gap: 0;
}

/* Span de cada tarjeta según clase */
.img-box.narrow {
  grid-column: span 1;
}
.img-box.wide {
  grid-column: span 2;
}

@media (max-width: 800px) { /* móvil / tablet */
  #services .mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(46vw, 1fr);
  }
  .img-box.narrow, .img-box.wide {
    grid-column: span 2; /* ancho completo */
  }
}

/* Tarjeta y hover (sin tocar contenido) */
.img-box {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.img-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--img) center/cover no-repeat;
  transition: transform .4s ease;
}
.img-box:hover::before {
  transform: scale(1.05) translateX(-14px);
}

.svc-label {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  text-shadow: 0 0 4px #000;
}

/* Título oculto (si existe) */
.visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Modal centrado y tamaño fijo */
dialog.svc-modal {
  width: 90%;
  max-width: 900px;
  inset: 0;
  margin: auto;
  border: none;
  border-radius: 10px;
  padding: 0;
  background: #111;
  color: #fff;
  overflow: hidden;
}
dialog::backdrop {
  background: rgba(0, 0, 0, .85);
}
.svc-modal .box-inner {
  display: flex;
}
.svc-modal img {
  width: 50%;
  object-fit: cover;
}
.svc-modal .text {
  width: 50%;
  padding: 2rem;
}
@media (max-width: 600px) {
  .svc-modal .box-inner {
    flex-direction: column;
  }
  .svc-modal img {
    width: 100%;
    height: 220px;
  }
  .svc-modal .text {
    width: 100%;
  }
}
.svc-modal .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.6rem;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
}
.svc-modal .prev {
  left: .6rem;
}
.svc-modal .next {
  right: .6rem;
}
.svc-modal .close {
  position: absolute;
  top: .8rem;
  right: 1rem;
  font-size: 2rem;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
}
