:root {
  --navy: #0b1f3a;
  --navy-soft: #163154;
  --gold: #c9a227;
  --gold-dark: #b08d1c;
  --ink: #1d2a3a;
  --muted: #4a5868;
  --paper: #f7f5f2;
  --card: #ffffff;
  --contact-bg: #ece7df;
  --shadow: 0 18px 50px rgba(11, 31, 58, 0.12);
  --radius: 28px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--navy);
  text-align: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid #ececec;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 28px;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
}

/* ── Slot de logo: placeholder con cuadrícula punteada ── */
.logo-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(135deg, #d7d2c8 0 8px, #eeeae3 8px 16px) border-box;
  border: 2px dashed #cfc8ba;
  color: #8a8172;
  font-size: 0.75rem;
  text-align: center;
  border-radius: 10px;
}

/* ── Imagen: siempre a su proporción natural ─────────── */
.logo-slot img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ── Header: 140px ancho máx, 60px alto máx ─────────── */
.logo-slot--header {
  width: 140px;
  height: 60px;
  flex-shrink: 0;
}

.logo-slot--header::before {
  content: "Logo";
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Cuando carga la imagen: sin caja, altura fija para proporcionar al img */
.logo-slot--header.logo-loaded {
  background: none;
  border: none;
  border-radius: 0;
  width: auto;
  height: 56px;        /* fija la altura → img max-height 100% = 56px */
  max-width: 220px;
  padding: 0;
}

.logo-slot--header.logo-loaded::before {
  display: none;
}

.header-contacts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 22px;
  border-left: 1px solid #d8d8d8;
  font-size: 0.92rem;
  color: var(--muted);
}

.header-contacts a,
.contacto-info a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.contact-icon,
.info-icon {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.contact-icon svg,
.info-icon svg,
.servicio-icon svg,
.carousel-btn svg {
  width: 100%;
  height: 100%;
}

.main-nav {
  display: flex;
  gap: 22px;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ── Botón WhatsApp del header ──────────────────────────── */
.btn-wa-header {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
  justify-self: end;
  transition: background 0.18s;
}

.btn-wa-header:hover {
  background: #1da851;
  color: #fff;
}

.btn-wa-header svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Botón WhatsApp del hero ────────────────────────────── */
.btn-wa-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 16px;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: 999px;
  width: 100%;
  transition: background 0.18s, transform 0.15s;
}

.btn-wa-hero:hover {
  background: #1da851;
  color: #fff;
  transform: translateY(-2px);
}

.btn-wa-hero svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.main-nav a:hover,
.header-contacts a:hover,
.site-footer a:hover {
  color: var(--navy);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  margin-left: auto;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 6px 8px;
  background: var(--navy);
}

.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 48px 8%;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 31, 58, 0.42), rgba(11, 31, 58, 0.58)),
    url("../imagenes/hero.jpg?v=3") center/cover no-repeat;
}

.hero-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 36px;
  padding: 28px 28px 32px;
  box-shadow: var(--shadow);
  text-align: center;
}

/* ── Hero: cuadrado placeholder hasta que cargue la imagen ── */
.logo-slot--hero {
  width: 150px;
  height: 150px;
  margin: 0 auto 18px;
  border-radius: 18px;
}

.logo-slot--hero::before {
  content: "Coloca tu logo";
  white-space: pre-line;
  font-size: 0.78rem;
  line-height: 1.4;
}

/* Cuando carga la imagen: sin caja, alto máximo controlado */
.logo-slot--hero.logo-loaded {
  background: none;
  border: none;
  width: auto;
  height: auto;
  max-width: 100%;
}

.logo-slot--hero.logo-loaded img {
  height: 110px;   /* ← ajusta este valor si quieres el logo más grande o chico */
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.logo-slot--hero.logo-loaded::before {
  display: none;
}

.logo-slot--hero:has(img[src]:not([style*="display: none"]))::after {
  display: none;
}

.hero-card p {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.hero-card strong {
  color: var(--navy);
}

.nosotros {
  padding: 72px 24px 28px;
}

/* Contenedor de dos columnas */
.nosotros-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

/* Columna de texto */
.nosotros-texto {
  background: #f3f6f8;
  border-radius: 36px;
  padding: 36px 42px 40px;
}

.nosotros-texto h2 {
  text-align: left;
  margin-bottom: 16px;
}

.nosotros-texto p {
  margin-bottom: 14px;
  color: var(--muted);
}

.nosotros-highlight {
  font-weight: 700;
  color: var(--navy) !important;
}

/* Columna del video — altura fija, compacta */
.nosotros-video {
  background: #f3f6f8;
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 600px;
}

.nosotros-player {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* muestra el video completo, sin recortar */
  object-position: center;
  display: none;
  border-radius: 36px;
}

/* Mostrar el video si el archivo existe */
.nosotros-player[src]:not([src=""]) {
  display: block;
}

/* Ocultar placeholder cuando el video carga */
.nosotros-player[src]:not([src=""]) ~ .nosotros-video-placeholder {
  display: none;
}

/* Placeholder centrado verticalmente */
.nosotros-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px;
  color: #8a9ab0;
  text-align: center;
  width: 100%;
  height: 100%;
}

.nosotros-video-placeholder svg {
  width: 60px;
  height: 60px;
  opacity: 0.4;
}

.nosotros-video-placeholder p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.nosotros-video-placeholder strong {
  color: var(--navy);
  font-family: monospace;
  font-size: 0.83rem;
}

.servicios {
  padding: 36px 24px 20px;
}

.servicios-lead {
  max-width: 640px;
  margin: 10px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
}

.servicios-grid {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  margin: 32px auto 48px;
  max-width: 920px;
}

.servicios-grid li {
  width: 140px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy);
}

