/* Hens Go V2.2.7 — isolated image display sizing (DEV).
   Fresh pathname deliberately bypasses stale V2.2.1/2.2.5 catalog CSS caches.
   Presentation-only; upload validation, DB, media URLs and identity are unchanged. */

/* Shared: image containers cannot expand a form or grid beyond available width. */
.catalog-upload-field,.catalog-media-gallery,.request-photo-strip,
.catalog-main .category-card,.catalog-main .product-card,.catalog-main .product-gallery,
.vendor-content .request-item{min-width:0;max-width:100%}

/* Admin: compact cover previews for create / edit, even with an old stylesheet cached. */
#category-editor .catalog-upload-field,#product-editor .catalog-upload-field{
  display:flex;align-items:flex-start;flex-wrap:wrap;gap:16px;
  margin:18px 0;padding:16px;border:1px dashed #cba7ac;
  border-radius:12px;background:#fffdfa;min-width:0;
}
#category-editor .catalog-upload-field>label,#product-editor .catalog-upload-field>label{
  flex:1 1 260px;min-width:0;max-width:100%;
}
#category-editor .catalog-upload-field input[type=file],#product-editor .catalog-upload-field input[type=file]{
  display:block;max-width:100%;margin-top:8px;
}
#category-editor .catalog-upload-preview,#product-editor .catalog-upload-preview{
  position:relative;display:grid;place-items:center;flex:0 0 auto;
  width:180px;height:180px;min-width:0;max-width:100%;
  overflow:hidden;border:1px solid #e5d4d7;border-radius:12px;
  background:#f2e6e1;color:#806975;font-size:12px;text-align:center;
}
#product-editor .catalog-upload-preview{width:200px;height:200px}
#category-editor .catalog-upload-preview img,#product-editor .catalog-upload-preview img{
  display:block;width:100%;height:100%;max-width:100%;max-height:100%;
  object-fit:cover;object-position:center;
}
#category-editor .catalog-upload-field>.muted,#product-editor .catalog-upload-field>.muted{
  flex-basis:100%;margin:0;font-size:12px;color:#745d67;
}
/* Tables, approved image galleries and review photos. */
.catalog-row-image{display:block;width:64px;height:64px;max-width:64px;object-fit:cover;border-radius:8px}
.catalog-media-gallery{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px}
.catalog-media-item{box-sizing:border-box;flex:0 1 154px;width:154px;min-width:0;max-width:100%;
  display:grid;gap:8px;padding:9px;border:1px solid #ead6d9;border-radius:10px;background:#fff}
.catalog-media-item>img{display:block;width:100%;height:126px;aspect-ratio:1;object-fit:cover;
  max-width:100%;border-radius:8px}
.catalog-media-item button{max-width:100%;white-space:normal}
.catalog-media-add input[type=file]{max-width:100%}

/* Vendor: photos attached to requests and store imagery must always be bounded. */
.request-photo-strip{display:flex;flex-wrap:wrap;gap:10px}
.request-photo-strip>div{box-sizing:border-box;flex:0 0 112px;width:112px;max-width:100%;min-width:0}
.request-photo-strip img{display:block;width:100%;height:100px;max-width:100%;
  object-fit:cover;object-position:center;border:1px solid #ead3dc;border-radius:9px}
.request-photo-strip form,.request-photo-strip button{max-width:100%;min-width:0;white-space:normal}
.request-photo-upload,.request-photo-upload input[type=file]{max-width:100%;min-width:0}
.vendor-store-photo{width:100%;height:124px;max-width:100%}
.store-photo-preview{width:min(100%,360px);max-width:100%;aspect-ratio:16/10;height:auto}
.store-photo-frame{position:relative;overflow:hidden}
.store-photo-frame>img{position:absolute;inset:0;display:block;width:100%;height:100%;
  max-width:100%;object-fit:cover;object-position:center}
.store-photo-frame>img[hidden]{display:none}

/* Customer: consistent category/product tiles, no intrinsic-image-size blowout. */
.catalog-main .category-grid,.catalog-main .product-grid{min-width:0}
.catalog-main .category-card,.catalog-main .product-card{min-width:0;overflow:hidden}
.catalog-main .category-cover{position:relative;display:grid;place-items:center;
  width:100%;height:auto;aspect-ratio:1;overflow:hidden;
  background:linear-gradient(140deg,#f3e7df,#dfc8c6)}
.catalog-main .category-cover img{display:block;width:100%;height:100%;max-width:100%;
  object-fit:cover;object-position:center}
.catalog-main .product-photo{position:relative;display:grid;place-items:center;
  width:100%;height:auto;aspect-ratio:1;overflow:hidden}
.catalog-main .product-photo>img{display:block;width:100%;height:100%;max-width:100%;object-fit:cover}
.catalog-main .category-card-body,.catalog-main .product-body{min-width:0;overflow-wrap:anywhere}
/* Detail hero is intentionally capped; 600+ px wide photos should not fill the page. */
.catalog-main .detail-layout{grid-template-columns:minmax(0,480px) minmax(0,1fr)}
.catalog-main .product-gallery{width:100%;max-width:480px;min-width:0}
.catalog-main .detail-photo{position:relative;width:100%;height:auto;aspect-ratio:4/5;
  max-height:600px;overflow:hidden;border-radius:18px;background:#f2e5db}
.catalog-main .detail-photo>img{display:block;width:100%;height:100%;max-width:100%;object-fit:cover}
.catalog-main .product-gallery-thumbnails{display:flex;flex-wrap:wrap;gap:9px;margin-top:12px}
.catalog-main .product-gallery-thumbnails button{flex:0 0 72px;width:72px;height:72px;max-width:100%;
  border:2px solid #e1cbd3;border-radius:9px;padding:0;overflow:hidden;background:#f1e7e3}
.catalog-main .product-gallery-thumbnails button>img{display:block;width:100%;height:100%;object-fit:cover}

/* Customer store cards and detail cover: preserve bounded landscape images. */
.catalog-main .store-photo-customer{position:relative;width:100%;height:auto;
  aspect-ratio:16/10;max-width:100%;overflow:hidden}
.catalog-main .store-detail-cover .store-photo-customer{width:220px;max-width:36%;flex-shrink:0}

@media (max-width:760px){
  .catalog-main .detail-layout{grid-template-columns:minmax(0,1fr);gap:20px}
  .catalog-main .product-gallery{max-width:440px;margin-inline:auto}
  .catalog-main .category-cover{aspect-ratio:1}
}
@media (max-width:480px){
  #category-editor .catalog-upload-field,#product-editor .catalog-upload-field{padding:12px;gap:12px}
  #category-editor .catalog-upload-preview{width:160px;height:160px}
  #product-editor .catalog-upload-preview{width:180px;height:180px}
  .catalog-media-item{flex-basis:140px;width:140px}
  .catalog-media-item>img{height:118px}
  .catalog-main .store-detail-cover .store-photo-customer{max-width:42%}
}

/* V2.2.8 Admin upload health compact status */
.hg-media-health-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(245px,1fr));gap:7px 16px;padding-left:18px;margin:13px 0}.hg-media-health-list li{font-size:13px;line-height:1.5}.hg-media-health-list strong{color:#603044}.catalog-media-add{min-width:0}.catalog-media-add input[type=file]{max-width:100%}
