/* Identity layer: loaded after theme.css so palette generation cannot wipe layout. */
body{font-family:var(--font)}
.footer-brand{min-width:0}
.footer-brand p{max-width:38em}
.detail-info .sub{color:var(--theme-muted);margin:0 0 16px}
.catalog-intro .section-title{margin-bottom:28px}

body.demo04{--font:"IBM Plex Sans",Inter,sans-serif;--max:1120px}
.d4-stats{padding-inline:max(20px,calc((100vw - var(--max))/2))}
.header .logo small{color:#94a3b8}

/* Full-screen image banner, with an editorial company page of its own. */
body.demo04.is-home .d4-home-banner{display:flex;align-items:center;min-height:max(680px,calc(100svh - 115px));background-image:linear-gradient(90deg,#0c1829ed 0%,#0c1829b8 43%,#0c182942 100%);background-position:center;background-size:cover;color:#fff}
body.demo04.is-home .d4-home-banner .container{width:min(1120px,calc(100% - 40px));padding:90px 0 110px}
body.demo04.is-home .d4-home-banner h1{max-width:13ch;font-size:clamp(60px,7vw,104px);line-height:1.03;letter-spacing:-.055em;color:#fff;font-weight:700}
body.demo04.is-home .d4-home-banner h1 em{font-style:normal;color:var(--theme-primary-mid)}
body.demo04.is-home .d4-home-banner .d2-kicker{color:var(--theme-primary-mid)}
body.demo04.is-home .d4-home-banner .d2-lede{max-width:590px;color:#edf3fc;font-size:clamp(17px,1.5vw,21px)}
body.demo04.is-home .d4-home-banner .btn.outline{color:#fff;border-color:#ffffffa8;background:#ffffff12}
/* Home banner: staged typography and a moving editorial accent. */
body.demo04.is-home .d4-home-banner .container>*{animation:d04-banner-rise .85s cubic-bezier(.2,.7,.2,1) both}
body.demo04.is-home .d4-home-banner .container>h1{animation-delay:.16s}
body.demo04.is-home .d4-home-banner .container>.d2-lede{animation-delay:.34s}
body.demo04.is-home .d4-home-banner .container>.d2-hero-cta{animation-delay:.52s}
body.demo04.is-home .d4-home-banner .d2-kicker:after{content:"";display:block;width:76px;height:2px;margin-top:15px;background:var(--theme-primary-mid);transform-origin:left;animation:d04-banner-line 3.6s ease-in-out infinite}
@keyframes d04-banner-rise{from{opacity:0;transform:translateY(22px);filter:blur(5px)}to{opacity:1;transform:none;filter:none}}
@keyframes d04-banner-line{0%,100%{transform:scaleX(.35)}50%{transform:scaleX(1)}}
@media(prefers-reduced-motion:reduce){
  body.demo04.is-home .d4-home-banner .container>*,body.demo04.is-home .d4-home-banner .d2-kicker:after{animation:none}
}
body.demo04.is-about .d4-about-lead{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);align-items:center;gap:55px;width:min(1120px,calc(100% - 40px));min-height:0;margin:54px auto 80px;padding:50px;background:#f4f6f9;border-radius:22px}
body.demo04.is-about .d4-profile{display:flex;align-items:center;min-width:0;padding:0;background:transparent}
body.demo04.is-about .d4-profile .container{width:100%;max-width:none;margin:0;padding:0}
body.demo04.is-about .d4-profile h1{max-width:none;font-size:clamp(36px,3vw,48px);line-height:1.12;letter-spacing:-.035em;font-weight:700}
body.demo04.is-about .d4-profile .d2-lede{max-width:45ch;font-size:17px;line-height:1.6}
body.demo04.is-about .d4-factory{height:auto;min-height:0;overflow:visible}
body.demo04.is-about .d4-factory img{display:block;width:100%;height:auto;aspect-ratio:16/10;object-fit:cover;object-position:60% center;border-radius:14px}
body.demo04.is-about .d4-factory figcaption{position:static;margin-top:13px;padding:0;background:transparent;color:#65748b;border:0;box-shadow:none}
body.demo04.is-about .d4-stats{display:none}
@media(max-width:800px){
  body.demo04.is-home .d4-home-banner{min-height:max(640px,calc(100svh - 76px))}
  body.demo04.is-home .d4-home-banner h1{font-size:clamp(48px,10vw,72px)}
  body.demo04.is-about .d4-about-lead{grid-template-columns:1fr;gap:28px;width:calc(100% - 32px);margin:24px auto 55px;padding:26px}
  body.demo04.is-about .d4-profile h1{font-size:clamp(34px,7vw,44px)}
}

/* Demo04 unique lower-home module */
body.demo04.is-home .d4-tech-board{display:grid;grid-template-columns:minmax(320px,.78fr) minmax(0,1.22fr);background:#122447;color:#fff}.d4-tech-intro{padding:44px 36px;min-width:0;display:flex;flex-direction:column;justify-content:center}.d4-tech-intro>span{font-size:12px;letter-spacing:.2em;color:#82aaff}.d4-tech-intro h2{margin:20px 0;font-size:clamp(26px,2.3vw,32px);line-height:1.3;letter-spacing:-.025em;overflow-wrap:break-word;text-wrap:balance}.d4-tech-intro p{color:#bdc9dc;line-height:1.75}.d4-tech-intro a{display:inline-block;margin-top:28px;color:#fff;border-bottom:1px solid #fff;padding-bottom:6px}.d4-tech-matrix{display:grid;grid-template-columns:1fr 1fr;background:#edf2fa;color:#111827}.d4-tech-matrix article{padding:32px;min-width:0;border:1px solid #d4dfef}.d4-tech-matrix article:nth-child(3){grid-column:1/-1}.d4-tech-matrix b{font-size:11px;letter-spacing:.18em;color:#244b9b}.d4-tech-matrix h3{margin:28px 0 10px}.d4-tech-matrix p{color:#64748b;line-height:1.6}.d4-tech-matrix figure{grid-column:1/-1;height:250px;margin:0}.d4-tech-matrix img{width:100%;height:100%;object-fit:cover}@media(max-width:800px){body.demo04.is-home .d4-tech-board{grid-template-columns:1fr}.d4-tech-matrix{grid-template-columns:1fr}.d4-tech-matrix article:nth-child(3){grid-column:auto}}

/* Demo04 compatibility pass */
body.demo04.is-home .d4-home-banner{min-height:clamp(620px,78svh,760px)}body.demo04.is-home .d4-home-banner h1{font-size:clamp(40px,4.6vw,64px)!important;max-width:14ch}body.demo04:not(.is-home) h1{font-size:clamp(32px,4vw,52px)!important;line-height:1.1!important;overflow-wrap:break-word;text-wrap:balance}@media(max-width:600px){body.demo04:not(.is-home) h1{font-size:clamp(28px,9vw,40px)!important}}body.demo04.is-home .d4-tech-board{width:min(var(--max),calc(100% - 40px));margin:90px auto;background:var(--theme-dark);color:#fff}body.demo04.is-home .d4-tech-matrix{background:var(--theme-surface-soft);color:var(--theme-text)}body.demo04.is-home .d4-tech-matrix article{border-color:var(--theme-line)}body.demo04.is-home .d4-tech-matrix b{color:var(--theme-primary)}body.demo04.is-home .d4-tech-matrix p{color:var(--theme-muted)}

@media(max-width:600px){body.demo04.is-home .d4-tech-intro{padding:32px 24px}body.demo04.is-home .d4-tech-matrix article{padding:26px 24px}}

/* === product-media-fix:start === */
/* Product image module repair (2026-11-27, extended 2026-11-30 listing2)
   1) Demo06 homepage "Products in editorial rows": compact left-image / right-text rows.
   2) Stop full-width grey letterboxes on leftover vertical cards
      (height:210px + object-fit:contain + auto-fit).
   3) Category listing pages: [data-dynamic-product-list].product-list and
      any .product-card inside .catalog-layout become compact 200x140 / right-text
      editorial rows. This MUST win over every template (hbmmt, demo02-16, etc.).
      Also covers orphaned cards that sit as siblings after an emptied .product-list.
   Featured home grids ([data-view="featured"] without .d6-list) and about-page
   cards (body.is-about) are left unchanged.
*/

/* ----- Editorial rows (template 6 / .d6-list) ----- */
body:not(.is-about) .d6-list{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:0 !important;
}
body:not(.is-about) .d6-list > .d6-row,
body:not(.is-about) .d6-list > article.d6-row,
body:not(.is-about) .d6-list > .d2-prod,
body:not(.is-about) .d6-list > .product-card{
  display:grid !important;
  grid-template-columns:200px minmax(0,1fr) !important;
  gap:24px !important;
  align-items:center !important;
  padding:22px 0 !important;
  border:0 !important;
  border-top:1px solid var(--theme-line,#e5e7eb) !important;
  border-radius:0 !important;
  background:#fff !important;
  box-shadow:none !important;
  overflow:hidden !important;
}
body:not(.is-about) .d6-list > .d6-row > img,
body:not(.is-about) .d6-list > .d6-row > a > img,
body:not(.is-about) .d6-list > .d6-row .d6-row-media,
body:not(.is-about) .d6-list > .d6-row .d6-row-media img,
body:not(.is-about) .d6-list > .d2-prod > .d2-prod-img,
body:not(.is-about) .d6-list > .product-card > .product-card-image{
  width:200px !important;
  max-width:200px !important;
  height:140px !important;
  max-height:140px !important;
  min-height:0 !important;
  aspect-ratio:auto !important;
  object-fit:cover !important;
  object-position:center !important;
  display:block !important;
  background:#f8fafc !important;
  border-radius:4px !important;
  overflow:hidden !important;
}
body:not(.is-about) .d6-list > .d2-prod > .d2-prod-img img,
body:not(.is-about) .d6-list > .product-card > .product-card-image img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  object-position:center !important;
}
body:not(.is-about) .d6-list > .d2-prod > .d2-prod-body,
body:not(.is-about) .d6-list > .product-card > .card-body{
  padding:0 4px 0 0 !important;
}
body:not(.is-about) .d6-list .product-detail-button{
  width:auto !important;
  background:transparent !important;
  color:var(--theme-primary) !important;
  padding:0 !important;
  justify-content:flex-start !important;
  font-weight:700 !important;
}

@media(max-width:700px){
  body:not(.is-about) .d6-list > .d6-row,
  body:not(.is-about) .d6-list > .d2-prod,
  body:not(.is-about) .d6-list > .product-card{
    grid-template-columns:1fr !important;
    gap:14px !important;
    padding:18px 0 !important;
  }
  body:not(.is-about) .d6-list > .d6-row > img,
  body:not(.is-about) .d6-list > .d6-row > a > img,
  body:not(.is-about) .d6-list > .d6-row .d6-row-media,
  body:not(.is-about) .d6-list > .d6-row .d6-row-media img,
  body:not(.is-about) .d6-list > .d2-prod > .d2-prod-img,
  body:not(.is-about) .d6-list > .product-card > .product-card-image{
    width:100% !important;
    max-width:none !important;
    height:200px !important;
    max-height:none !important;
  }
}

/* ----- Non-listing grids: modest 4/3 wells, no auto-fit stretch ----- */
.d2-prod-grid{
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
}
body:not(.is-listing) .product-list:not([data-dynamic-product-list]):not(.product-list-editorial){
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
}
.d2-prod-grid > .d2-prod > .d2-prod-img,
body:not(.is-listing) .product-list:not([data-dynamic-product-list]) > .product-card > .product-card-image{
  aspect-ratio:4/3;
  height:auto;
  min-height:0;
  overflow:hidden;
  background:#f8fafc;
}
.d2-prod-grid > .d2-prod > .d2-prod-img img,
body:not(.is-listing) .product-list:not([data-dynamic-product-list]) > .product-card > .product-card-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
}

/* ----- Category listing: single-column editorial rows -----
   Selectors do not depend on body.is-listing (some themes emit a bare <body>).
   .catalog-layout .product-card also covers leftover SSR cards that were
   left as siblings after a truncated empty .product-list (Dongjie repair bug).
   !important beats style.css auto-fit / height:210-260px / object-fit:contain
   and later theme.css rules.
*/
html body:not(.is-about) .catalog-layout .product-list,
html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]),
html body:not(.is-about) .product-list.product-list-editorial{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:0 !important;
}

html body:not(.is-about) .catalog-layout .product-list .product-card,
html body:not(.is-about) .catalog-layout .product-card,
html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]) .product-card,
html body:not(.is-about) .product-list.product-list-editorial .product-card,
html body:not(.is-about) .product-list .product-card.product-row{
  display:grid !important;
  grid-template-columns:200px minmax(0,1fr) !important;
  gap:24px !important;
  align-items:center !important;
  padding:22px 0 !important;
  border:0 !important;
  border-top:1px solid var(--theme-line,#e5e7eb) !important;
  border-radius:0 !important;
  background:#fff !important;
  box-shadow:none !important;
  overflow:hidden !important;
  max-width:none !important;
}

html body:not(.is-about) .catalog-layout .product-list .product-card > .product-card-image,
html body:not(.is-about) .catalog-layout .product-card > .product-card-image,
html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]) .product-card > .product-card-image,
html body:not(.is-about) .product-list.product-list-editorial .product-card > .product-card-image,
html body:not(.is-about) .product-list .product-card.product-row > .product-card-image{
  display:block !important;
  grid-column:1 !important;
  grid-row:1 !important;
  width:200px !important;
  max-width:200px !important;
  height:140px !important;
  min-height:0 !important;
  max-height:140px !important;
  aspect-ratio:auto !important;
  position:relative !important;
  background:#f8fafc !important;
  border-radius:4px !important;
  overflow:hidden !important;
}

html body:not(.is-about) .catalog-layout .product-list .product-card > .product-card-image img,
html body:not(.is-about) .catalog-layout .product-card > .product-card-image img,
html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]) .product-card > .product-card-image img,
html body:not(.is-about) .product-list.product-list-editorial .product-card > .product-card-image img,
html body:not(.is-about) .product-list .product-card.product-row > .product-card-image img{
  width:100% !important;
  height:100% !important;
  max-height:none !important;
  object-fit:cover !important;
  object-position:center !important;
}

html body:not(.is-about) .catalog-layout .product-list .product-card > .card-body,
html body:not(.is-about) .catalog-layout .product-card > .card-body,
html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]) .product-card > .card-body,
html body:not(.is-about) .product-list.product-list-editorial .product-card > .card-body,
html body:not(.is-about) .product-list .product-card.product-row > .card-body{
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
  grid-column:2 !important;
  grid-row:1 !important;
  min-width:0 !important;
  padding:0 4px 0 0 !important;
}

