/* ============================
   VARIABLES & RESET
   ============================ */
:root {
  /* === PALETA DANPER ===
     Rojo (logo) = acento principal · Gris (logo) = acento secundario
     Charcoal = secciones oscuras y titulares · Grises claros = fondos */
  --color-primary: #C0392B;        /* rojo del logo */
  --color-primary-dark: #A93226;   /* rojo hover */
  --color-dark: #2d2d2d;           /* charcoal: fondos oscuros y titulares */
  --color-dark-2: #444444;         /* charcoal medio */
  --color-steel: #6e6e6e;          /* gris del logo (acento secundario) */
  --color-gray: #6b6b6b;           /* texto secundario */
  --color-gray-light: #f5f5f4;     /* fondo claro 1 */
  --color-white: #ffffff;          /* fondo claro 2 */

  /* === TOKENS DE TEMA (claro por defecto) ===
     Estos cambian en modo oscuro. Usar SIEMPRE estos para fondos/textos
     de secciones y tarjetas, no los literales de arriba. */
  --bg-page: #ffffff;              /* fondo de secciones claras */
  --bg-alt: #f5f5f4;               /* fondo de secciones alternas */
  --bg-card: #ffffff;              /* fondo de tarjetas y formulario */
  --text: #2d2d2d;                 /* texto principal y titulares */
  --text-soft: #6b6b6b;            /* texto secundario */
  --border: #e5e7eb;               /* bordes (inputs, filtros) */

  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
  --radius: 12px;
  --transition: 0.3s ease;
  --container: 1200px;
}

/* === MODO OSCURO: redefine los tokens de tema y el charcoal de fondo === */
[data-theme="dark"] {
  --bg-page: #14171a;
  --bg-alt: #1a1e22;
  --bg-card: #20252b;
  --text: #e8eaed;
  --text-soft: #aab0b7;
  --border: rgba(255,255,255,0.12);
  --color-dark: #0d0f12;           /* secciones oscuras aún más profundas */
  --shadow: 0 4px 24px rgba(0,0,0,0.45);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-page);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ============================
   UTILITIES
   ============================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  transition: all var(--transition);
  cursor: pointer;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  border: 2px solid var(--color-primary);
}
.btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232,150,30,0.4);
}

.btn--outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-white);
}
.btn--outline:hover {
  background: var(--color-white);
  color: var(--color-dark);
  transform: translateY(-2px);
}

.btn--full { width: 100%; }

.section-tag {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 900;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-soft);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

/* ============================
   NAVBAR
   ============================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: all var(--transition);
}

.navbar.scrolled {
  background: var(--color-dark);
  padding: 12px 0;
  box-shadow: var(--shadow-lg);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.navbar__logo {
  display: flex;
  align-items: center;
}

.navbar__logo img {
  height: 60px;
  width: auto;
}

.logo-fallback {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--color-white);
  letter-spacing: 2px;
}

.logo-fallback span {
  color: var(--color-primary);
}

.navbar__links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.navbar__links a {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  position: relative;
  transition: color var(--transition);
}

.navbar__links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition);
}

.navbar__links a:hover { color: var(--color-primary); }
.navbar__links a:hover::after { width: 100%; }

.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.navbar__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  transition: all var(--transition);
}

/* ============================
   HERO
   ============================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: url('../img/banner.jpg') center/cover no-repeat;
  background-color: var(--color-dark);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20,20,20,0.92) 0%, rgba(20,20,20,0.75) 45%, rgba(20,20,20,0.45) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero__tag {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s 0.3s forwards;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--color-white);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
}

.hero__title span { color: var(--color-primary); }

.hero__subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 36px;
  max-width: 500px;
  opacity: 0;
  animation: fadeUp 0.8s 0.7s forwards;
}

.hero__buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 0.9s forwards;
}

.hero__scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.hero__scroll-indicator span {
  display: block;
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 12px;
  position: relative;
}

.hero__scroll-indicator span::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--color-white);
  border-radius: 2px;
  animation: scrollDown 1.5s infinite;
}

/* ============================
   STATS
   ============================ */
