/* Página «Diseño web en Sabadell»: hero con esquema de la zona dibujándose + secciones con ritmo oscuro/claro. */

html:has(body.sb) {
  scrollbar-color: var(--dorado) var(--grafito);
  scroll-behavior: smooth;
}
.sb ::selection { background: var(--acento-logo); color: var(--grafito); }
.sb :focus-visible { outline: 3px solid var(--cta); outline-offset: 3px; border-radius: 4px; }

.sb h1, .sb h2, .sb h3 { text-align: left; }
.sb em {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

/* ───────── Hero ───────── */
.sb-header { overflow: hidden; }
.sb-hero {
  position: relative;
  max-width: 1140px;
  margin: 0 auto;
  padding: 150px 24px 90px;
  min-height: 640px;
  display: flex;
  align-items: center;
}
.sb-hero-texto { position: relative; z-index: 2; max-width: 600px; }
.sb-hero h1 {
  color: var(--blanco);
  font-weight: 800;
  font-size: clamp(2.7rem, 6.4vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin-bottom: 26px;
}
.sb-hero h1 em { color: var(--acento-logo); font-size: 1.1em; }
.sb-sub {
  color: var(--dorado-claro);
  font-size: 1.1rem;
  line-height: 1.65;
  max-width: 54ch;
  margin-bottom: 34px;
}
.sb-acciones { display: flex; flex-wrap: wrap; gap: 14px; }
.sb-acciones .btn-primary,
.sb-acciones .btn-secondary { display: inline-block; }
.sb-acciones .btn-primary:hover { filter: brightness(1.07); }
.sb-acciones .btn-secondary:hover { background: rgba(255, 255, 255, 0.08); }

.sb-mapa {
  position: absolute;
  right: -6%;
  top: 50%;
  width: 64%;
  max-width: 880px;
  transform: translateY(-50%);
  z-index: 1;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 16%);
  mask-image: linear-gradient(to right, transparent 0%, #000 16%);
}
.sb-curvas path { stroke: var(--acento-logo); stroke-width: 1; opacity: 0.16; }
.sb-lineas path {
  stroke: var(--acento-logo);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.8;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: sb-trazo 1.1s var(--curva) var(--d) forwards;
}
.sb-nodos g { opacity: 0; animation: sb-aparece 0.6s var(--curva) var(--d) forwards; }
.sb-nodos circle { fill: var(--acento-logo); }
.sb-nodos text {
  fill: var(--dorado-claro);
  font-family: var(--fuente-titulos);
  font-weight: 600;
  font-size: 19px;
}
.sb-centro circle { fill: var(--cta); }
.sb-centro .sb-nombre {
  fill: var(--blanco);
  font-family: var(--fuente-titulos);
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.01em;
}
.sb-onda {
  fill: none;
  stroke: var(--cta);
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: sb-onda 4.2s var(--curva) 1.6s infinite;
}
.sb-onda-2 { animation-delay: 3.1s; }
/* La animación espera a que el esquema esté a la vista (en móvil queda bajo el pliegue) */
.js .sb-mapa:not(.vivo) * { animation-play-state: paused; }

@keyframes sb-trazo { to { stroke-dashoffset: 0; } }
@keyframes sb-aparece { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sb-onda {
  0% { opacity: 0.7; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(6); }
}

/* ───────── Secciones ───────── */
.sb-seccion { padding: 96px 24px; }
.sb-ancho { max-width: 1040px; margin: 0 auto; }
.sb-estrecho { max-width: 760px; }
.sb-crema { background: var(--dorado-claro); color: var(--texto); }
.sb-blanca { background: var(--blanco); color: var(--texto); }
.sb-oscura { background: var(--grafito); color: var(--blanco); }

.sb-seccion h2, .sb-cierre h2 {
  font-weight: 800;
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 18ch;
  margin: 0 0 22px;
}
.sb-seccion h2 em { font-size: 1.1em; color: var(--dorado-texto); }
.sb-oscura h2, .sb-cierre h2 { color: var(--blanco); }
.sb-oscura h2 em, .sb-cierre h2 em { color: var(--acento-logo); }
.sb-intro { color: var(--texto-suave); font-size: 1.08rem; max-width: 58ch; margin-bottom: 44px; }
.sb-oscura .sb-intro { color: var(--dorado-claro); }

/* Filas con línea que se dibuja al entrar */
.sb-filas, .sb-precios { display: block; padding: 0; }
.sb-fila {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 8px 40px;
  align-items: baseline;
  padding: 24px 0;
  transition: padding-left 0.35s var(--curva);
}
.sb-fila::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: rgba(36, 31, 27, 0.22);
}
.sb-filas > li:last-child::after,
.sb-precios > li:last-child::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(36, 31, 27, 0.22);
}
.sb-fila strong { font-family: var(--fuente-titulos); font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.sb-fila span { color: var(--texto-suave); font-size: 1rem; line-height: 1.55; }
.sb-fila:hover { padding-left: 14px; }

.js .rv { opacity: 0; transform: translateY(10px); transition: opacity 0.5s var(--curva) var(--retardo, 0ms), transform 0.5s var(--curva) var(--retardo, 0ms), padding-left 0.35s var(--curva); }
.js .rv::before { transform: scaleX(0); transform-origin: left; transition: transform 0.9s var(--curva) var(--retardo, 0ms); }
.js .rv.on { opacity: 1; transform: none; }
.js .rv.on::before { transform: scaleX(1); }

/* Negocios: filas grandes que se desplazan al pasar el ratón */
.sb-negocios { border-top: 1px solid rgba(246, 239, 226, 0.22); }
.sb-negocios li { border-bottom: 1px solid rgba(246, 239, 226, 0.22); }
.sb-negocios a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  font-family: var(--fuente-titulos);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.4vw, 2.3rem);
  letter-spacing: -0.02em;
  color: var(--blanco);
  transition: color 0.25s var(--curva), padding-left 0.35s var(--curva);
}
.sb-negocios i {
  flex: none;
  width: 36px; height: 2px;
  background: currentColor;
  position: relative;
  transition: width 0.35s var(--curva);
}
.sb-negocios i::after {
  content: '';
  position: absolute;
  right: 0; top: -5px;
  width: 11px; height: 11px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg) scale(0.9);
  transform-origin: center;
}
.sb-negocios a:hover { color: var(--acento-logo); padding-left: 16px; }
.sb-negocios a:hover i { width: 64px; }

