/* DigiFaster: galería con visor y paginación (v4) - solo presentación */
body.df-detail-page .df-gallery-section{background:#fff;color:#15203b}
body.df-detail-page .df-gallery-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:16px}
body.df-detail-page .df-gallery-heading h2{margin:0!important;color:#10172e!important;font-weight:850}
body.df-detail-page .df-gallery-total{font-size:12px;font-weight:800;border-radius:999px;background:#eeecff;color:#5038ce;padding:7px 11px;white-space:nowrap}
body.df-detail-page .df-gallery-section .df-product-media{grid-template-columns:repeat(auto-fill,minmax(min(100%,185px),1fr));gap:14px}
body.df-detail-page .df-gallery-section .df-product-media-card{min-width:0;padding:8px;border-radius:18px;background:#f8faff;border:1px solid #e5eaf5;display:block}
body.df-detail-page .df-gallery-trigger{display:flex;flex-direction:column;gap:8px;padding:0;margin:0;border:0;background:transparent;width:100%;min-width:0;text-align:left;cursor:zoom-in;line-height:1.35;color:#1c2542;font:inherit}
body.df-detail-page .df-gallery-trigger:focus-visible{outline:3px solid #6d56f6;outline-offset:4px;border-radius:10px}
body.df-detail-page .df-gallery-thumb-visual{position:relative;display:block;width:100%;aspect-ratio:4/3;overflow:hidden;border-radius:12px;background:#e7eaff}
body.df-detail-page .df-gallery-section .df-gallery-trigger img,
body.df-detail-page .df-gallery-section .df-gallery-trigger video{display:block;width:100%;height:100%;aspect-ratio:4/3;object-fit:cover;border-radius:12px;transition:transform .23s ease;pointer-events:none}
body.df-detail-page .df-gallery-trigger:hover img,body.df-detail-page .df-gallery-trigger:hover video{transform:scale(1.055)}
body.df-detail-page .df-gallery-section .df-gallery-trigger .df-doc-icon{width:100%;height:100%;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,#f0edff,#e8f4ff);font-size:45px}
body.df-detail-page .df-gallery-expand-icon{position:absolute;bottom:9px;right:9px;display:grid;place-items:center;width:30px;height:30px;border-radius:9px;background:rgba(8,13,37,.8);color:#fff;font-size:20px;font-weight:800;transition:transform .2s ease}
body.df-detail-page .df-gallery-trigger:hover .df-gallery-expand-icon{transform:scale(1.08)}
body.df-detail-page .df-gallery-thumb-title{display:none!important}
body.df-detail-page .df-gallery-hint{color:#57627c;font-size:12px;line-height:1.5;margin:14px 0 0}
/* Visor oscurecido, centrado, por encima de header, menús y overlays del sitio. */
body.df-detail-page .df-gallery-modal[hidden]{display:none!important}
body.df-detail-page .df-gallery-modal{position:fixed;inset:0;z-index:2147483600;display:grid;place-items:center;padding:clamp(8px,2vw,24px);color:#fff;font-family:inherit}
body.df-detail-page .df-gallery-shade{position:absolute;inset:0;background:rgba(2,5,19,.9);backdrop-filter:blur(8px)}
body.df-detail-page .df-gallery-dialog{position:relative;display:flex;flex-direction:column;width:min(100%,1120px);max-height:calc(100dvh - 24px);min-height:0;border-radius:20px;overflow:hidden;background:#10152b;border:1px solid rgba(255,255,255,.18);box-shadow:0 34px 90px rgba(0,0,0,.6)}
body.df-detail-page .df-gallery-toolbar{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.11)}
body.df-detail-page .df-gallery-modal-title{font-size:clamp(14px,2.2vw,18px);font-weight:750;line-height:1.3;color:#fff;margin:0;max-width:calc(100% - 60px);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
body.df-detail-page .df-gallery-close{flex:none;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.15);border-radius:12px;color:#fff;width:40px;height:40px;font-size:30px;font-weight:500;line-height:1;display:grid;place-items:center;cursor:pointer;padding:0}
body.df-detail-page .df-gallery-close:hover{background:#5546d9}
body.df-detail-page .df-gallery-view-row{display:grid;grid-template-columns:54px minmax(0,1fr) 54px;align-items:center;gap:8px;padding:12px;min-height:0;min-width:0;width:100%;flex:1 1 auto}
/* FIX: el visor siempre ocupa la segunda columna, incluso si ambas flechas están ocultas
   cuando solamente existe un recurso. Sin esto CSS Grid lo colocaba en la 1.ª (54 px). */
body.df-detail-page .df-gallery-stage{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:center;flex-direction:column;min-width:0;width:100%;height:min(70dvh,700px);min-height:0;max-height:calc(100dvh - 190px);overflow:hidden;border-radius:13px;background:#080d1d;text-align:center}
body.df-detail-page .df-gallery-stage>img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;min-width:0;min-height:0;object-fit:contain;border-radius:4px}
body.df-detail-page .df-gallery-stage>video{display:block;width:100%;height:100%;max-width:100%;max-height:100%;min-width:0;min-height:0;object-fit:contain;border-radius:6px;background:#000}
body.df-detail-page .df-gallery-stage>iframe{display:block;width:100%;height:100%;min-height:0;border:0;background:white;border-radius:6px}
body.df-detail-page .df-gallery-stage>audio{display:block;width:min(100%,520px);margin:50px auto}
body.df-detail-page .df-gallery-arrow{display:grid;place-items:center;width:48px;height:60px;padding:0;background:rgba(255,255,255,.09);color:#fff;border:1px solid rgba(255,255,255,.13);border-radius:12px;font-size:42px;line-height:1;cursor:pointer;transition:background .2s ease}
/* Posiciones fijas: ocultar las flechas nunca colapsa el espacio del recurso. */
body.df-detail-page .df-gallery-arrow[data-dfg-prev]{grid-column:1;grid-row:1}
body.df-detail-page .df-gallery-arrow[data-dfg-next]{grid-column:3;grid-row:1}
body.df-detail-page .df-gallery-arrow:hover{background:#5546d9}
body.df-detail-page .df-gallery-arrow[hidden]{display:none!important}
body.df-detail-page .df-gallery-toolbar-bottom{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 17px;border-top:1px solid rgba(255,255,255,.12);min-height:60px}
body.df-detail-page .df-gallery-counter{color:#dddffc;font-size:13px;font-weight:750;white-space:nowrap}
body.df-detail-page .df-gallery-pages{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:5px}
body.df-detail-page .df-gallery-page{min-width:29px;height:30px;padding:0 5px;border-radius:8px;border:1px solid rgba(255,255,255,.22);background:rgba(255,255,255,.06);color:#fff;cursor:pointer;font-weight:750;font-size:12px}
body.df-detail-page .df-gallery-page[aria-current="page"]{background:#6451ed;border-color:#6451ed}
body.df-detail-page .df-gallery-ellipsis{color:#c7c8d7;padding:0 3px;font-size:13px}
body.df-detail-page .df-gallery-fallback{display:grid;place-items:center;gap:14px;max-width:540px;padding:35px 18px;color:#f6f7ff;line-height:1.5}
body.df-detail-page .df-gallery-fallback .df-gallery-fallback-icon{font-size:58px}
body.df-detail-page .df-gallery-external{display:inline-flex;justify-content:center;align-items:center;text-decoration:none;border-radius:12px;padding:12px 20px;background:#6351e8;color:white;font-weight:850}
body.df-detail-page .df-gallery-doc-link{font-size:12px;margin:4px auto 2px;padding:5px 8px;color:#d8d2ff;text-decoration:underline}
body.df-detail-page .df-gallery-modal button:focus-visible,body.df-detail-page .df-gallery-modal a:focus-visible{outline:3px solid #ad9cfd;outline-offset:3px}
@media(max-width:640px){
  body.df-detail-page .df-gallery-modal{padding:6px}
  body.df-detail-page .df-gallery-dialog{max-height:calc(100dvh - 12px);border-radius:14px}
  body.df-detail-page .df-gallery-toolbar{padding:10px}
  body.df-detail-page .df-gallery-view-row{grid-template-columns:32px minmax(0,1fr) 32px;gap:3px;padding:5px}
  body.df-detail-page .df-gallery-arrow{width:31px;height:54px;font-size:32px;border-radius:8px}
  body.df-detail-page .df-gallery-stage{height:min(66dvh,560px);min-height:0;max-height:calc(100dvh - 165px)}
  body.df-detail-page .df-gallery-stage>img,body.df-detail-page .df-gallery-stage>video{max-height:100%}
  body.df-detail-page .df-gallery-stage>iframe{height:100%}
  body.df-detail-page .df-gallery-toolbar-bottom{flex-direction:column;justify-content:center;gap:6px;padding:8px}
  body.df-detail-page .df-gallery-page{min-width:27px;height:28px}
}
@media(prefers-reduced-motion:reduce){body.df-detail-page .df-gallery-trigger img,body.df-detail-page .df-gallery-trigger video{transition:none}}