.stats {
  background: var(--color-primary);
  padding: 48px 0;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item__number {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  color: var(--color-white);
  line-height: 1;
}

.stat-item__plus {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-white);
}

.stat-item p {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  margin-top: 6px;
  font-weight: 600;
}

/* ============================
   NOSOTROS
   ============================ */
.nosotros {
  padding: 100px 0;
  background: var(--bg-page);
}

.nosotros__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}

.nosotros__image {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.nosotros__image img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  border-radius: var(--radius);
}

.nosotros__image.img-placeholder {
  background: linear-gradient(135deg, #2d2d2d, #444);
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nosotros__badge {
  position: absolute;
  bottom: 24px;
  right: -24px;
  background: var(--color-steel);
  color: var(--color-white);
  padding: 20px 28px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.nosotros__badge strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.nosotros__badge span {
  font-size: 0.8rem;
  opacity: 0.9;
}

.nosotros__text p {
  color: var(--text-soft);
  margin-bottom: 16px;
}

.nosotros__valores {
  margin: 24px 0 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nosotros__valores li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.check {
  color: var(--color-primary);
  font-size: 1rem;
}

/* ============================
   SERVICIOS
   ============================ */
.servicios {
  padding: 100px 0;
  background: var(--bg-alt);
}

.servicios__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.servicio-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  overflow: hidden;
}

.servicio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.servicio-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.servicio-card:hover::before { transform: scaleX(1); }

.servicio-card__icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(192,57,43,0.08);
  color: var(--color-primary);
  margin-bottom: 24px;
  transition: all var(--transition);
}

.servicio-card__icon svg {
  width: 32px;
  height: 32px;
}

.servicio-card:hover .servicio-card__icon {
  background: var(--color-primary);
  color: var(--color-white);
  transform: rotate(-6deg);
}

.servicio-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.servicio-card p {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 18px;
}

.servicio-card__link {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.3px;
  opacity: 0;
  transform: translateX(-8px);
  transition: all var(--transition);
  display: inline-block;
}

.servicio-card:hover .servicio-card__link {
  opacity: 1;
  transform: translateX(0);
}

/* Tarjeta CTA destacada */
.servicio-card--cta {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--color-white);
}

.servicio-card--cta::before { display: none; }
.servicio-card--cta h3 { color: var(--color-white); }
.servicio-card--cta p { color: rgba(255,255,255,0.85); }
.servicio-card--cta .servicio-card__link {
  color: var(--color-white);
  opacity: 1;
  transform: none;
}
.servicio-card--cta:hover { transform: translateY(-8px); }

/* ============================
   PROYECTOS
   ============================ */
.proyectos {
  padding: 100px 0;
  background: var(--bg-page);
}

.proyectos__filtros {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filtro-btn {
  padding: 10px 24px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  border: 2px solid var(--border);
  color: var(--text-soft);
  transition: all var(--transition);
  background: var(--bg-card);
}

.filtro-btn:hover,
.filtro-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.proyectos__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.proyecto-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  background: linear-gradient(135deg, #3a3a3a, #555);
}

.proyecto-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.proyecto-card:hover img { transform: scale(1.08); }

.proyecto-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,26,0.92) 0%, transparent 60%);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--transition);
}

.proyecto-card:hover .proyecto-card__overlay { opacity: 1; }

.proyecto-card__tag {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.proyecto-card__overlay h3 {
  font-family: var(--font-heading);
  color: var(--color-white);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.proyecto-card__overlay p {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
}

.proyecto-card.hidden {
  display: none;
}

/* ============================
   LIGHTBOX
   ============================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15,15,15,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox__img {
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform var(--transition);
}

.lightbox.open .lightbox__img { transform: scale(1); }

.lightbox__caption {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 600;
  margin-top: 16px;
  font-size: 0.95rem;
  text-align: center;
}

.lightbox__close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: var(--color-white);
  font-size: 2.6rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
}

.lightbox__close:hover { background: rgba(255,255,255,0.15); }

/* indicador de ampliar en las tarjetas de proyecto */
.proyecto-card__overlay::after {
  content: '🔍 Ver completa';
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255,255,255,0.9);
  color: var(--color-dark);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 50px;
}

/* ============================
   TESTIMONIOS
   ============================ */
.testimonios {
  padding: 100px 0;
  background: var(--color-dark);
}

.testimonios .section-tag { color: var(--color-primary); }
.testimonios .section-title { color: var(--color-white); }

.testimonios__slider {
  max-width: 720px;
  margin: 0 auto 32px;
  position: relative;
}

.testimonio {
  display: none;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.testimonio.active { display: block; }

.testimonio p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.8;
  font-style: italic;
  margin-bottom: 32px;
}

.testimonio__autor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.testimonio__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-white);
  font-size: 0.95rem;
}