.servicio-icon {
  width: 92px;
  height: 92px;
  margin: 0 auto 12px;
  border-radius: 22px;
  background: var(--gold);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 20px rgba(201, 162, 39, 0.28);
}

.servicio-icon svg {
  width: 46px;
  height: 46px;
}

.carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px 16px;
  max-width: 920px;
  margin: 0 auto;
}

.carousel-track-wrap {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.45s ease;
}

.slide {
  flex: 0 0 100%;
  background: #f4f6f8;
  border-radius: 36px;
  padding: 26px 32px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.slide-photo {
  flex: 0 0 220px;
  width: 220px;
  aspect-ratio: 4 / 3;
  height: auto;
  border-radius: 18px;
}

.slide-photo::after {
  content: "Coloca tu imagen";
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 0 10px;
}

.slide-photo:has(img[src]:not([style*="display: none"]))::after {
  display: none;
}

.slide-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.slide-copy {
  min-width: 0;
}

.slide h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.7rem;
  color: var(--navy);
  text-align: left;
  margin-bottom: 6px;
}

.slide-hook {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.slide-copy p {
  color: var(--muted);
  font-size: 0.95rem;
}

.slide-copy a {
  display: inline-block;
  margin-top: 12px;
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 0.92rem;
}

.slide-copy a:hover {
  color: var(--navy);
}

.carousel-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--navy-soft);
  cursor: pointer;
}

.carousel-dots {
  grid-column: 2;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.carousel-dots button {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 50%;
  background: #cfd6de;
  cursor: pointer;
}

.carousel-dots button.is-active {
  background: var(--navy);
  width: 22px;
  border-radius: 999px;
}

.testimonios {
  padding: 64px 24px 72px;
}

.testimonios-grid {
  max-width: 980px;
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.testimonio-card {
  min-height: 160px;
  background: #f4f6f8;
  border-radius: 28px;
  padding: 24px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.testimonio-card span {
  margin-top: 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--navy);
}

.contacto {
  background: var(--contact-bg);
  padding: 56px 24px;
}

.contacto-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 48px;
  align-items: start;
}

.contacto h2 {
  text-align: left;
}

.contacto-form-wrap p {
  margin: 8px 0 18px;
  color: var(--muted);
}

.contacto-form {
  display: grid;
  gap: 12px;
  max-width: 360px;
}

.contacto-form input,
.contacto-form textarea {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #d8d3cb;
  font: inherit;
  color: var(--ink);
}

.contacto-form input::placeholder,
.contacto-form textarea::placeholder {
  color: #6f675c;
}

.contacto-form button {
  width: 110px;
  margin: 8px auto 0;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--gold);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.contacto-form button:hover {
  background: var(--gold-dark);
}

.form-status {
  font-size: 0.9rem;
  color: var(--navy);
  text-align: center;
}

.contacto-info ul {
  list-style: none;
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.contacto-info li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.info-icon {
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.contacto-photo {
  border-radius: 18px;
  overflow: hidden;
  max-width: 420px;
}

.contacto-photo img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.site-footer {
  background: var(--navy);
  color: #d7deea;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 8%;
  font-size: 0.88rem;
}

.site-footer nav {
  display: flex;
  gap: 22px;
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: auto 1fr auto auto;
  }

  .nav-toggle {
    display: block;
    grid-column: 3;
    grid-row: 1;
  }

  .btn-wa-header {
    grid-column: 4;
    grid-row: 1;
    padding: 7px 12px;
    font-size: 0;        /* oculta texto, solo ícono */
    gap: 0;
  }

  .btn-wa-header svg {
    width: 22px;
    height: 22px;
  }

  .header-contacts {
    display: none;
  }

  .main-nav {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    padding: 8px 0 12px;
  }

  .site-header.is-open .main-nav {
    display: flex;
  }

  .hero {
    justify-content: center;
    min-height: 460px;
    padding: 32px 20px;
  }

  .testimonios-grid,
  .contacto-inner {
    grid-template-columns: 1fr;
  }

  .slide {
    flex-direction: column;
    text-align: center;
  }

  .slide-photo {
    flex: 0 0 auto;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .slide h3,
  .slide-copy {
    text-align: center;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .nosotros-texto {
    padding: 28px 22px;
  }

  .nosotros-inner {
    grid-template-columns: 1fr;
  }

  .nosotros-video {
    min-height: 220px;   /* en móvil sí ponemos un alto mínimo para que el placeholder se vea */
  }

  .carousel {
    grid-template-columns: 1fr;
  }

  .carousel-dots {
    grid-column: 1;
  }

  .carousel-btn {
    display: none;   /* oculta flechas en móvil */
  }

  .carousel {
    grid-template-columns: 1fr;
  }
}