html body:not(.is-about) .catalog-layout .product-list .product-card .tag,
html body:not(.is-about) .catalog-layout .product-card .tag,
html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]) .product-card .tag,
html body:not(.is-about) .product-list.product-list-editorial .product-card .tag,
html body:not(.is-about) .product-list .product-card.product-row .tag{
  position:static !important;
  margin-bottom:8px !important;
}

html body:not(.is-about) .catalog-layout .product-list .product-card .product-detail-button,
html body:not(.is-about) .catalog-layout .product-card .product-detail-button,
html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]) .product-card .product-detail-button,
html body:not(.is-about) .product-list.product-list-editorial .product-card .product-detail-button,
html body:not(.is-about) .product-list .product-card.product-row .product-detail-button{
  width:auto !important;
  align-self:flex-start !important;
  background:transparent !important;
  color:var(--theme-primary) !important;
  padding:0 !important;
  justify-content:flex-start !important;
  font-weight:700 !important;
  box-shadow:none !important;
  border:0 !important;
  min-height:0 !important;
  border-radius:0 !important;
}

html body:not(.is-about) .catalog-layout .product-list .product-card .product-detail-button:hover,
html body:not(.is-about) .catalog-layout .product-card .product-detail-button:hover,
html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]) .product-card .product-detail-button:hover,
html body:not(.is-about) .product-list.product-list-editorial .product-card .product-detail-button:hover,
html body:not(.is-about) .product-list .product-card.product-row .product-detail-button:hover{
  background:transparent !important;
  color:var(--theme-primary-dark,#1e3a8a) !important;
}

@media(max-width:700px){
  html body:not(.is-about) .catalog-layout .product-list .product-card,
  html body:not(.is-about) .catalog-layout .product-card,
  html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]) .product-card,
  html body:not(.is-about) .product-list.product-list-editorial .product-card,
  html body:not(.is-about) .product-list .product-card.product-row{
    grid-template-columns:1fr !important;
    gap:14px !important;
    padding:18px 0 !important;
  }
  html body:not(.is-about) .catalog-layout .product-list .product-card > .product-card-image,
  html body:not(.is-about) .catalog-layout .product-card > .product-card-image,
  html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]) .product-card > .product-card-image,
  html body:not(.is-about) .product-list.product-list-editorial .product-card > .product-card-image,
  html body:not(.is-about) .product-list .product-card.product-row > .product-card-image{
    grid-column:1 !important;
    grid-row:auto !important;
    width:100% !important;
    max-width:none !important;
    height:200px !important;
    max-height:none !important;
  }
  html body:not(.is-about) .catalog-layout .product-list .product-card > .card-body,
  html body:not(.is-about) .catalog-layout .product-card > .card-body,
  html body:not(.is-about) .product-list[data-dynamic-product-list]:not([data-view="featured"]) .product-card > .card-body,
  html body:not(.is-about) .product-list.product-list-editorial .product-card > .card-body,
  html body:not(.is-about) .product-list .product-card.product-row > .card-body{
    grid-column:1 !important;
    grid-row:auto !important;
  }
}
/* === product-media-fix:end === */