.testimonio__autor strong {
  display: block;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 700;
}

.testimonio__autor span {
  color: var(--text-soft);
  font-size: 0.85rem;
}

.testimonios__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: all var(--transition);
}

.dot.active {
  background: var(--color-primary);
  width: 28px;
  border-radius: 5px;
}

/* ============================
   CONTACTO
   ============================ */
.contacto {
  padding: 100px 0;
  background: var(--bg-alt);
}

.contacto__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}

.contacto__info p {
  color: var(--text-soft);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.contacto__datos {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contacto__datos li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
  color: var(--text);
}

.contacto__icon { font-size: 1.2rem; }

.contacto__form {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color var(--transition);
  background: var(--bg-card);
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-soft); }
.form-group select:invalid { color: var(--text-soft); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-feedback {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 20px;
}

.form-feedback.success { color: #16a34a; }
.form-feedback.error { color: #dc2626; }

/* ============================
   FOOTER
   ============================ */
.footer {
  background: var(--color-dark);
  padding: 64px 0 0;
}

.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer__logo {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--color-white);
  letter-spacing: 2px;
  display: block;
  margin-bottom: 12px;
}

.footer__brand p {
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  line-height: 1.7;
}

.footer__links h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 16px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer__links a {
  display: block;
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  margin-bottom: 10px;
  transition: color var(--transition);
}

.footer__links a:hover { color: var(--color-primary); }

.footer__social h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 16px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.social-icons { display: flex; gap: 12px; }

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.8rem;
  transition: all var(--transition);
}

.social-icon:hover {
  background: var(--color-primary);
  transform: translateY(-2px);
}

.footer__bottom {
  padding: 20px 0;
  text-align: center;
}

.footer__bottom p {
  color: rgba(255,255,255,0.35);
  font-size: 0.85rem;
}

/* ============================
   SCROLL TOP BUTTON
   ============================ */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: all;
}

.scroll-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-3px);
}

/* ============================
   HERO BADGES
   ============================ */
.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
  opacity: 0;
  animation: fadeUp 0.8s 1.1s forwards;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  color: var(--color-white);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
}

.hero__badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.7rem;
}

/* ============================
   PROYECTO DESTACADO (VIDEOS)
   ============================ */
.destacado {
  padding: 100px 0;
  background: var(--color-dark);
}

.destacado .section-tag { color: var(--color-primary); }
.destacado .section-title { color: var(--color-white); }
.destacado .section-subtitle { color: rgba(255,255,255,0.7); }

.destacado__videos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
}

.destacado__video {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  border-radius: var(--radius);
  background: #000;
  box-shadow: var(--shadow-lg);
}

/* ============================
   ANTES / DESPUÉS (COMPARADOR)
   ============================ */
.antes-despues {
  padding: 100px 0;
  background: var(--bg-alt);
}

.comparador {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  user-select: none;
}

.comparador__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comparador__despues-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  overflow: hidden;
  /* Se recorta con clip-path; JS controla el porcentaje visible */
  clip-path: inset(0 50% 0 0);
}

.comparador__despues-wrap .comparador__img {
  width: 100%;
  max-width: none;
}

.comparador__label {
  position: absolute;
  top: 16px;
  z-index: 4;
  background: rgba(26,26,26,0.7);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 6px;
}

.comparador__label--antes { right: 16px; }
.comparador__label--despues { left: 16px; background: var(--color-primary); }

