/* Una tarjeta centrada; la vivienda permanece visible detrás del diálogo. */
.gallery-ai-label{position:absolute;right:5px;top:5px;z-index:2;border-radius:3px;padding:3px 5px;background:#012d20;color:#fff;font:600 9px/1.3 Manrope,Arial,sans-serif}
.gallery-ai-label[hidden]{display:none}
.gallery-plan-button{position:relative}
.ficha-lightbox.gallery-is-floating{
  width:min(1440px,calc(100% - 8vw));height:min(88dvh,1000px);max-width:92vw;max-height:88dvh;
  position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);
  margin:0;padding:0;border:1px solid #ffffff80;border-radius:15px;
  background:#f9faf6;color:var(--green,#012d20);box-shadow:0 25px 100px #00190f55;
  overflow:hidden;
}
.ficha-lightbox.gallery-is-floating[open]{display:grid;grid-template-rows:65px minmax(0,1fr)}
.gallery-is-floating img{margin:0}
.ficha-lightbox.gallery-is-floating::backdrop{background:#102b225e;backdrop-filter:blur(4px)}
.gallery-is-floating .gallery-dialog-header{display:flex;align-items:center;gap:15px;padding:0 78px 0 25px;min-width:0;border-bottom:1px solid #dfe6dc}
.gallery-is-floating .gallery-dialog-title{font:500 17px/1.35 var(--sans,sans-serif);letter-spacing:-.02em;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gallery-is-floating .gallery-dialog-position{font-size:11px;line-height:1.4;color:#667b6b;white-space:nowrap}
.ficha-lightbox.gallery-is-floating .popup-close{top:10px;right:12px;color:#244a35;background:#edf1e9;width:44px;height:44px;font-size:28px}
.ficha-lightbox.gallery-is-floating .popup-close:hover{background:#e0e8da}
.gallery-dialog-content{display:grid;grid-template-columns:minmax(0,1fr) 230px;min-width:0;min-height:0}
.gallery-dialog-view{display:grid;grid-template-rows:minmax(0,1fr) auto;min-width:0;min-height:0;background:#14271e;padding:18px 18px 0}
.ficha-lightbox.gallery-is-floating .lightbox-stage{height:100%;min-height:0;min-width:0;overflow:hidden;border-radius:5px}
.ficha-lightbox.gallery-is-floating .lightbox-stage img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.ficha-lightbox.gallery-is-floating #lightbox-caption{margin:0;padding:16px 8px 17px;color:#e0e9df;font-size:10px;line-height:1.6;min-height:49px;text-align:center}
.ficha-lightbox.gallery-is-floating .slide-arrow{width:44px;height:44px;background:#f9faf5ed;color:#173b28;box-shadow:0 2px 12px #0003}
.ficha-lightbox.gallery-is-floating .slide-arrow.previous{left:12px}
.ficha-lightbox.gallery-is-floating .slide-arrow.next{right:12px}
.gallery-dialog-sidebar{display:grid;grid-template-columns:minmax(0,1fr) 88px;gap:12px;min-width:0;min-height:0;padding:16px 14px;background:#f2f5ed;border-left:1px solid #dde4d8}
.gallery-dialog-thumbnails{display:flex;flex-direction:column;gap:9px;overflow:auto;min-width:0;min-height:0;padding:4px;scrollbar-width:thin;scrollbar-color:#bacbb5 transparent;overscroll-behavior:contain}
.gallery-thumbnail{display:block;position:relative;flex:none;aspect-ratio:1.3;width:100%;padding:0;border:2px solid transparent;border-radius:6px;background:#dde5d7;overflow:hidden;opacity:.7;transition:opacity .15s,border-color .15s}
.gallery-thumbnail img{width:100%;height:100%;display:block;object-fit:cover}
.gallery-thumbnail:hover,.gallery-thumbnail[aria-current=true]{opacity:1}
.gallery-thumbnail[aria-current=true]{border-color:#012d20;box-shadow:0 0 0 2px #f8faf4,0 0 0 3px #012d20}
.gallery-thumbnail-number{position:absolute;bottom:4px;left:4px;display:grid;place-items:center;min-width:20px;height:19px;padding:0 4px;border-radius:3px;background:#082c20c9;color:white;font-size:9px;line-height:1}
.gallery-plan-navigation{display:flex;align-items:center;min-width:0;padding-left:2px}
.gallery-plan-button{position:relative;width:100%;padding:9px 7px 11px;background:white;border:1px solid #c9d7c0;border-radius:7px;box-shadow:0 3px 12px #012d2008;text-align:left}
.gallery-plan-button img{width:100%;height:76px;display:block;object-fit:contain;margin-bottom:10px;background:white}
.gallery-plan-label{display:inline-block;font-size:12px;font-weight:500;line-height:1.5}
.gallery-plan-arrow{float:right;font-size:15px;line-height:1.3}
.gallery-plan-button:hover,.gallery-plan-button[aria-pressed=true]{background:#e3ecdc;border-color:#587d49}
.gallery-plan-button[aria-pressed=true]{box-shadow:0 0 0 1px #315837}
.gallery-without-plan{grid-template-columns:minmax(0,1fr)}
.gallery-without-plan .gallery-dialog-thumbnails{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start}
.gallery-is-floating button:focus-visible{outline:3px solid #549dcf;outline-offset:3px}
.gallery-is-floating .gallery-thumbnail:focus-visible{outline-offset:1px}
.gallery-showing-plan .lightbox-stage{background:#fff}

@media(max-width:900px){
  .gallery-dialog-content{grid-template-columns:minmax(0,1fr) 180px}
  .gallery-dialog-sidebar{grid-template-columns:minmax(0,1fr) 68px;gap:9px;padding:12px 9px}
  .gallery-plan-button{padding:8px 5px}
  .gallery-plan-button img{height:65px}
  .gallery-plan-label{font-size:11px}
  .gallery-plan-arrow{font-size:13px}
  .gallery-dialog-view{padding:12px 12px 0}
}
@media(max-width:650px){
  .ficha-lightbox.gallery-is-floating{width:calc(100% - 8vw);max-width:92vw;height:min(78dvh,620px);max-height:85dvh;border-radius:12px}
  .ficha-lightbox.gallery-is-floating[open]{grid-template-rows:62px minmax(0,1fr)}
  .gallery-is-floating .gallery-dialog-header{padding:0 65px 0 16px;gap:10px}
  .gallery-is-floating .gallery-dialog-title{font-size:14px}
  .gallery-is-floating .gallery-dialog-position{font-size:10px}
  .ficha-lightbox.gallery-is-floating .popup-close{top:9px;right:9px}
  .gallery-dialog-content{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 102px}
  .gallery-dialog-view{padding:8px 8px 0}
  .ficha-lightbox.gallery-is-floating #lightbox-caption{padding:12px 3px;font-size:9px;min-height:43px}
  .ficha-lightbox.gallery-is-floating .slide-arrow{width:44px;height:44px;font-size:25px}
  .ficha-lightbox.gallery-is-floating .slide-arrow.previous{left:8px}
  .ficha-lightbox.gallery-is-floating .slide-arrow.next{right:8px}
  .gallery-dialog-sidebar{grid-template-columns:minmax(0,1fr) 76px;gap:10px;padding:10px 11px;border-left:0;border-top:1px solid #dbe4d6}
  .gallery-dialog-thumbnails{flex-direction:row;gap:8px;padding:4px;align-items:stretch}
  .gallery-thumbnail{height:100%;width:auto;aspect-ratio:1.25}
  .gallery-plan-navigation{padding-left:0}
  .gallery-plan-button{display:grid;grid-template-columns:1fr auto;align-items:center;padding:6px 7px;height:100%}
  .gallery-plan-button img{grid-column:1/-1;width:100%;height:42px;margin:0}
  .gallery-plan-label{font-size:10px}
  .gallery-plan-arrow{font-size:13px}
  .gallery-without-plan .gallery-dialog-thumbnails{display:flex}
}
@media(max-height:520px) and (min-width:651px){
  .ficha-lightbox.gallery-is-floating{height:88dvh}
  .ficha-lightbox.gallery-is-floating[open]{grid-template-rows:52px minmax(0,1fr)}
  .ficha-lightbox.gallery-is-floating .popup-close{top:4px}
  .gallery-is-floating .gallery-dialog-header{padding-left:18px}
  .ficha-lightbox.gallery-is-floating #lightbox-caption{padding:9px 4px;min-height:35px}
}
@media(prefers-reduced-motion:reduce){.gallery-thumbnail{transition:none}}
