/* Domova — carrusel de tarjetas, fotos completas y arrastre directo. */
.has-carousel { grid-template-areas: "gallery summary" "details summary"; grid-template-rows: auto 1fr; row-gap: 0; }
.has-carousel > .property-carousel { grid-area: gallery; }
.has-carousel > .property-content { grid-area: details; min-width: 0; }
.has-carousel > .detail-aside { grid-area: summary; }
.property-carousel { min-width: 0; margin-bottom: 30px; }
.gallery-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font: 11px/1.5 var(--mono); color: var(--ink-soft); }
.gallery-heading p { margin: 0; letter-spacing: .12em; text-transform: uppercase; }
.gallery-heading > span { flex-shrink: 0; }
.gallery-stage { position: relative; isolation: isolate; overflow: hidden; width: 100%; height: clamp(330px, 39vw, 500px); border-radius: 12px; background: #eee9dc; touch-action: pan-y pinch-zoom; }
.gallery-stage > .gallery-backdrop { display: none; }
.property-carousel .gallery-image-link { position: absolute; inset: 0; width: 100%; height: 100%; background: none; border-radius: 0; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.property-carousel .gallery-image-link img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: contain; object-position: center; user-select: none; -webkit-user-drag: none; }
.gallery-transition-image { pointer-events: none; }
.gallery-stage.is-rail { background: linear-gradient(180deg, #f1ecdf, #f8f4e9); }
.gallery-track { position: absolute; inset: 0; will-change: transform; }
.property-carousel .gallery-track .gallery-image-link,
.gallery-neighbor {
  position: absolute;
  top: 12px;
  bottom: 24px;
  height: calc(100% - 36px);
  border: 1px solid rgba(154, 134, 91, .18);
  border-radius: 16px;
  background: #fffdf7;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 16px 26px -20px rgba(50, 44, 29, .45);
}
.property-carousel .gallery-track .gallery-image-link {
  left: calc(50% - var(--active-width, 70%) / 2);
  right: auto;
  width: var(--active-width, 70%);
  cursor: grab;
}
.gallery-neighbor { cursor: pointer; transform: scale(.94); }
.gallery-neighbor--prev { left: calc(50% - var(--active-width, 70%) / 2 - var(--rail-gap, 14px) - var(--previous-width, 70%)); width: var(--previous-width, 70%); }
.gallery-neighbor--next { left: calc(50% + var(--active-width, 70%) / 2 + var(--rail-gap, 14px)); width: var(--next-width, 70%); }
.gallery-neighbor img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.gallery-stage.is-dragging, .property-carousel .gallery-stage.is-dragging .gallery-image-link { cursor: grabbing; }
.gallery-stage.is-dragging .gallery-track { user-select: none; }
.gallery-gesture-hint { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 4px 0 10px; color: var(--ink-soft); font: 11px/1.4 var(--sans); }
.gallery-gesture-hint svg { width: 18px; height: 18px; }
.property-carousel .gallery-nav, .property-carousel .gallery-expand {
  background: rgba(255, 253, 247, .96);
  color: var(--ink);
  border-color: rgba(154, 134, 91, .28);
  box-shadow: 0 4px 15px rgba(43, 37, 22, .08);
}
.property-carousel .gallery-nav:hover, .property-carousel .gallery-expand:hover { background: white; border-color: var(--gold-deep); }
.property-carousel .gallery-index { background: rgba(255, 253, 247, .96); color: var(--ink); border-color: rgba(154, 134, 91, .28); border-radius: 30px; }
.gallery-stage .gallery-image-link:focus-visible { outline: 3px solid var(--gold); outline-offset: -4px; }
.gallery-nav, .gallery-expand, .viewer-close { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(32, 34, 30, .8); color: #fffdf7; font: 500 12px/1 var(--sans); cursor: pointer; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background .2s, border-color .2s, box-shadow .2s; }
.gallery-nav { position: absolute; z-index: 3; top: 50%; width: 44px; height: 44px; padding: 0; border-radius: 50%; transform: translateY(-50%); }
.gallery-nav--prev { left: 16px; }
.gallery-nav--next { right: 16px; }
.gallery-expand { position: absolute; z-index: 3; top: 16px; right: 16px; min-height: 44px; padding: 0 14px; border-radius: 6px; }
.gallery-nav svg, .gallery-expand svg, .gallery-play svg, .viewer-close svg, .viewer-original svg { width: 18px; height: 18px; flex-shrink: 0; }
.gallery-nav:hover, .gallery-expand:hover, .viewer-close:hover { background: #383d32; border-color: var(--gold); }
.gallery-nav:focus-visible, .gallery-expand:focus-visible, .viewer-close:focus-visible, .viewer-original:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.gallery-index { position: absolute; z-index: 2; left: 16px; bottom: 16px; padding: 7px 11px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 5px; background: rgba(32, 34, 30, .8); color: #fffdf7; font: 11px/1.5 var(--mono); letter-spacing: .08em; pointer-events: none; }
.gallery-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; padding: 9px 0; }
.gallery-caption { margin: 0; font: 500 14px/1.5 var(--sans); color: var(--ink); }
.gallery-play { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 44px; padding: 0 0 0 8px; border: 0; background: none; color: var(--gold-deep); font: 500 12px/1.4 var(--sans); cursor: pointer; }
.gallery-play:hover { color: var(--ink); }
.gallery-play[aria-pressed="false"] .gallery-pause-icon, .gallery-play[aria-pressed="true"] .gallery-play-icon { display: none; }
.property-carousel .gallery-thumbnails { display: flex; gap: 10px; padding: 4px 3px 9px; margin: 0 -3px; list-style: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
.gallery-thumbnails li { flex: 0 0 90px; scroll-snap-align: start; }
.property-carousel .detail-thumb { position: relative; display: block; height: 70px; border: 2px solid transparent; border-radius: 5px; background: #2c2e29; overflow: hidden; opacity: .68; transition: opacity .2s, border-color .2s, box-shadow .2s; }
.property-carousel .detail-thumb img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; }
.property-carousel .detail-thumb:hover { opacity: 1; transform: none; border-color: var(--gold); }
.property-carousel .detail-thumb.is-active { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--gold); }
.gallery-message { margin: 0; color: var(--ink-soft); font-size: 13px; }
.gallery-message:empty { display: none; }
.gallery-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* El visor mantiene toda la foto visible, tanto vertical como horizontal. */
.property-viewer { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: #1e211e; color: #fffdf7; overflow: hidden; }
.property-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.property-viewer::backdrop { background: rgba(20, 23, 20, .94); }
.viewer-header, .viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 30px; }
.viewer-header { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.viewer-title { margin: 0; font: 500 21px/1.3 var(--serif); }
.viewer-close { flex-shrink: 0; min-height: 44px; padding: 0 14px; border-radius: 6px; }
.viewer-stage { min-width: 0; min-height: 0; position: relative; padding: 18px 82px; overflow: hidden; touch-action: pan-y pinch-zoom; }
.viewer-stage > img { width: 100%; height: 100%; max-height: none; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.viewer-stage > .gallery-transition-image { position: absolute; inset: 18px 82px; width: calc(100% - 164px); height: calc(100% - 36px); }
.viewer-footer { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.viewer-footer p { display: flex; align-items: baseline; gap: 18px; margin: 0; font-size: 14px; }
.viewer-count { color: #cbb98e; font: 12px/1.5 var(--mono); white-space: nowrap; }
.viewer-original { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; min-height: 44px; font-size: 12px; color: #e1d9c2; }
.viewer-original:hover { color: white; text-decoration: underline; }
html.gallery-modal-open { overflow: hidden; scrollbar-gutter: stable; }
@media (max-width: 1050px) { .gallery-stage { height: clamp(320px, 43vw, 440px); } }
@media (max-width: 780px) {
  .has-carousel { grid-template-areas: "gallery" "summary" "details"; grid-template-rows: auto auto auto; row-gap: 24px; }
  .has-carousel > .detail-aside { grid-row: auto; }
  .property-carousel { margin-bottom: 0; }
  .gallery-stage { height: clamp(360px, 72vw, 510px); }
  .viewer-header { padding: 14px 18px; }
  .viewer-title { font-size: 18px; }
  .viewer-stage { padding: 12px 0; }
  .viewer-stage > .gallery-transition-image { inset: 12px 0; width: 100%; height: calc(100% - 24px); }
  .viewer-footer { padding-left: 18px; padding-right: 18px; gap: 12px; }
  .viewer-footer p { display: grid; gap: 4px; font-size: 13px; }
}
@media (max-width: 520px) {
  .gallery-stage { height: clamp(310px, 105vw, 430px); border-radius: 8px; }
  .gallery-heading { font-size: 10px; gap: 8px; }
  .gallery-heading p { letter-spacing: .075em; }
  .gallery-nav--prev { left: 10px; }
  .gallery-nav--next { right: 10px; }
  .gallery-expand { top: 10px; right: 10px; padding: 0 11px; }
  .gallery-index { left: 10px; bottom: 10px; }
  .gallery-footer { gap: 10px; min-height: 60px; }
  .gallery-caption { font-size: 13px; }
  .gallery-play { font-size: 11px; }
  .gallery-thumbnails li { flex-basis: 76px; }
  .property-carousel .detail-thumb { height: 62px; }
  .viewer-stage .gallery-nav { top: auto; bottom: 20px; transform: none; }
  .viewer-original span { display: none; }
  .viewer-original { justify-content: center; width: 44px; }
}
@media (prefers-reduced-motion: reduce) { .property-carousel *, .property-viewer * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