.comparador__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: var(--color-white);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comparador__handle::before {
  content: '';
  position: absolute;
  width: 48px;
  height: 48px;
  background: var(--color-white);
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.comparador__arrow {
  position: relative;
  z-index: 1;
  color: var(--color-primary);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.comparador__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 5;
}

/* ============================
   PROCESO
   ============================ */
.proceso {
  padding: 100px 0;
  background: var(--bg-page);
}

.proceso__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.proceso-paso {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow);
  position: relative;
  transition: all var(--transition);
  border-top: 3px solid var(--color-primary);
}

.proceso-paso:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.proceso-paso__num {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--color-primary);
  opacity: 0.25;
  display: block;
  margin-bottom: 8px;
}

.proceso-paso h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.proceso-paso p {
  color: var(--text-soft);
  font-size: 0.92rem;
}

/* ============================
   WHATSAPP FLOAT
   ============================ */
.whatsapp-float {
  position: fixed;
  bottom: 32px;
  left: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px 12px 14px;
  border-radius: 50px;
  background: #25D366;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transition: transform var(--transition);
  animation: pulseWa 2.5s infinite;
}

.whatsapp-float svg { flex-shrink: 0; }

.whatsapp-float:hover { transform: scale(1.05); }

@keyframes pulseWa {
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); }
  70%  { box-shadow: 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* ============================
   INTERRUPTOR TEMA (SOL / LUNA)
   ============================ */
.theme-toggle {
  background: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  /* Centrado absoluto en el nav, independientemente del logo y el menú */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.theme-toggle__track {
  position: relative;
  width: 58px;
  height: 30px;
  border-radius: 50px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  transition: background var(--transition), border-color var(--transition);
}

.theme-toggle__icon {
  width: 15px;
  height: 15px;
  z-index: 1;
  transition: opacity var(--transition);
}

.theme-toggle__sun  { color: #ffd24a; }
.theme-toggle__moon { color: #c7d0ff; }

.theme-toggle__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: transform var(--transition);
}

/* En modo oscuro la perilla se desliza a la derecha (a la luna) */
[data-theme="dark"] .theme-toggle__knob { transform: translateX(28px); }

/* Atenúa el icono que queda "tapado" por la perilla */
[data-theme="dark"] .theme-toggle__sun  { opacity: 0.45; }
.theme-toggle__moon { opacity: 0.45; }
[data-theme="dark"] .theme-toggle__moon { opacity: 1; }
.theme-toggle__sun { opacity: 1; }

/* Transición suave de fondos al cambiar de tema */
.nosotros, .servicios, .proyectos, .proceso, .antes-despues, .contacto,
.servicio-card, .proceso-paso, .contacto__form, .filtro-btn,
.form-group input, .form-group select, .form-group textarea {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ============================
   ANIMATIONS
   ============================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scrollDown {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(14px); }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1024px) {
  .nosotros__inner { gap: 40px; }
  .nosotros__badge { right: 0; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .navbar__links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-dark);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    z-index: 999;
  }
  .navbar__links.open { display: flex; }
  .navbar__links a { font-size: 1.3rem; }
  .navbar__hamburger { display: flex; z-index: 1000; }

  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }

  .nosotros__inner { grid-template-columns: 1fr; }
  .nosotros__image img { height: 320px; }

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

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

  .contacto__inner { grid-template-columns: 1fr; gap: 40px; }

  .footer__inner { grid-template-columns: 1fr; gap: 32px; }

  .hero__buttons { flex-direction: column; align-items: flex-start; }

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

  .whatsapp-float {
    width: 54px;
    height: 54px;
    padding: 0;
    justify-content: center;
    bottom: 24px;
    left: 24px;
  }
  .whatsapp-float__text { display: none; }
  .scroll-top { bottom: 24px; right: 24px; }
}

@media (max-width: 480px) {
  .servicios__grid { grid-template-columns: 1fr; }
  .proyectos__grid { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .nosotros__valores { grid-template-columns: 1fr; }
  .contacto__form { padding: 24px; }
  .proceso__grid { grid-template-columns: 1fr; }
  .destacado__videos { grid-template-columns: 1fr; max-width: 360px; }
}
