/* ==========================================================================
   CARRUSEL EN ESCALERA ("Staircase Carousel", sin React)
   Venta, Alquiler, Locales y la página de prueba carrusel-ejemplo.html.
   El movimiento lo calcula assets/js/carrusel.js.
   · La elegida: la tarjeta con giro (tarjeta-giro.css), recta y a tamaño
     completo, con el barrio a su derecha (debajo en el móvil).
   · Las de antes suben un piso hacia la izquierda y las de después bajan
     uno hacia la derecha, al 80 %.
   · Los bordes no cortan: arriba, abajo y a los lados se desvanecen.
   · Abajo, la pastilla con flechas y puntos (más de 14: contador 01 / 14).
   ========================================================================== */
.dc {
  --dc-w: clamp(230px, 23vw, 310px);           /* ancho de la tarjeta de delante */
  position: relative;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.dc:focus-visible .dc-nav { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--encina); }

/* Zona del carrusel: alto fijo; los bordes se funden en vez de cortar */
.dc-view {
  position: relative;
  display: grid;
  place-items: center;
  height: calc(var(--dc-w) / .7 * 1.95);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%), linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%), linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-composite: intersect;
}
.dc[data-dragging] .dc-view { cursor: grabbing; }
.dc-stage {
  position: relative;
  width: var(--dc-w);
  aspect-ratio: .7;
  margin-top: 0;
}
.dc-strip { position: absolute; inset: 0; }
.dc-slot {
  position: absolute;
  inset: 0;
  will-change: transform;
  cursor: pointer;
}
/* El escalón: sube o baja con una transición (la tira la mueve el muelle en JS) */
.dc-step {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  transition-property: transform;
  transition-timing-function: ease-in-out;
}
.dc-instant .dc-step { transition: none !important; }
.dc-step > .col { width: auto; height: 100%; margin: 0; padding: 0; }
.dc-slot .fc { max-width: none; }
.dc-slot:not(.is-active) .fc,
.dc[data-dragging] .dc-slot .fc { pointer-events: none; }  /* solo gira la de delante, y no al arrastrar */
.dc[data-dragging] .dc-slot { cursor: grabbing; }

/* Barrio al lado de la elegida: sale encogiéndose y entra el nuevo con rebote */
.dc-titles { position: absolute; left: 100%; top: 0; bottom: 0; margin-left: 18px; width: 40vw; pointer-events: none; z-index: 0; }
.dc-title {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--tinta);
  transform-origin: 0 50%;
}
@keyframes dc-in { from { opacity: 0; transform: scale(.5); filter: blur(2px); } to { opacity: 1; transform: scale(1); filter: blur(0); } }
@keyframes dc-out { from { opacity: 1; transform: scale(1); filter: blur(0); } to { opacity: 0; transform: scale(.5); filter: blur(2px); } }

/* Pastilla: flechas y puntos (como el botón de Contacto) */
.dc-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: -8px auto 0;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--tinta);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 14px 30px -14px rgba(0, 0, 0, .45);
}
.dc.is-empty .dc-nav { display: none; }
.dc-arrow {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: #fff;
  cursor: pointer;
  transition: opacity .2s, transform .2s, background-color .2s;
}
.dc-arrow:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.dc-arrow:disabled { opacity: .3; cursor: default; }
.dc-arrow:not(:disabled):active { transform: scale(.88); }
.dc-arrow:focus-visible, .dc-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.dc-dots { min-width: 150px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.dc-dot {
  position: relative;
  width: 8px;
  height: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;               /* blancos sobre la pastilla negra (otras reglas de botón ponían el color en negro) */
  opacity: .32;
  cursor: pointer;
  transition: width .3s, opacity .3s;
}
.dc-dot::after { content: ""; position: absolute; inset: -10px -4px; }
.dc-dot[aria-current] { width: 28px; opacity: 1; }
.dc-count { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dc-empty { position: absolute; left: 50%; top: 50%; width: 80vw; margin: 0; transform: translate(-50%, -50%); text-align: center; color: rgba(28, 30, 27, .6); }

/* Página de prueba */
.dc-page { padding: clamp(120px, 13vw, 160px) 0 clamp(70px, 9vw, 120px); }
.dc-page .fc-head { margin-bottom: 0; }
.dc-tabs { display: flex; justify-content: center; gap: 6px; margin: 22px 0 0; }
.dc-tabs button {
  padding: 8px 14px 7px;
  border: 1px solid rgba(28, 30, 27, .18);
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--tinta);
  cursor: pointer;
}
.dc-tabs button[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: #fff; }

@media (max-width: 640px) {
  .dc { --dc-w: min(62vw, 260px); }
  .dc-view { height: calc(var(--dc-w) / .7 * 1.9 + 34px); }
  /* En el móvil no cabe al lado: el barrio va debajo de la tarjeta */
  .dc-titles { left: 0; right: 0; top: 100%; bottom: auto; width: auto; height: 28px; margin: 8px 0 0; z-index: 101; }
  .dc-title { left: 0; right: 0; justify-content: center; transform-origin: 50% 50%; font-size: 15px; }
  .dc-dots { min-width: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  .dc-dot, .dc-arrow, .dc-step { transition: none !important; }
  .dc-title { animation: none !important; }
}
