/* AgroVentas - Carrusel multimedia y modo cine para la ficha pública */
.ag-gallery { --ag-dark:#101828; position:relative; width:100%; color:var(--ag-dark); }
.ag-gallery__stage { position:relative; aspect-ratio: 1 / 1; overflow:hidden; background:#f4f6f8; border:1px solid rgba(17,24,39,.08); border-radius:20px; box-shadow:0 6px 20px rgba(17,24,39,.07); }
.ag-gallery__slide { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:#f1f3f5; }
.ag-gallery__slide[hidden] { display:none !important; }
.ag-gallery__zoom { display:flex; align-items:center; justify-content:center; position:relative; width:100%; height:100%; margin:0; border:0; padding:0; background:transparent; cursor:zoom-in; }
.ag-gallery__zoom img { width:100%; height:100%; object-fit:contain; display:block; }
.ag-gallery__zoom-hint { position:absolute; left:50%; bottom:19px; transform:translateX(-50%); max-width:calc(100% - 20px); white-space:nowrap; padding:9px 13px; border-radius:999px; color:#fff; background:rgba(12,18,30,.66); font-size:.81rem; font-weight:650; opacity:0; transition:opacity .15s; pointer-events:none; }
.ag-gallery__zoom:hover .ag-gallery__zoom-hint, .ag-gallery__zoom:focus-visible .ag-gallery__zoom-hint { opacity:1; }
.ag-gallery__slide video, .ag-gallery__slide iframe { width:100%; height:100%; border:0; background:#000; object-fit:contain; display:block; }
.ag-gallery__arrow { position:absolute; top:50%; transform:translateY(-50%); z-index:5; background:rgba(11,17,30,.72); color:#fff; border:1px solid rgba(255,255,255,.24); width:43px; height:49px; border-radius:12px; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:1.15rem; transition:background .15s; }
.ag-gallery__arrow:hover, .ag-gallery__arrow:focus-visible { background:rgba(11,17,30,.93); color:#fff; }
.ag-gallery__arrow--prev { left:10px; }
.ag-gallery__arrow--next { right:10px; }
.ag-gallery__counter { position:absolute; z-index:5; left:13px; top:13px; color:#fff; background:rgba(11,17,30,.75); border-radius:999px; font-size:.83rem; font-weight:650; padding:7px 12px; pointer-events:none; }
.ag-gallery__expand { position:absolute; z-index:5; top:12px; right:12px; display:flex; justify-content:center; align-items:center; width:39px; height:39px; border-radius:11px; color:#fff; background:rgba(11,17,30,.75); border:1px solid rgba(255,255,255,.25); cursor:pointer; }
.ag-gallery__expand:hover { background:#111827; color:#fff; }
.ag-gallery__thumbs { display:flex; gap:10px; overflow-x:auto; scroll-snap-type:x proximity; padding:13px 3px 9px; scrollbar-width:thin; -webkit-overflow-scrolling:touch; }
.ag-gallery__thumb { position:relative; flex:0 0 85px; width:85px; height:74px; border:2px solid transparent; padding:0; overflow:hidden; border-radius:11px; scroll-snap-align:center; background:#e6e9ee; box-shadow:0 2px 7px rgba(0,0,0,.07); cursor:pointer; }
.ag-gallery__thumb.is-active, .ag-gallery__thumb:focus-visible { border-color:#111827; outline:1px solid #111827; outline-offset:1px; }
.ag-gallery__thumb img, .ag-gallery__thumb-video { width:100%; height:100%; object-fit:cover; display:flex; align-items:center; justify-content:center; }
.ag-gallery__thumb-video { font-size:25px; color:#fff; background:linear-gradient(135deg,#2b3344,#111827); }
.ag-gallery__thumb-play { position:absolute; inset:0; background:rgba(0,0,0,.25); display:flex; align-items:center; justify-content:center; color:#fff; font-size:20px; text-shadow:0 2px 6px #000; }
.ag-gallery__hint { font-size:.81rem; color:#667085; margin:7px 1px 0; line-height:1.5; }
.ag-gallery__empty { display:grid; place-items:center; aspect-ratio:1/1; background:#f3f4f6; border-radius:18px; color:#667085; padding:24px; text-align:center; }
.ag-gallery__cinema-bar { display:none; }
/* Ventana emergente: fondo visible, atenuado y con un pequeño desenfoque. */
.ag-gallery__backdrop {
  position:fixed !important;
  inset:0 !important;
  z-index:2147483645 !important;
  background:rgba(4, 10, 20, .64);
  -webkit-backdrop-filter:blur(3px);
  backdrop-filter:blur(3px);
  cursor:zoom-out;
}
/* Se utiliza el mismo carrusel del artículo, sin duplicar fotos ni videos. */
.ag-gallery.is-cinema {
  position:fixed !important;
  inset:auto !important;
  top:50% !important;
  left:50% !important;
  transform:translate(-50%, -50%) !important;
  box-sizing:border-box;
  width:min(980px, calc(100vw - 68px)) !important;
  max-width:calc(100vw - 24px) !important;
  height:min(760px, 82vh) !important;
  height:min(760px, 82dvh) !important;
  max-height:calc(100dvh - 32px) !important;
  margin:0 !important;
  padding:0 !important;
  background:#111a28 !important;
  color:#fff;
  z-index:2147483646 !important;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.22);
  border-radius:20px;
  box-shadow:0 28px 85px rgba(0,0,0,.48);
}
.ag-gallery.is-cinema .ag-gallery__cinema-bar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 15px 10px 20px;
  gap:12px;
  flex:0 0 56px;
  min-height:0;
  color:#fff;
  background:#111a28;
}
.ag-gallery__close {
  border:1px solid rgba(255,255,255,.25);
  border-radius:11px;
  background:#303b4a;
  color:#fff;
  width:41px;
  height:38px;
  font-size:26px;
  line-height:1;
  cursor:pointer;
  transition:background .15s;
}
.ag-gallery__close:hover, .ag-gallery__close:focus-visible { background:#4a586c; color:#fff; }
.ag-gallery.is-cinema .ag-gallery__stage {
  min-height:0;
  width:100%;
  height:auto;
  flex:1 1 auto;
  aspect-ratio:auto;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:#080e18;
}
.ag-gallery.is-cinema .ag-gallery__slide { background:#080e18; }
.ag-gallery.is-cinema .ag-gallery__zoom { cursor:default; }
.ag-gallery.is-cinema .ag-gallery__zoom img {
  width:100%;
  height:100%;
  max-height:100%;
  object-fit:contain;
}
.ag-gallery.is-cinema .ag-gallery__slide video,
.ag-gallery.is-cinema .ag-gallery__slide iframe { object-fit:contain; }
.ag-gallery.is-cinema .ag-gallery__zoom-hint,
.ag-gallery.is-cinema .ag-gallery__expand { display:none; }
.ag-gallery.is-cinema .ag-gallery__thumbs {
  flex:0 0 auto;
  max-height:100px;
  padding:10px 15px 12px;
  justify-content:flex-start;
  background:#111a28;
}
.ag-gallery.is-cinema .ag-gallery__thumb { flex:0 0 73px; width:73px; height:63px; }
.ag-gallery.is-cinema .ag-gallery__thumb.is-active { border-color:#fff; outline-color:#fff; }
.ag-gallery.is-cinema .ag-gallery__hint { display:none; }
.ag-gallery.is-cinema .ag-gallery__arrow { width:45px; height:54px; }
.ag-gallery.is-cinema .ag-gallery__counter { top:12px; }
body.ag-gallery-no-scroll, html.ag-gallery-no-scroll { overflow:hidden !important; }
@media (max-width:767.98px) {
  .ag-gallery__stage { border-radius:15px; }
  .ag-gallery__thumb { flex-basis:74px; width:74px; height:67px; }
  .ag-gallery__zoom-hint { opacity:.9; font-size:.75rem; bottom:12px; }
  .ag-gallery__arrow { width:36px; height:44px; border-radius:9px; font-size:1rem; }
  .ag-gallery__arrow--prev { left:6px; }
  .ag-gallery__arrow--next { right:6px; }
  .ag-gallery__counter { top:9px; left:9px; }
  .ag-gallery__expand { top:8px; right:8px; }
  .ag-gallery.is-cinema {
    width:calc(100vw - 26px) !important;
    max-width:calc(100vw - 26px) !important;
    height:80vh !important;
    height:80dvh !important;
    max-height:calc(100dvh - 28px) !important;
    border-radius:16px;
  }
  .ag-gallery.is-cinema .ag-gallery__cinema-bar { padding:7px 12px; flex-basis:49px; }
  .ag-gallery.is-cinema .ag-gallery__thumbs { max-height:82px; padding:7px 10px 9px; }
  .ag-gallery.is-cinema .ag-gallery__thumb { flex-basis:62px; width:62px; height:57px; }
  .ag-gallery.is-cinema .ag-gallery__arrow { width:35px; height:46px; }
}
@media (prefers-reduced-motion:reduce) {
  .ag-gallery__zoom-hint,.ag-gallery__arrow { transition:none; }
}

