/* Galeria restrita aos detalhes do produto e aos seus controles no Editor. */
/* A altura depende da tela, nunca das dimensões da foto selecionada. */
#productDetailsModal #modalProdImage {
 display:block;
 width:100% !important;
 max-width:100% !important;
 height:clamp(220px,42vh,420px) !important;
 min-height:0 !important;
 max-height:none !important;
 aspect-ratio:auto !important;
 object-fit:contain !important;
 object-position:center !important;
 margin:0;
}
#productGallery { margin-top:12px; min-width:0; }
#productGallery[hidden],#productGallery [hidden] { display:none !important; }
body:not(.editor-active) #productGallery .product-gallery-toolbar,
body:not(.editor-active) #productGallery .product-gallery-thumb.is-empty { display:none !important; }
.product-gallery-toolbar { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; margin-bottom:10px; }
.product-gallery-toolbar button { color:#b7dfff; background:#102138; border:1px solid #34506e; padding:8px 10px; border-radius:8px; font:inherit; font-size:12px; font-weight:600; cursor:pointer; min-height:40px; }
.product-gallery-toolbar button[aria-pressed="true"] { border-color:#38bdf8; color:#fff; }
.product-gallery-thumbs,.editor-gallery-slots { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.product-gallery-thumbs { grid-template-columns:repeat(var(--gallery-columns,5),minmax(0,1fr)); }
.product-gallery-thumb,.product-gallery-main-thumb { position:relative; display:flex; align-items:center; justify-content:center; align-self:start; box-sizing:border-box; min-width:0; min-height:0; width:100%; aspect-ratio:1; padding:4px; border:2px solid #34506e; border-radius:9px; background:#091321; color:#9bb0c9; cursor:pointer; overflow:hidden; }
/* Fora do fluxo, fotos verticais ou horizontais não alteram a altura da linha. */
.product-gallery-thumb img,.product-gallery-main-thumb img { position:absolute; inset:4px; display:block; width:calc(100% - 8px); height:calc(100% - 8px); max-width:none; max-height:none; object-fit:contain; object-position:center; margin:0; }
.product-gallery-thumb img[hidden] { display:none; }
.product-gallery-thumb:not(.is-empty) span { position:absolute; bottom:3px; right:3px; background:#07111fe6; border-radius:4px; padding:1px 5px; color:#fff; font-size:10px; }
.product-gallery-thumb.is-empty { border-style:dashed; font-size:11px; }
.product-gallery-thumb:disabled { cursor:default; opacity:.6; }
.product-gallery-thumb.is-selected,.product-gallery-main-thumb.is-selected { border-color:#38bdf8; box-shadow:0 0 0 2px #38bdf82b; }
.product-gallery-thumb:focus-visible,.product-gallery-main-thumb:focus-visible,.product-gallery-toolbar button:focus-visible { outline:3px solid #7dd3fc; outline-offset:2px; }
.editor-gallery-slots { margin-bottom:14px; }
.editor-panel .editor-gallery-slot { position:relative; display:flex; align-items:center; justify-content:center; align-self:start; box-sizing:border-box; min-width:0; min-height:44px; width:100%; aspect-ratio:1; padding:3px; border-width:2px; background:#091321; color:#d9e7f7; overflow:hidden; }
.editor-gallery-slot img { position:absolute; inset:3px; display:block; width:calc(100% - 6px); height:calc(100% - 6px); max-height:none; object-fit:contain; object-position:center; margin:0; }
.editor-panel .editor-gallery-slot[aria-pressed="true"] { border-color:#38bdf8; }
.editor-product-gallery input[type="file"] { max-width:100%; }
@media(max-width:400px) { .product-gallery-thumbs { gap:5px; } }
