/* Listing gallery + owner-only image manager */
#count{margin-bottom:18px}
.photoCount{display:none!important}

/* Public gallery: compact AutoScout-like mosaic */
.detailGallery{margin:0 0 24px!important;padding:0!important;width:100%!important;max-width:none!important;background:#0b0b0d;border-bottom:1px solid #ffffff10}
.publicGallery{display:grid;width:100%!important;max-width:none!important;height:340px;grid-template-columns:minmax(0,1.7fr) minmax(0,.9fr);gap:4px;background:#0b0b0d}
.publicGallery.single{grid-template-columns:1fr}
.publicMain,.publicSideItem{position:relative;width:100%;height:100%;border:0;padding:0;background:#0b0b0d;overflow:hidden;cursor:pointer}
.publicMain{min-height:0}
.publicMain img,.publicSideItem img{width:100%;height:100%;object-fit:cover;display:block}
.publicSide{display:grid;width:100%;min-width:0;height:340px;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:4px;min-height:0}
.publicSideItem{min-width:0;min-height:0}
.morePhotos{position:absolute;inset:0;display:grid;place-items:center;background:#0008;color:#fff;font-size:20px;font-weight:900}
#detailBox .detailThumbs{display:none!important}

/* Dark/red scrollbars */
#detailBox,#detail .modalBox,#sellModal .modalBox,textarea.field{scrollbar-color:#e10600 #0b0b0d;scrollbar-width:thin}
#detailBox,#detail .modalBox,#sellModal .modalBox{overflow-x:hidden!important}
#detailBox::-webkit-scrollbar,#detail .modalBox::-webkit-scrollbar,#sellModal .modalBox::-webkit-scrollbar,textarea.field::-webkit-scrollbar{width:9px;height:0}
#detailBox::-webkit-scrollbar-track,#detail .modalBox::-webkit-scrollbar-track,#sellModal .modalBox::-webkit-scrollbar-track,textarea.field::-webkit-scrollbar-track{background:#0b0b0d}
#detailBox::-webkit-scrollbar-thumb,#detail .modalBox::-webkit-scrollbar-thumb,#sellModal .modalBox::-webkit-scrollbar-thumb,textarea.field::-webkit-scrollbar-thumb{background:#e10600;border-radius:999px;border:2px solid #0b0b0d}
#detailBox::-webkit-scrollbar-button,#detail .modalBox::-webkit-scrollbar-button,#sellModal .modalBox::-webkit-scrollbar-button,textarea.field::-webkit-scrollbar-button{display:none!important;width:0!important;height:0!important}
#detailBox::-webkit-scrollbar-corner,#detail .modalBox::-webkit-scrollbar-corner,#sellModal .modalBox::-webkit-scrollbar-corner,textarea.field::-webkit-scrollbar-corner{background:#0b0b0d}
textarea.field{resize:none!important}
.detailInfo,.detailTop,.detailDescription,#detailBox .topActions{max-width:100%;min-width:0}
#detailBox .topActions{overflow:hidden}

/* Price sits with the title instead of floating on the right */
#detailBox .detailTop{display:block!important}
#detailBox .detailTop>div:first-child{max-width:none!important}
#detailBox .detailPrice{display:inline-flex!important;align-items:center;margin:12px 0 2px!important;padding:8px 12px!important;border-radius:10px;background:#0b0b0d;border:1px solid #ffffff14;font-size:26px!important;line-height:1!important;font-weight:900!important;white-space:nowrap}

/* Remove green helper/status box from listing edit/create form */
#sellStatus .status:not(.error){display:none!important}

/* Full gallery overlay */
html.galleryOpen,body.galleryOpen{overflow:hidden!important}
.galleryOverlay{position:fixed;inset:0;z-index:220;background:#050506;color:#fff;overflow-y:auto;overflow-x:hidden;padding:86px 24px 30px;scrollbar-width:thin;scrollbar-color:#e10600 #050506}
.galleryOverlay::-webkit-scrollbar{width:9px}
.galleryOverlay::-webkit-scrollbar-track{background:#050506}
.galleryOverlay::-webkit-scrollbar-thumb{background:#e10600;border-radius:999px;border:2px solid #050506}
.galleryOverlay::-webkit-scrollbar-button{display:none;width:0;height:0}
.galleryOverlayBar{position:fixed;left:0;right:0;top:0;height:72px;background:#050506f8;border-bottom:1px solid #ffffff12;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 28px;z-index:2}
.galleryOverlayBar>div{display:flex;flex-direction:column;gap:4px;min-width:0}.galleryOverlayBar b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.galleryOverlayBar span{color:#c5c7cc}.galleryCounter{justify-self:center;color:#fff!important}.galleryClose{justify-self:end;width:42px;height:42px;border-radius:50%;border:1px solid #ffffff22;background:#111216;color:#fff;font-size:30px;line-height:1;cursor:pointer}
.galleryAll{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;max-width:1320px;margin:0 auto;align-items:start}
.galleryAllItem{border:1px solid transparent;padding:0;background:#111216;border-radius:10px;overflow:hidden;aspect-ratio:4/3;cursor:zoom-in;transition:border-color .15s,transform .15s}
.galleryAllItem img{width:100%;height:100%;object-fit:cover;display:block}
.galleryAllItem:hover,.galleryAllItem:focus-visible{border-color:#e10600;outline:none;transform:translateY(-1px)}

/* Click image again for a larger zoom view */
.imageZoomLayer{position:fixed;inset:0;z-index:260;background:#000e;display:grid;place-items:center;padding:24px;overflow:hidden}
.imageZoomStage{width:100%;height:100%;display:grid;place-items:center;overflow:hidden}
.imageZoomStage img{max-width:92vw;max-height:86vh;width:auto;height:auto;object-fit:contain;cursor:zoom-in;transition:transform .22s ease;user-select:none}
.imageZoomStage img.zoomed{transform:scale(1.8);cursor:zoom-out}
.imageZoomClose{position:fixed;right:24px;top:20px;z-index:3;width:44px;height:44px;border-radius:50%;border:1px solid #ffffff28;background:#111216;color:#fff;font-size:30px;line-height:1;cursor:pointer}
.imageZoomHint{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);padding:8px 12px;border-radius:999px;background:#111216e8;border:1px solid #ffffff18;color:#c7c9cf;font-size:12px;pointer-events:none}

/* Owner-only image editor */
.imageManager{margin:8px 0 16px;padding:14px;background:#0b0b0d;border:1px solid #ffffff14;border-radius:14px}
.imageManager[hidden]{display:none}.imageManagerHead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px}.imageManagerHead b{font-size:14px}.imageManagerHead span{font-size:12px;color:#7f8490}.imageManagerGrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.imageTile{position:relative;aspect-ratio:4/3;border-radius:11px;overflow:hidden;border:2px solid transparent;background:#16171b;cursor:pointer}.imageTile.main{border-color:#e10600}.imageTile img{width:100%;height:100%;object-fit:cover;display:block}.imageTileBadge{position:absolute;left:7px;bottom:7px;padding:5px 7px;border-radius:999px;background:#e10600;color:#fff;font-size:10px;font-weight:900}.imageTileNew{position:absolute;left:7px;top:7px;padding:4px 7px;border-radius:999px;background:#ffffffde;color:#0b0b0d;font-size:9px;font-weight:900}.imageTileRemove{position:absolute;right:6px;top:6px;width:28px;height:28px;border:1px solid #ffffff24;border-radius:50%;background:#0b0b0de8;color:#fff;font-weight:900;cursor:pointer;display:grid;place-items:center}.imageTileRemove:hover{background:#e10600}.imageManagerHelp{margin:10px 0 0;color:#777c86;font-size:11px;line-height:1.45}.imageEmpty{grid-column:1/-1;padding:18px;border:1px dashed #ffffff18;border-radius:10px;color:#71717a;text-align:center;font-size:12px}

@media(max-width:1000px){.galleryAll{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px){.publicGallery{grid-template-columns:1fr;height:auto}.publicMain{height:300px}.publicSide{grid-template-columns:repeat(4,1fr);grid-template-rows:105px;height:105px}.galleryAll{grid-template-columns:repeat(2,minmax(0,1fr))}.imageManagerGrid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:560px){.detailGallery{margin:0 0 20px!important}.publicMain{height:250px}.publicSide{grid-template-columns:repeat(2,1fr);grid-template-rows:95px 95px;height:194px}.galleryOverlay{padding:74px 10px 16px}.galleryOverlayBar{height:64px;padding:0 14px;grid-template-columns:1fr auto}.galleryCounter{display:none}.galleryOverlayBar b{font-size:13px}.galleryOverlayBar span{font-size:12px}.galleryAll{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.imageManagerGrid{grid-template-columns:repeat(2,minmax(0,1fr))}.imageZoomLayer{padding:10px}.imageZoomStage img{max-width:96vw;max-height:82vh}.imageZoomClose{right:12px;top:12px}.imageZoomHint{bottom:12px;font-size:11px}#detailBox .detailPrice{font-size:22px!important;padding:8px 10px!important}}