/* Pasos: la línea vertical se va dibujando con el scroll donde el navegador lo permite */
.sb-pasos { position: relative; margin-top: 44px; padding-left: 0; display: grid; gap: 38px; }
.sb-pasos::before {
  content: '';
  position: absolute;
  left: 27px; top: 14px; bottom: 14px;
  width: 2px;
  background: var(--dorado-texto);
  transform-origin: top;
}
@supports (animation-timeline: view()) {
  .sb-pasos::before {
    transform: scaleY(0);
    animation: sb-linea linear both;
    animation-timeline: view();
    animation-range: entry 25% cover 65%;
  }
}
@keyframes sb-linea { to { transform: scaleY(1); } }
.sb-pasos li { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 28px; align-items: start; }
.sb-num {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--grafito);
  color: var(--acento-logo);
  font-family: var(--fuente-titulos);
  font-weight: 800;
  font-size: 1.5rem;
  position: relative; z-index: 1;
}
.sb-pasos h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; margin: 8px 0 8px; color: var(--grafito); }
.sb-pasos p { color: var(--texto-suave); max-width: 56ch; font-size: 1.02rem; }

/* Precio */
.sb-precios .sb-fila { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.sb-precios strong { display: block; margin-bottom: 4px; }
.sb-importe {
  margin: 0;
  font-family: var(--fuente-titulos);
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--grafito);
  white-space: nowrap;
}
.sb-nota { margin-top: 26px; color: var(--texto-suave); font-size: 0.98rem; }
.sb-nota a { color: var(--grafito); font-weight: 600; text-decoration: underline; text-decoration-color: var(--dorado); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.sb-nota a:hover { text-decoration-color: var(--grafito); }

/* Preguntas */
.sb-faq { margin-top: 36px; border-top: 1px solid rgba(36, 31, 27, 0.22); }
.sb-faq details { border-bottom: 1px solid rgba(36, 31, 27, 0.22); }
.sb-faq summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 0;
  font-family: var(--fuente-titulos);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.sb-faq summary::-webkit-details-marker { display: none; }
.sb-faq summary::after {
  content: '';
  flex: none;
  width: 14px; height: 14px;
  background:
    linear-gradient(var(--grafito), var(--grafito)) center / 100% 2px no-repeat,
    linear-gradient(var(--grafito), var(--grafito)) center / 2px 100% no-repeat;
  transition: transform 0.3s var(--curva);
}
.sb-faq details[open] summary::after { transform: rotate(135deg); }
.sb-faq details p { color: var(--texto-suave); padding: 0 0 24px; max-width: 62ch; font-size: 1.02rem; }

/* Cierre */
.sb-cierre { background: var(--grafito); color: var(--blanco); padding: 110px 24px; border-top: 3px solid var(--dorado); }
.sb-cierre h2 { max-width: 16ch; }
.sb-cierre p { color: var(--dorado-claro); font-size: 1.1rem; max-width: 48ch; margin-bottom: 30px; }
.sb-cierre .btn-primary { display: inline-block; }
.sb-cierre .btn-primary:hover { filter: brightness(1.07); }

/* ───────── Móvil ───────── */
@media (max-width: 860px) {
  .sb-hero { flex-direction: column; align-items: flex-start; padding: 120px 20px 40px; min-height: 0; }
  .sb-mapa {
    position: relative;
    right: auto; top: auto;
    transform: none;
    width: 118%;
    max-width: none;
    margin: 18px -9% 0;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .sb-nodos text { font-size: 30px; }
  .sb-centro .sb-nombre { font-size: 42px; }
  .sb-seccion { padding: 68px 20px; }
  .sb-fila { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .sb-precios .sb-fila { grid-template-columns: 1fr; }
  .sb-fila:hover { padding-left: 0; }
  .sb-pasos li { grid-template-columns: 44px minmax(0, 1fr); gap: 18px; }
  .sb-pasos::before { left: 21px; }
  .sb-num { width: 44px; height: 44px; font-size: 1.2rem; }
  .sb-cierre { padding: 80px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html:has(body.sb) { scroll-behavior: auto; }
  .sb-lineas path { animation: none; stroke-dashoffset: 0; }
  .sb-nodos g { animation: none; opacity: 1; }
  .sb-onda { animation: none; opacity: 0; }
  .js .rv, .js .rv::before { transition: none; opacity: 1; transform: none; }
  .sb-pasos::before { animation: none; transform: none; }
  .sb-fila, .sb-negocios a, .sb-negocios i { transition: none; }
}

/* Vitrina: demo real del sector bajo el cursor (solo escritorio) */
.sb-visor { display: none; }
@media (min-width: 900px) {
  .sb-vitrina { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: start; }
  .sb-vitrina .sb-negocios a { font-size: clamp(1.15rem, 2vw, 1.6rem); padding: 18px 0; }
  .sb-negocios li.act a { color: var(--acento-logo); padding-left: 16px; }
  .sb-negocios li.act i { width: 64px; }
  .sb-visor { display: block; position: sticky; top: 96px; border: 1px solid rgba(246, 239, 226, 0.28); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 14px 14px 0 rgba(184, 137, 63, 0.35); }
  .sb-visor-barra { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #2f2924; }
  .sb-visor-barra span { width: 9px; height: 9px; border-radius: 50%; background: rgba(246, 239, 226, 0.35); }
  .sb-visor-barra b { margin-left: 10px; font: 600 0.75rem var(--fuente-titulos); color: var(--dorado-claro); letter-spacing: 0.02em; }
  .sb-visor-marco { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
  .sb-visor-marco iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; opacity: 0; transition: opacity 0.4s var(--curva); }
  .sb-visor-marco iframe.listo { opacity: 1; }
}

/* Precios: cifras grandes */
.sb-precios .sb-fila { padding: 36px 0; }
.sb-precios .sb-importe { font-family: var(--fuente-titulos); font-weight: 800; font-size: clamp(2.2rem, 5.6vw, 4.2rem); letter-spacing: -0.03em; line-height: 1; color: var(--dorado-texto); white-space: nowrap; }
.sb-precios strong { font-size: 1.6rem; }

/* Sección «no son tu web»: texto + móvil con demo real (solo escritorio) */
.sb-movil { display: none; }
@media (min-width: 900px) {
  .sb-dos { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 64px; align-items: start; }
  .sb-dos .sb-fila { grid-template-columns: 1fr; padding: 20px 0; }
  .sb-dos .sb-intro { margin-bottom: 28px; }
  .sb-movil { display: block; position: sticky; top: 110px; justify-self: center; text-align: center; }
  .sb-movil-cuerpo { position: relative; width: 260px; height: 540px; margin: 0 auto; border: 8px solid var(--grafito); border-radius: 30px; overflow: hidden; background: #fff; box-shadow: 12px 12px 0 rgba(184, 137, 63, 0.45); }
  .sb-movil-cuerpo iframe { position: absolute; left: 0; top: 0; width: 390px; height: 810px; border: 0; transform: scale(0.6667); transform-origin: 0 0; pointer-events: none; }
  .sb-movil p { margin-top: 26px; font-size: 0.85rem; color: var(--texto-suave); }
}
.sb-precios .sb-importe-txt { font-size: clamp(1.4rem, 2.8vw, 2.1rem); white-space: normal; text-align: right; max-width: 12ch; line-height: 1.1; }
@media (max-width: 860px) { .sb-precios .sb-importe-txt { text-align: left; max-width: none; } }
