.ficha { max-width: 1280px; margin: 0 auto; padding: 20px var(--margen) 72px; }
.volver { color: var(--gris); text-decoration: none; font-size: 0.9rem; }

.mosaico { position: relative; display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; height: min(64svh, 540px); margin-top: 14px; overflow: hidden; border-radius: 16px; }
.mosaico__foto { position: relative; overflow: hidden; border: 0; background: #ddd8ca; cursor: zoom-in; }
.mosaico__foto:first-child { grid-row: 1 / -1; }
.mosaico__foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter 150ms ease; }
.mosaico--2 .mosaico__foto:nth-child(2), .mosaico--3 .mosaico__foto:nth-child(n + 2) { grid-column: 2 / -1; }
.mosaico--2 .mosaico__foto:nth-child(2) { grid-row: 1 / -1; }
.mosaico--4 .mosaico__foto:nth-child(4) { grid-column: 2 / -1; }
.mosaico__todas { position: absolute; right: 14px; bottom: 14px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: #fff; color: var(--tinta); font: 600 0.85rem "Inter", system-ui, sans-serif; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .mosaico__foto:hover img { filter: brightness(0.9); } }

.visor {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  padding: clamp(8px, 1vw, 18px);
  background: var(--sala);
  color: #fff;
}
.visor[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; }
.visor::backdrop { background: var(--sala); }
html:has(.visor[open]) { overflow: hidden; }
.visor__cabeza { display: flex; justify-content: space-between; align-items: center; }
.visor__contador { font-weight: 600; font-variant-numeric: tabular-nums; }
.visor__escena {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: clamp(4px, 1vw, 16px);
  min-height: 0;
}
.visor__imagen { grid-column: 2; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.visor__boton {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--linea);
  border-radius: 50%;
  background: var(--sala-2);
  color: #fff;
  cursor: pointer;
}
.visor [hidden] { display: none; }
.visor__miniaturas {
  display: flex;
  gap: 8px;
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.visor__miniatura {
  flex: 0 0 clamp(60px, 8vw, 108px);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  background: var(--sala-2);
  opacity: 0.65;
  cursor: pointer;
}
.visor__miniatura img { width: 100%; height: 100%; object-fit: cover; }
.visor__miniatura[aria-pressed="true"] { opacity: 1; border-color: var(--oro); }
@media (hover: hover) and (pointer: fine) {
  .visor__boton:hover { border-color: var(--oro); }
  .visor__miniatura:hover { opacity: 1; }
}
@media (max-width: 600px) {
  .visor__escena { position: relative; grid-template-columns: minmax(0, 1fr); }
  .visor__imagen { grid-column: 1; }
  .visor__escena .visor__boton { position: absolute; z-index: 1; }
  .visor__escena .visor__boton:last-child { inset-inline-end: 0; }
}

.titular { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--borde); overflow-wrap: anywhere; }
.titular__zona { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--gris); }
.compartir { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; color: var(--tinta); cursor: pointer; }

.ficha__cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); gap: 56px; align-items: start; }
.indice { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 16px 0; border-bottom: 1px solid var(--borde); }
.indice a { color: var(--tinta); font-size: 0.9rem; font-weight: 500; }
.bloque { padding: 36px 0; border-bottom: 1px solid var(--borde); scroll-margin-top: 100px; }
.ficha h2 { margin-bottom: 16px; font-size: 1.5rem; }
.ficha h3 { margin: 28px 0 14px; }
.detalles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 32px; }
.detalles div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--borde); }
.detalles dt { color: var(--gris); }
.detalles dd { font-weight: 600; text-align: right; }
.comodidades { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; list-style: none; }
.comodidades li { display: flex; align-items: center; gap: 10px; }
.recorridos { display: flex; flex-wrap: wrap; gap: 14px; }
.recorridos video { width: min(260px, 100%); aspect-ratio: 9 / 16; border-radius: 14px; background: #000; object-fit: cover; }
.ficha__mapa { height: 340px; margin-top: 14px; border-radius: 14px; z-index: 0; }

.lateral { position: sticky; top: 100px; display: grid; gap: 14px; margin-top: 24px; padding: 24px; border-radius: 16px; background: #fff; box-shadow: 0 20px 44px -28px rgb(28 28 26 / 0.45); }
.lateral__tipo { color: var(--gris); font-size: 0.85rem; }
.lateral__precio { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.lateral summary { padding: 8px 0; font-size: 0.9rem; text-align: center; cursor: pointer; }
.lateral form { display: grid; gap: 12px; padding-top: 8px; }
.lateral label { display: grid; gap: 4px; color: var(--gris); font-size: 0.8rem; }
.lateral input, .lateral textarea { width: 100%; padding: 12px; border: 1px solid var(--borde); border-radius: 10px; background: var(--papel); color: var(--tinta); color-scheme: light; font: 400 0.92rem "Inter", system-ui, sans-serif; }

.otras { padding-top: 56px; }
.barra-movil { display: none; }

@media (max-width: 940px) {
  .ficha__cuerpo { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lateral { position: static; }
  .mosaico { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 52svh; }
  .mosaico__foto:nth-child(n + 2) { display: none; }
  .barra-movil { position: fixed; inset: auto 0 0; z-index: 25; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--borde); background: #fff; }
  body:has(.barra-movil) .flotante { display: none; }
  body:has(.barra-movil) .pie { padding-bottom: 76px; }
}

@media (max-width: 520px) {
  .titular .compartir span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .titular .compartir { min-width: 44px; justify-content: center; padding: 0; }
}
.bloque p.descripcion { white-space: pre-line; overflow-wrap: anywhere; }
.video-ficha { width: 100%; max-width: 640px; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; background: #000; }

/* La ficha se arma después de consultar la API. No capturar la página aún vacía. */
@view-transition { navigation: none; }
.pagina-ficha:has(.cargando-propiedades) { min-height: 100svh; }

@media (prefers-reduced-motion: no-preference) {
  .pagina-ficha .ficha--entrada { animation: ficha-entrada 180ms var(--ease) both; }
}
@keyframes ficha-entrada {
  from { opacity: 0; translate: 0 6px; }
}
