/* Factory identities retain their own logo and the saved colors and card design. */
body.nh-store .app-factory-directory-top,
body.nh-store .app-factory-profile-copy{align-items:center;min-width:0}
body.nh-store .app-factory-directory-top>div,
body.nh-store .app-factory-profile-copy>div,
.factory-profile-hero .factory-identity>div{min-width:0;max-width:100%}
body.nh-store .app-factory-directory-top>div>strong,
body.nh-store .app-factory-profile-copy h1,
.factory-profile-hero .factory-name-line h1{
  max-width:100%;height:auto;white-space:normal;overflow:visible;
  text-overflow:clip;overflow-wrap:anywhere;word-break:normal;line-height:1.25;
}
body.nh-store .app-factory-directory-top>i,
body.nh-store .app-factory-logo-frame{flex-shrink:0}
body.nh-store .app-factory-directory-top>i img,
body.nh-store .app-factory-logo-frame img,
.factory-profile-hero .factory-logo-frame img{
  display:block;width:100%;height:100%;max-width:100%;max-height:100%;
  object-fit:contain;object-position:center;
}
body.nh-store .app-factory-card-metrics{min-width:0;gap:5px 10px!important}
body.nh-store .app-factory-card-metrics :is(small,em){
  min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.45;
}
body.nh-store .app-factory-card-metrics .nh-icon{flex-shrink:0}
body.nh-store .app-factory-directory-card :is(.app-factory-card-note,.nh-factory-trade),
body.nh-store .app-factory-profile-copy p,
body.nh-store .nh-factory-about :is(p,dt,dd),
.factory-profile-hero :is(#factory-meta,#factory-description,#factory-headline){
  min-width:0;max-width:100%;height:auto;overflow-wrap:anywhere;word-break:normal;
  white-space:pre-line;line-height:1.5;
}
body.nh-store .app-factory-directory-card>.nh-factory-trade{display:block}
body.nh-store .app-factory-directory-card>button{
  min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.4;padding:10px 12px;
}
body.nh-store .app-factory-profile-card>[data-factory-description]{
  display:block;max-width:100%;margin:4px 0;white-space:pre-line;
  overflow-wrap:anywhere;line-height:1.5;color:var(--nh-muted);
}
body.nh-store .nh-about-intro{align-items:flex-start}
body.nh-store .nh-about-intro>div{min-width:0}
body.nh-store .nh-about-intro>.nh-icon{flex-shrink:0}
.factory-profile-hero .factory-hero-actions{flex-wrap:wrap}
.factory-profile-hero .factory-hero-actions>a,
.factory-profile-hero .factory-hero-actions>button{
  max-width:100%;height:auto;white-space:normal;overflow-wrap:anywhere;line-height:1.4;
}

/* Editable factory profile and gallery: field labels and previews grow naturally. */
.factory-branding-panel :is(.panel-heading,.factory-photo-editor>header),
.factory-logo-panel .panel-heading{flex-wrap:wrap;gap:12px}
.factory-branding-panel :is(.panel-heading>div,.factory-photo-editor>header>div),
.factory-logo-panel .panel-heading>div{min-width:0}
.factory-branding-panel :is(h2,h3,p,label,small),
.factory-logo-panel :is(h2,p,label,small){overflow-wrap:anywhere;white-space:normal;line-height:1.5}
.factory-branding-form,
.factory-branding-form>*,
.factory-logo-panel form,
.factory-logo-panel form>*{min-width:0;max-width:100%}
.factory-branding-form :is(input,textarea),
.factory-logo-panel input{min-width:0;max-width:100%;box-sizing:border-box}
.factory-branding-form textarea{resize:vertical;min-height:128px;line-height:1.5}
.factory-logo-panel .factory-logo-preview{padding:12px}
.factory-logo-panel .factory-logo-preview img{
  display:block;width:112px;height:112px;max-width:100%;object-fit:contain;object-position:center;
}
.factory-branding-panel .factory-photo-editor{display:grid;gap:14px;min-width:0;margin-top:22px}
.factory-branding-panel .factory-photo-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:14px;min-width:0;
}
.factory-branding-panel .factory-photo-card{
  display:grid;align-content:start;gap:12px;min-width:0;padding:12px;
  border:1px solid var(--admin-line,#d7e5df);border-radius:12px;background:var(--admin-card,#fff);
}
.factory-branding-panel .factory-photo-card>img{
  display:block;width:100%;height:190px;object-fit:contain;object-position:center;border-radius:8px;
}
.factory-branding-panel .factory-photo-card :is(form,label){display:grid;gap:8px;min-width:0}
.factory-branding-panel .factory-photo-card :is(input,button){
  box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:42px;
}
.factory-branding-panel .factory-photo-card input{padding:10px;border:1px solid var(--admin-line,#d7e5df);border-radius:8px}
.factory-branding-panel .factory-photo-card button{height:auto;padding:10px;white-space:normal;overflow-wrap:anywhere;line-height:1.4}
.factory-branding-panel .factory-photo-actions{display:flex;flex-wrap:wrap;gap:8px}
.factory-branding-panel .factory-photo-actions>button{flex:1 1 120px;width:auto}

@media(max-width:700px){
  .factory-profile-hero .factory-identity{
    position:relative;left:auto;right:auto;bottom:auto;min-height:430px;
    align-content:end;grid-template-columns:72px minmax(0,1fr);
  }
  .factory-profile-hero .factory-hero-actions>a,
  .factory-profile-hero .factory-hero-actions>button{flex:1 1 150px;padding:10px 12px}
  .factory-branding-panel .factory-photo-grid{grid-template-columns:minmax(0,1fr)}
  .factory-branding-panel .factory-photo-card>img{height:220px}
}
