.product-gallery{min-width:0}
.gallery-cover{display:block;position:relative;width:100%;padding:0;border-radius:10px;background:var(--tint);overflow:hidden}
.product .gallery-cover img{display:block;width:100%;height:auto;aspect-ratio:1.15;object-fit:contain;border-radius:0}
.gallery-cover span{position:absolute;right:.65rem;bottom:.65rem;border-radius:999px;padding:.36rem .7rem;background:#fff;color:var(--ink);font-size:.875rem;font-weight:650}
.photo-thumbs{display:flex;gap:.45rem;overflow-x:auto;padding:.4rem .2rem}
.photo-thumbs button{flex:0 0 60px;width:60px;height:60px;border:2px solid transparent;border-radius:7px;background:var(--tint);padding:2px;overflow:hidden}
.photo-thumbs button[aria-pressed=true]{border-color:var(--accent)}
.photo-thumbs img,.product .photo-thumbs img{display:block;width:100%;height:100%;aspect-ratio:1;object-fit:cover;border-radius:4px}
#photo-viewer{padding:0;width:min(1100px,calc(100vw - 1.5rem));max-width:none;height:min(880px,calc(100dvh - 1.5rem));max-height:none;background:#1c222b;color:#fff}
#photo-viewer[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
#photo-viewer::backdrop{background:rgba(22,29,40,.88)}
.viewer-toolbar,.viewer-footer{padding:.5rem .8rem;background:#28313d}
.viewer-toolbar,.viewer-middle{display:flex;align-items:center;justify-content:space-between;gap:.3rem}
.viewer-toolbar button,.viewer-arrow{min-width:2.5rem;min-height:2.5rem;border-radius:6px;background:#3a485b;color:white}
.viewer-toolbar button:disabled{opacity:.55}
.viewer-arrow{font-size:1.5rem;flex:none}
.photo-stage{grid-template:minmax(0,1fr)/minmax(0,1fr);position:relative;height:100%;min-width:0;flex:1;display:grid;place-items:center;overflow:hidden;touch-action:none;user-select:none;cursor:zoom-in}
.photo-stage.is-zoomed{cursor:grab}
.photo-stage.is-zoomed:active{cursor:grabbing}
.photo-stage img{display:block;max-width:100%;max-height:100%;object-fit:contain;pointer-events:none;transform-origin:center}
.viewer-footer p{margin:0;text-align:center;overflow-wrap:anywhere}
.viewer-footer .photo-thumbs{justify-content:safe center}
.viewer-footer .photo-thumbs button[aria-pressed=true]{border-color:#a7bbd1}
#admin-drawer{margin:0 auto 0 0;inset:0 auto 0 0;padding:1rem;width:min(340px,90vw);height:100dvh;max-height:none;border-radius:0;background:var(--paper)}
.drawer-heading{display:flex;align-items:center;justify-content:space-between;gap:.5rem}
.drawer-heading h2{margin:0}
.drawer-heading button{font-size:1.6rem;padding:0 .55rem}
#admin-drawer nav{display:grid;gap:.35rem;margin-top:1rem}
#admin-drawer nav button{text-align:left;padding:.7rem;border-radius:6px}
#admin-drawer nav button:hover,#admin-drawer nav button:focus-visible{background:var(--surface)}
#admin-media,#admin-listings,#admin-orders,#admin-messages,#admin-settings,#admin-google{scroll-margin-top:1rem}
.media-toolbar{display:flex;align-items:end;justify-content:space-between;gap:.7rem;flex-wrap:wrap;margin:.65rem 0}
.media-toolbar label{display:grid;gap:.2rem}
.media-toolbar input{padding:.55rem;border:1px solid var(--line);border-radius:6px}
.media-grid,.picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.75rem}
.media-card{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff}
.media-preview{display:block;width:100%;padding:0}
.media-preview img,.picker-grid img{display:block;width:100%;aspect-ratio:1.2;object-fit:cover;background:var(--tint)}
.media-card-info{display:grid;gap:.25rem;padding:.6rem;overflow-wrap:anywhere}
.media-card-info small{color:var(--muted)}
.media-card-info .btn,.listing-photos .btn{padding:.35rem .55rem;font-size:.9rem}
.gallery-editor{display:grid;gap:.6rem;margin:0;padding:.75rem;border:1px solid var(--line);border-radius:7px;min-width:0}
.gallery-editor legend{padding:0 .3rem;font-weight:650}
.gallery-editor p{margin:.15rem 0}
.gallery-editor summary{cursor:pointer;margin-bottom:.4rem}
.listing-photos{display:grid;gap:.5rem;list-style:none;padding:0;margin:0}
.listing-photos li{display:grid;grid-template-columns:72px minmax(0,1fr);gap:.65rem;padding:.45rem;border:1px solid var(--line);border-radius:7px}
.listing-photos li img{width:72px;height:72px;object-fit:cover;border-radius:4px}
.listing-photos li>div{display:grid;gap:.3rem}
.picker-grid{grid-template-columns:repeat(auto-fill,minmax(110px,1fr));max-height:270px;overflow:auto;margin-top:.45rem}
.picker-grid button{padding:0;border:1px solid var(--line);border-radius:6px;overflow:hidden;text-align:left}
.picker-grid span{display:block;padding:.35rem;overflow-wrap:anywhere}
@media(max-width:600px){#photo-viewer{width:100vw;height:100dvh;margin:0;border-radius:0}.viewer-middle{position:relative}.viewer-arrow{position:absolute;z-index:1;opacity:.9}.viewer-arrow:first-child{left:.25rem}.viewer-arrow:last-child{right:.25rem}.media-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
