/* Solo afecta al widget Galería Inteligente. No cambia secciones/columnas de Elementor. */
.psxxi-gallery {
  --psxxi-cols: 3;
  --psxxi-gap: 12px;
  --psxxi-row: 82px;
  --psxxi-radius: 14px;
  --psxxi-accent: #ffe135;
  --psxxi-caption-color: #fff;
  width: 100%;
  isolation: isolate;
}
.psxxi-gallery *, .psxxi-gallery *::before, .psxxi-gallery *::after { box-sizing: border-box; }
.psxxi-gallery--grid,
.psxxi-gallery--mosaic,
.psxxi-gallery--editorial {
  display: grid;
  grid-template-columns: repeat(var(--psxxi-cols), minmax(0, 1fr));
  gap: var(--psxxi-gap);
  align-items: stretch;
}
.psxxi-gallery--mosaic,
.psxxi-gallery--editorial {
  grid-auto-rows: var(--psxxi-row);
  grid-auto-flow: dense;
}
.psxxi-gallery--mosaic .psxxi-gallery__item,
.psxxi-gallery--editorial .psxxi-gallery__item {
  grid-column: span var(--psxxi-colspan, 1);
  grid-row: span var(--psxxi-rowspan, 2);
  min-height: 0;
}
.psxxi-gallery--grid .psxxi-gallery__item { aspect-ratio: 4 / 3; }
.psxxi-ratio--1-1.psxxi-gallery--grid .psxxi-gallery__item { aspect-ratio: 1 / 1; }
.psxxi-ratio--3-2.psxxi-gallery--grid .psxxi-gallery__item { aspect-ratio: 3 / 2; }
.psxxi-ratio--3-4.psxxi-gallery--grid .psxxi-gallery__item { aspect-ratio: 3 / 4; }
.psxxi-gallery--masonry { display: block; columns: var(--psxxi-cols); column-gap: var(--psxxi-gap); }
.psxxi-gallery__item {
  position: relative;
  overflow: hidden;
  min-width: 0;
  margin: 0 !important;
  border-radius: var(--psxxi-radius);
  background: #232323;
  transform: translateZ(0);
  box-shadow: 0 3px 10px rgba(0,0,0,.09);
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease;
}
.psxxi-gallery--masonry .psxxi-gallery__item {
  display: inline-block;
  width: 100%;
  vertical-align: top;
  margin-bottom: var(--psxxi-gap) !important;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.psxxi-gallery__link {
  position: relative;
  display: block;
  height: 100%;
  width: 100%;
  overflow: hidden;
  cursor: default;
  text-decoration: none !important;
  color: inherit;
}
a.psxxi-gallery__link { cursor: zoom-in; }
.psxxi-gallery__image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  object-position: center;
  border: 0 !important;
  border-radius: 0 !important;
  transition: transform .65s cubic-bezier(.2,.7,.2,1), filter .5s ease;
}
.psxxi-gallery--masonry .psxxi-gallery__link { height: auto; }
.psxxi-gallery--masonry .psxxi-gallery__image { height: auto !important; object-fit: contain; }
.psxxi-gallery__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 27%, rgba(0,0,0,.48) 100%);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.psxxi-gallery--overlay .psxxi-gallery__item:is(:hover,:focus-within) .psxxi-gallery__veil { opacity: 1; }
.psxxi-gallery__caption {
  position: absolute;
  z-index: 3;
  left: 16px;
  right: 16px;
  bottom: 14px;
  font-size: clamp(12px,1.5vw,16px);
  line-height: 1.3;
  font-weight: 700;
  color: var(--psxxi-caption-color);
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.psxxi-gallery__item:is(:hover,:focus-within) .psxxi-gallery__caption,
.psxxi-gallery--captions-always .psxxi-gallery__caption { opacity: 1; transform: none; }
.psxxi-gallery--captions-always .psxxi-gallery__veil { opacity: .55; }
.psxxi-gallery__zoom-icon {
  position: absolute;
  z-index: 4;
  left: 50%; top: 50%;
  width: 52px; height: 52px;
  margin-left: -26px; margin-top: -26px;
  display: grid; place-items: center;
  color: #1d1d1d;
  background: var(--psxxi-accent);
  border-radius: 50%;
  opacity: 0;
  transform: scale(.76) translateY(10px);
  transition: opacity .3s ease, transform .4s cubic-bezier(.18,.85,.3,1.2);
  pointer-events: none;
  box-shadow: 0 7px 28px rgba(0,0,0,.25);
}
.psxxi-gallery__zoom-icon svg { display: block; width: 23px; height: 23px; }
.psxxi-gallery__item:is(:hover,:focus-within) .psxxi-gallery__zoom-icon { opacity: 1; transform: scale(1) translateY(0); }
.psxxi-hover--zoom .psxxi-gallery__item:is(:hover,:focus-within) .psxxi-gallery__image { transform: scale(1.065); }
.psxxi-hover--lift .psxxi-gallery__item:is(:hover,:focus-within) { transform: translateY(-5px); box-shadow: 0 20px 34px rgba(0,0,0,.22); z-index: 2; }
.psxxi-hover--gray .psxxi-gallery__image { filter: grayscale(1); }
.psxxi-hover--gray .psxxi-gallery__item:is(:hover,:focus-within) .psxxi-gallery__image { filter: grayscale(0); }
.psxxi-hover--tilt .psxxi-gallery__item:is(:hover,:focus-within) .psxxi-gallery__image { transform: scale(1.095) rotate(1.7deg); }
.psxxi-gallery__link:focus-visible { outline: 3px solid var(--psxxi-accent); outline-offset: -4px; }
.psxxi-gallery-empty { padding: 28px; border: 1px dashed #b6b6b6; border-radius: 12px; color: #535353; text-align: center; }
@media (max-width: 1024px) {
  .psxxi-gallery { --psxxi-cols: 2; --psxxi-row: 72px; }
}
@media (max-width: 767px) {
  .psxxi-gallery { --psxxi-cols: 1; }
  .psxxi-gallery--mosaic, .psxxi-gallery--editorial { grid-auto-rows: auto; }
  .psxxi-gallery--mosaic .psxxi-gallery__item,
  .psxxi-gallery--editorial .psxxi-gallery__item {
    grid-column: auto !important;
    grid-row: auto !important;
    aspect-ratio: 4 / 3;
  }
  .psxxi-gallery--editorial .psxxi-gallery__item:first-child { aspect-ratio: 3 / 2; }
  .psxxi-gallery__zoom-icon { width: 42px; height: 42px; margin-left: -21px; margin-top: -21px; }
  .psxxi-gallery__caption { opacity: 1; transform: none; }
  .psxxi-gallery--overlay:has(.psxxi-gallery__caption) .psxxi-gallery__veil { opacity: .38; }
}
@media (hover: none) {
  .psxxi-gallery__zoom-icon { opacity: 0; }
  .psxxi-gallery__caption { opacity: 1; transform: none; }
  .psxxi-gallery--overlay .psxxi-gallery__veil { opacity: .25; }
}
@media (prefers-reduced-motion: reduce) {
  .psxxi-gallery__item,
  .psxxi-gallery__image,
  .psxxi-gallery__caption,
  .psxxi-gallery__veil,
  .psxxi-gallery__zoom-icon { transition: none !important; animation: none !important; }
  .psxxi-hover--lift .psxxi-gallery__item:is(:hover,:focus-within),
  .psxxi-hover--zoom .psxxi-gallery__item:is(:hover,:focus-within) .psxxi-gallery__image,
  .psxxi-hover--tilt .psxxi-gallery__item:is(:hover,:focus-within) .psxxi-gallery__image { transform: none; }
}
