/* Galerias de Departamento y Penthouse (seccion #departamentos) */
.ptg { background: #fff; }
.ptg-stage {
  position: relative; aspect-ratio: 16 / 11; overflow: hidden;
  background: #06283d; touch-action: pan-y; user-select: none;
}
.ptg-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.ptg-slide.on { opacity: 1; z-index: 1; }
.ptg-slide img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); }
/* Zoom lento tipo Ken Burns en la foto activa */
.ptg-slide.on img { animation: ptg-kb 7s cubic-bezier(.22, 1, .36, 1) forwards; }
@keyframes ptg-kb { from { transform: scale(1.14); } to { transform: scale(1.02); } }
.ptg-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(6, 40, 61, .72), rgba(6, 40, 61, 0) 45%);
}
.ptg-tag {
  position: absolute; z-index: 3; top: 16px; left: 16px; padding: 8px 14px; border-radius: 2px;
  background: rgba(255, 255, 255, .95); color: #06283d;
  font-family: var(--font-sans); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
}
.ptg-count {
  position: absolute; z-index: 3; top: 16px; right: 16px; padding: 6px 11px; border-radius: 9999px;
  background: rgba(6, 40, 61, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; font-family: var(--font-sans); font-size: 11px; letter-spacing: .12em; font-variant-numeric: tabular-nums;
}
.ptg-cap {
  position: absolute; z-index: 3; left: 20px; bottom: 18px; margin: 0; max-width: calc(100% - 170px);
  color: #fff; font-family: var(--font-display); font-size: 20px; line-height: 1.25;
  text-shadow: 0 2px 12px rgba(6, 40, 61, .5);
  animation: ptg-up .8s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes ptg-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ptg-nav {
  position: absolute; z-index: 3; top: 50%; width: 44px; height: 44px; margin-top: -22px;
  display: grid; place-items: center; border: 0; border-radius: 9999px; cursor: pointer;
  background: rgba(255, 255, 255, .9); color: #06283d; box-shadow: 0 6px 18px -6px rgba(6, 40, 61, .5);
  opacity: 0; transition: opacity .3s, transform .3s, background-color .3s;
}
.ptg-prev { left: 14px; }
.ptg-next { right: 14px; }
.ptg-stage:hover .ptg-nav, .ptg-nav:focus-visible { opacity: 1; }
.ptg-nav:hover { background: #fff; transform: scale(1.08); }
.ptg-nav:focus-visible, .ptg-zoom:focus-visible, .ptg-th:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ptg-zoom {
  position: absolute; z-index: 3; right: 16px; bottom: 16px; padding: 8px 12px; border-radius: 2px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .7); background: rgba(6, 40, 61, .25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; font-family: var(--font-sans); font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  transition: background-color .3s, color .3s;
}
.ptg-zoom:hover { background: #fff; color: #06283d; }
/* Barra de progreso del cambio automatico */
.ptg-bar {
  position: absolute; z-index: 4; left: 0; bottom: 0; height: 3px; width: 0;
  background: #fff; animation: ptg-bar 5s linear forwards;
}
@keyframes ptg-bar { to { width: 100%; } }

.ptg-thumbs {
  position: relative; display: flex; gap: 4px; padding: 4px; overflow-x: auto;
  background: #fff; scrollbar-width: none;
}
.ptg-thumbs::-webkit-scrollbar { display: none; }
.ptg-th {
  position: relative; flex: 0 0 calc((100% - 16px) / 4.5); aspect-ratio: 4 / 3; padding: 0; border: 0;
  overflow: hidden; cursor: pointer; background: #e9f3f8; opacity: .5;
  transition: opacity .35s;
}
.ptg-th img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s; }
.ptg-th:hover { opacity: .85; }
.ptg-th:hover img { transform: scale(1.08); }
.ptg-th.on { opacity: 1; }
.ptg-th.on::after { content: ""; position: absolute; inset: 0; border: 2px solid #12678c; }

/* Pantalla completa */
.ptg-lb {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0;
  padding: 60px 16px 70px; border: 0; background: rgba(6, 40, 61, .96); color: #fff;
}
.ptg-lb[open] { display: grid; place-items: center; }
.ptg-lb::backdrop { background: rgba(6, 40, 61, .85); }
.ptg-lb-img {
  max-width: 100%; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px);
  object-fit: contain; border-radius: 3px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
  animation: ptg-lbin .5s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes ptg-lbin { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.ptg-lb-cap {
  position: absolute; left: 16px; right: 16px; bottom: 22px; margin: 0; text-align: center;
  font-family: var(--font-display); font-size: 18px;
}
.ptg-lb-cap span { margin-left: 12px; font-family: var(--font-sans); font-size: 12px; letter-spacing: .12em; opacity: .7; }
.ptg-lb-x {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 9999px;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
}
.ptg-lb-x:hover { background: rgba(255, 255, 255, .24); }
.ptg-lb .ptg-nav { opacity: 1; background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.ptg-lb .ptg-nav:hover { background: rgba(255, 255, 255, .28); }

/* Moviles y pantallas tactiles: flechas siempre visibles y mas pequenas */
@media (hover: none) {
  .ptg-nav { opacity: .9; }
}
@media (max-width: 639px) {
  .ptg-stage { aspect-ratio: 4 / 3; }
  .ptg-nav { width: 36px; height: 36px; margin-top: -18px; }
  .ptg-prev { left: 10px; }
  .ptg-next { right: 10px; }
  .ptg-tag { top: 12px; left: 12px; }
  .ptg-count { top: 12px; right: 12px; }
  .ptg-cap { left: 14px; bottom: 14px; font-size: 16px; max-width: calc(100% - 130px); }
  .ptg-zoom { right: 12px; bottom: 12px; padding: 7px 9px; font-size: 9px; }
  .ptg-th { flex-basis: calc((100% - 12px) / 3.6); }
  .ptg-lb { padding: 56px 8px 70px; }
  .ptg-lb .ptg-nav { top: auto; bottom: 14px; margin-top: 0; }
  .ptg-lb-cap { bottom: 64px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .ptg-slide { transition: none; }
  .ptg-slide.on img, .ptg-cap, .ptg-lb-img { animation: none; }
  .ptg-th img, .ptg-nav { transition: none; }
}

/* Espacio entre la lista de caracteristicas y el boton */
#departamentos article ul { margin-bottom: 32px; }
