/* =========================================================
   2.2.4 — Phase 36 Homepage Card Engineering + Animated Category Fallbacks
   Consolidated late-layer rules intentionally override historical card fragments.
   ========================================================= */
.ao-home{--ao-home-card-min:176px;--ao-home-card-max:204px;--ao-home-card-gap:10px}
.ao-home.ao-home-density-compact{--ao-home-card-min:162px;--ao-home-card-max:186px;--ao-home-card-gap:8px}
.ao-home.ao-home-density-comfortable{--ao-home-card-min:190px;--ao-home-card-max:224px;--ao-home-card-gap:12px}
.ao-home .ao-marketplace-rail{
  grid-auto-columns:clamp(var(--ao-home-card-min),16vw,var(--ao-home-card-max))!important;
  gap:var(--ao-home-card-gap)!important;
  align-items:stretch;
}
.ao-product-card{container-type:inline-size;container-name:ao-product-card;isolation:isolate}
.ao-home .ao-product-card{border-color:#e9ebee!important;box-shadow:0 2px 10px rgba(16,24,40,.035)!important;transition:transform .22s cubic-bezier(.2,.72,.24,1),box-shadow .22s ease,border-color .22s ease}
.ao-home .ao-product-card:hover{border-color:#e3e5e8!important;box-shadow:0 12px 28px rgba(16,24,40,.08)!important}
.ao-home .ao-product-card .ao-card-body{padding:10px 10px 11px;gap:4px}
.ao-home.ao-home-density-compact .ao-product-card .ao-card-body{padding:8px 8px 9px;gap:3px}
.ao-home.ao-home-density-comfortable .ao-product-card .ao-card-body{padding:12px 12px 13px;gap:5px}
.ao-home .ao-product-card .ao-card-store{min-height:15px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px}
.ao-home .ao-product-card .ao-product-title{font-size:11.5px;line-height:1.5;min-height:3em;max-height:3em;font-weight:800}
.ao-home .ao-product-card .ao-social-proof-badges{min-height:18px;overflow:hidden;white-space:nowrap}
.ao-home .ao-product-card .ao-rating{min-height:16px;max-width:100%;overflow:hidden;white-space:nowrap;font-size:9px;gap:4px}
.ao-home .ao-product-card .ao-price{margin-top:3px;min-height:29px;gap:5px;flex-wrap:nowrap;overflow:hidden}
.ao-home .ao-product-card .ao-current-price{font-size:clamp(15px,1.25vw,17px);line-height:1.25}
.ao-home .ao-product-card .ao-old-price{font-size:9px;overflow:hidden;text-overflow:ellipsis}
.ao-home .ao-product-card .ao-card-meta{font-size:8.5px;line-height:1.45;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ao-home .ao-product-card .ao-product-card-actions{margin-top:5px;padding-top:5px;gap:4px;flex-wrap:nowrap}
.ao-home .ao-product-card .ao-card-action-mini{min-width:30px;min-height:30px;padding:0 7px;flex:1 1 0}
.ao-home .ao-product-card .ao-card-action-mini small{font-size:8px}
.ao-home .ao-product-card .ao-card-bottom{margin-top:7px}
.ao-home .ao-product-card .ao-cta{min-height:36px;border-radius:9px;font-size:10px;padding:7px 9px}

/* Container-aware compression: card internals respond to their real width, not only viewport width. */
@container ao-product-card (max-width:175px){
  .ao-card-store{font-size:8px!important}
  .ao-product-title{font-size:10.75px!important;line-height:1.45!important;min-height:2.9em!important;max-height:2.9em!important}
  .ao-social-proof-badges{display:none!important}
  .ao-rating .ao-review-count{display:none!important}
  .ao-card-meta{display:none!important}
  .ao-card-action-mini small{display:none!important}
  .ao-card-action-mini{width:30px!important;min-width:30px!important;flex:1 1 30px!important;padding:0!important}
  .ao-current-price{font-size:15px!important}
  .ao-old-price{font-size:8px!important}
  .ao-cta{min-height:34px!important;font-size:9.5px!important}
}
@container ao-product-card (max-width:150px){
  .ao-card-body{padding:7px!important}
  .ao-rating{font-size:8px!important}
  .ao-old-price{display:none!important}
  .ao-product-card-actions{border-top:0!important;padding-top:2px!important}
}

/* Semantic, animated fallback artwork for categories without thumbnails. */
.ao-category-fallback{
  --ao-cat-accent:#fb7701;--ao-cat-bg1:#fff6ee;--ao-cat-bg2:#ffe7d2;
  position:relative;display:grid;place-items:center;overflow:hidden;flex:0 0 auto;
  width:82px;height:82px;border-radius:18px;color:var(--ao-cat-accent);
  background:linear-gradient(145deg,var(--ao-cat-bg1),var(--ao-cat-bg2));
  border:1px solid color-mix(in srgb,var(--ao-cat-accent) 13%,transparent);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.ao-category-fallback svg{position:relative;z-index:2;width:43%;height:43%;filter:drop-shadow(0 4px 8px rgba(17,24,39,.08));transform-origin:center}
.ao-category-fallback::before{content:"";position:absolute;width:70%;height:70%;border-radius:50%;border:1px dashed color-mix(in srgb,var(--ao-cat-accent) 24%,transparent);opacity:.65}
.ao-category-fallback::after{content:"";position:absolute;width:28%;height:28%;border-radius:50%;background:color-mix(in srgb,var(--ao-cat-accent) 12%,#fff);inset-inline-end:7%;inset-block-start:8%;filter:blur(.2px)}
.ao-category-fallback-orbit{position:absolute;inset:9%;z-index:1;border-radius:50%}
.ao-category-fallback-orbit i,.ao-category-fallback-orbit b{position:absolute;display:block;width:6px;height:6px;border-radius:50%;background:var(--ao-cat-accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--ao-cat-accent) 10%,transparent)}
.ao-category-fallback-orbit i{top:1px;left:50%}.ao-category-fallback-orbit b{bottom:4px;right:10%;width:4px;height:4px;opacity:.65}
.ao-category-fallback--electronics{--ao-cat-accent:#2563eb;--ao-cat-bg1:#f1f6ff;--ao-cat-bg2:#dbeafe}
.ao-category-fallback--fashion{--ao-cat-accent:#db2777;--ao-cat-bg1:#fff2f8;--ao-cat-bg2:#fce7f3}
.ao-category-fallback--beauty{--ao-cat-accent:#9333ea;--ao-cat-bg1:#faf5ff;--ao-cat-bg2:#f3e8ff}
.ao-category-fallback--home{--ao-cat-accent:#059669;--ao-cat-bg1:#f0fdf8;--ao-cat-bg2:#d1fae5}
.ao-category-fallback--kitchen{--ao-cat-accent:#d97706;--ao-cat-bg1:#fffaf0;--ao-cat-bg2:#fef3c7}
.ao-category-fallback--sports{--ao-cat-accent:#dc2626;--ao-cat-bg1:#fff4f4;--ao-cat-bg2:#fee2e2}
.ao-category-fallback--auto{--ao-cat-accent:#475569;--ao-cat-bg1:#f8fafc;--ao-cat-bg2:#e2e8f0}
.ao-category-fallback--kids{--ao-cat-accent:#0891b2;--ao-cat-bg1:#effcff;--ao-cat-bg2:#cffafe}
.ao-category-fallback--pets{--ao-cat-accent:#65a30d;--ao-cat-bg1:#f8fee9;--ao-cat-bg2:#ecfccb}
.ao-category-fallback--jewelry{--ao-cat-accent:#ea580c;--ao-cat-bg1:#fff7ed;--ao-cat-bg2:#ffedd5}
.ao-category-fallback--soft{background:color-mix(in srgb,var(--ao-cat-accent) 8%,#fff);border-color:color-mix(in srgb,var(--ao-cat-accent) 12%,transparent)}
.ao-category-fallback--minimal{background:#fff;border-style:dashed;box-shadow:none}
.ao-category-fallback.is-motion svg{animation:aoCategoryGlyphFloat 3.4s ease-in-out infinite}
.ao-category-fallback.is-motion .ao-category-fallback-orbit{animation:aoCategoryOrbit 7s linear infinite}
.ao-category-fallback.is-motion::after{animation:aoCategoryPulse 2.8s ease-in-out infinite}
@keyframes aoCategoryGlyphFloat{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-4px) scale(1.035)}}
@keyframes aoCategoryOrbit{to{transform:rotate(360deg)}}
@keyframes aoCategoryPulse{0%,100%{transform:scale(.88);opacity:.55}50%{transform:scale(1.16);opacity:.9}}

/* Category cards keep identical geometry whether an image exists or not. */
.ao-home .ao-category-card{display:grid;grid-template-rows:auto auto auto;justify-items:center;align-content:start;gap:6px;min-width:0;text-align:center}
.ao-home .ao-category-card>img,.ao-home .ao-category-card>.ao-category-fallback{width:82px;height:82px;border-radius:16px}
.ao-home .ao-category-card>strong{width:100%;font-size:11px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.9em}
.ao-marketplace-category-parent>.ao-category-fallback{width:112px;height:94px;border-radius:0;align-self:stretch}
.ao-marketplace-category-children>a>.ao-category-fallback{width:52px;height:52px;border-radius:10px}

/* Mobile card system: two balanced product cards without desktop leftovers. */
@media(max-width:767px){
  .ao-home{--ao-home-card-gap:8px}
  .ao-home .ao-marketplace-rail{grid-auto-columns:clamp(142px,44vw,174px)!important;gap:8px!important;padding-inline:1px}
  .ao-home.ao-home-density-compact .ao-marketplace-rail{grid-auto-columns:clamp(136px,42vw,158px)!important}
  .ao-home.ao-home-density-comfortable .ao-marketplace-rail{grid-auto-columns:clamp(152px,47vw,184px)!important}
  .ao-home .ao-product-card .ao-card-body{padding:8px 8px 9px;gap:3px}
  .ao-home .ao-product-card .ao-product-title{font-size:10.75px;line-height:1.45}
  .ao-home .ao-product-card .ao-current-price{font-size:15px}
  .ao-home .ao-product-card .ao-old-price{font-size:8.5px}
  .ao-home .ao-product-card .ao-card-meta{display:none}
  .ao-home .ao-product-card .ao-product-card-actions small{display:none}
  .ao-home .ao-product-card .ao-card-action-mini{min-height:30px;padding:0;min-width:30px}
  .ao-home .ao-product-card .ao-cta{min-height:35px;font-size:9.5px}
  .ao-home .ao-category-grid-pro{display:grid;grid-auto-flow:column;grid-auto-columns:88px;grid-template-columns:none!important;gap:8px;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;scrollbar-width:none;padding:2px 1px 6px}
  .ao-home .ao-category-grid-pro::-webkit-scrollbar{display:none}
  .ao-home .ao-category-card{scroll-snap-align:start;padding:8px 5px!important;border-radius:13px!important}
  .ao-home .ao-category-card>img,.ao-home .ao-category-card>.ao-category-fallback{width:68px!important;height:68px!important;border-radius:14px!important}
  .ao-home .ao-category-card>strong{font-size:9.5px;min-height:2.8em}
  .ao-marketplace-category-parent>.ao-category-fallback{width:88px;height:78px}
  .ao-marketplace-category-children>a>.ao-category-fallback{width:68px;height:68px;margin:auto}
}
@media(max-width:380px){
  .ao-home .ao-marketplace-rail{grid-auto-columns:clamp(136px,45vw,154px)!important;gap:7px!important}
  .ao-home .ao-product-card .ao-card-body{padding:7px}
  .ao-home .ao-product-card .ao-rating{font-size:8px}
  .ao-home .ao-product-card .ao-social-proof-badges{display:none}
  .ao-home .ao-category-grid-pro{grid-auto-columns:82px}
  .ao-home .ao-category-card>img,.ao-home .ao-category-card>.ao-category-fallback{width:62px!important;height:62px!important}
}
@media(prefers-reduced-motion:reduce){
  .ao-category-fallback.is-motion svg,.ao-category-fallback.is-motion .ao-category-fallback-orbit,.ao-category-fallback.is-motion::after{animation:none!important}
}

/* =========================================================
   2.2.5 — Phase 37 Home Card System Unification
   ========================================================= */
.ao-home{
  --ao-card-radius:14px;
  --ao-card-media-bg:#f7f8fa;
  --ao-card-title-lines:2;
  --ao-card-touch:36px;
  --ao-card-pad:10px;
  --ao-card-title-size:11.5px;
  --ao-card-price-size:16px;
}
.ao-home.ao-home-density-compact{--ao-card-pad:8px;--ao-card-title-size:10.75px;--ao-card-price-size:15px;--ao-card-touch:34px}
.ao-home.ao-home-density-comfortable{--ao-card-pad:12px;--ao-card-title-size:12px;--ao-card-price-size:17px;--ao-card-touch:38px}
.ao-home .ao-product-card{border-radius:var(--ao-card-radius)!important;overflow:hidden;display:flex;flex-direction:column;height:100%}
.ao-home .ao-product-card-media-wrap{background:var(--ao-card-media-bg);min-width:0}
.ao-home .ao-product-card .ao-product-media{background:var(--ao-card-media-bg);overflow:hidden}
.ao-home .ao-product-card .ao-product-media img{display:block;width:100%;height:100%;object-fit:contain;object-position:center;transition:transform .28s cubic-bezier(.2,.72,.24,1)}
.ao-home .ao-product-card .ao-card-body{padding:var(--ao-card-pad)!important;display:flex;flex:1 1 auto;flex-direction:column;min-width:0}
.ao-home .ao-product-card .ao-product-title{font-size:var(--ao-card-title-size)!important;line-height:1.48!important;min-height:calc(var(--ao-card-title-lines) * 1.48em)!important;max-height:calc(var(--ao-card-title-lines) * 1.48em)!important;margin:0;overflow:hidden}
.ao-home .ao-product-card .ao-price{margin-top:auto;padding-top:4px;min-width:0}
.ao-home .ao-product-card .ao-current-price{font-size:var(--ao-card-price-size)!important;font-variant-numeric:tabular-nums}
.ao-home .ao-product-card .ao-card-bottom{margin-top:7px}
.ao-home .ao-product-card .ao-cta{min-height:var(--ao-card-touch)!important;display:flex;align-items:center;justify-content:center;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ao-home .ao-product-card .ao-card-action-mini{min-height:var(--ao-card-touch)!important}

/* Stable fallback canvas prevents CLS when the real category image is absent. */
.ao-category-fallback{aspect-ratio:1/1;contain:layout paint style;will-change:auto}
.ao-category-fallback--parent{aspect-ratio:auto}
.ao-category-fallback svg{will-change:transform}
.ao-category-motion--orbit.is-motion svg{animation:aoCategoryGlyphFloat 3.4s ease-in-out infinite}
.ao-category-motion--orbit.is-motion .ao-category-fallback-orbit{animation:aoCategoryOrbit 7s linear infinite}
.ao-category-motion--orbit.is-motion::after{animation:aoCategoryPulse 2.8s ease-in-out infinite}
.ao-category-motion--float.is-motion svg{animation:aoCategoryGlyphFloat 3s ease-in-out infinite}
.ao-category-motion--float.is-motion .ao-category-fallback-orbit,.ao-category-motion--float.is-motion::after{animation:none}
.ao-category-motion--breathe.is-motion svg{animation:aoCategoryBreathe 3.6s ease-in-out infinite}
.ao-category-motion--breathe.is-motion .ao-category-fallback-orbit{animation:none}
.ao-category-motion--breathe.is-motion::after{animation:aoCategoryGlow 3.6s ease-in-out infinite}
.ao-category-motion--none svg,.ao-category-motion--none .ao-category-fallback-orbit,.ao-category-motion--none::after{animation:none!important}
@keyframes aoCategoryBreathe{0%,100%{transform:scale(.94)}50%{transform:scale(1.06)}}
@keyframes aoCategoryGlow{0%,100%{transform:scale(.82);opacity:.38}50%{transform:scale(1.22);opacity:.82}}

/* Exact mobile profiles: design for card width, not a shrunken desktop card. */
@media(max-width:479px){
  .ao-home{--ao-card-radius:12px;--ao-card-pad:8px;--ao-card-touch:36px;--ao-card-title-size:10.75px;--ao-card-price-size:15px}
  .ao-home .ao-product-card .ao-card-store{font-size:8px;min-height:13px}
  .ao-home .ao-product-card .ao-rating{font-size:8px;min-height:14px}
  .ao-home .ao-product-card .ao-product-card-actions{gap:3px;margin-top:3px;padding-top:3px}
}
@media(max-width:430px){
  .ao-home .ao-marketplace-rail{grid-auto-columns:minmax(0,calc((100vw - 30px)/2))!important;gap:8px!important}
}
@media(max-width:390px){
  .ao-home .ao-marketplace-rail{grid-auto-columns:minmax(0,calc((100vw - 27px)/2))!important;gap:7px!important}
  .ao-home .ao-product-card .ao-social-proof-badges,.ao-home .ao-product-card .ao-card-meta{display:none!important}
  .ao-home .ao-product-card .ao-card-action-mini small{display:none!important}
}
@media(max-width:360px){
  .ao-home{--ao-card-pad:7px;--ao-card-title-size:10.25px;--ao-card-price-size:14.5px;--ao-card-touch:34px}
  .ao-home .ao-marketplace-rail{grid-auto-columns:minmax(0,calc((100vw - 24px)/2))!important;gap:6px!important}
  .ao-home .ao-product-card .ao-old-price{display:none!important}
  .ao-home .ao-product-card .ao-rating .ao-review-count{display:none!important}
}
@media(max-width:330px){
  .ao-home .ao-marketplace-rail{grid-auto-columns:82vw!important;scroll-padding-inline:10px}
  .ao-home .ao-product-card .ao-old-price{display:inline!important}
}
@media(prefers-reduced-motion:reduce){
  .ao-category-fallback *{animation:none!important;transition:none!important}
}

/* =========================================================
   2.2.6 — Main Category Diversity Sections
   Every non-empty top-level product category gets a showcase.
   ========================================================= */
.ao-main-category-showcases{display:grid;gap:18px;margin-block:18px}
.ao-main-category-section{--ao-main-cat-accent:#fb7701;--ao-main-cat-soft:#fff7ed;background:#fff;border:1px solid var(--ao-border,#e7e7e7);border-radius:18px;padding:18px;overflow:hidden}
.ao-main-category-electronics{--ao-main-cat-accent:#2563eb;--ao-main-cat-soft:#eff6ff}
.ao-main-category-fashion{--ao-main-cat-accent:#db2777;--ao-main-cat-soft:#fdf2f8}
.ao-main-category-beauty{--ao-main-cat-accent:#9333ea;--ao-main-cat-soft:#faf5ff}
.ao-main-category-home{--ao-main-cat-accent:#059669;--ao-main-cat-soft:#ecfdf5}
.ao-main-category-kitchen{--ao-main-cat-accent:#d97706;--ao-main-cat-soft:#fffbeb}
.ao-main-category-sports{--ao-main-cat-accent:#dc2626;--ao-main-cat-soft:#fef2f2}
.ao-main-category-auto{--ao-main-cat-accent:#475569;--ao-main-cat-soft:#f8fafc}
.ao-main-category-kids{--ao-main-cat-accent:#0891b2;--ao-main-cat-soft:#ecfeff}
.ao-main-category-pets{--ao-main-cat-accent:#65a30d;--ao-main-cat-soft:#f7fee7}
.ao-main-category-jewelry{--ao-main-cat-accent:#ea580c;--ao-main-cat-soft:#fff7ed}
.ao-main-category-tone-2{background:linear-gradient(180deg,var(--ao-main-cat-soft),#fff 36%)}
.ao-main-category-tone-3{border-color:color-mix(in srgb,var(--ao-main-cat-accent) 18%,var(--ao-border,#e7e7e7))}
.ao-main-category-tone-4{box-shadow:0 10px 30px rgba(17,24,39,.045)}
.ao-main-category-head{display:grid;grid-template-columns:minmax(200px,auto) 1fr auto;align-items:center;gap:14px;margin-bottom:14px}
.ao-main-category-identity{display:flex;align-items:center;gap:10px;min-width:0;color:inherit;text-decoration:none}
.ao-main-category-identity>img,.ao-main-category-identity>.ao-category-fallback{width:56px;height:56px;min-width:56px;border-radius:14px;object-fit:cover}
.ao-main-category-identity>span{display:grid;gap:1px;min-width:0}
.ao-main-category-identity small{font-size:9px;color:var(--ao-muted,#737373);font-weight:700}
.ao-main-category-identity strong{font-size:19px;line-height:1.25;color:#111}
.ao-main-category-identity em{font-size:9px;font-style:normal;color:var(--ao-main-cat-accent);font-weight:800}
.ao-main-category-children{display:flex;gap:7px;align-items:center;overflow:hidden;min-width:0}
.ao-main-category-children a{flex:0 0 auto;padding:7px 10px;border-radius:999px;background:var(--ao-main-cat-soft);color:#333;text-decoration:none;font-size:10px;font-weight:700;border:1px solid color-mix(in srgb,var(--ao-main-cat-accent) 10%,transparent);white-space:nowrap}
.ao-main-category-children a:hover{color:var(--ao-main-cat-accent);border-color:color-mix(in srgb,var(--ao-main-cat-accent) 25%,transparent)}
.ao-main-category-all{white-space:nowrap}
.ao-main-category-products .ao-marketplace-rail{scroll-padding-inline:2px}
.ao-main-category-empty{display:grid;gap:10px}
.ao-main-category-empty>span{font-size:11px;font-weight:800;color:var(--ao-muted,#737373)}
.ao-main-category-empty>div{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none}
.ao-main-category-empty>div::-webkit-scrollbar{display:none}
.ao-main-category-empty a{flex:0 0 92px;display:grid;justify-items:center;gap:6px;padding:9px;border:1px solid var(--ao-border,#e7e7e7);border-radius:13px;text-align:center;text-decoration:none;color:#111;scroll-snap-align:start;background:#fff}
.ao-main-category-empty img,.ao-main-category-empty .ao-category-fallback{width:68px;height:68px;border-radius:11px;object-fit:cover}
.ao-main-category-empty strong{font-size:9px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
@media(max-width:900px){
  .ao-main-category-head{grid-template-columns:1fr auto}
  .ao-main-category-children{grid-column:1/-1;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
  .ao-main-category-children::-webkit-scrollbar{display:none}
}
@media(max-width:767px){
  .ao-main-category-showcases{gap:12px;margin-block:12px}
  .ao-main-category-section{padding:11px;border-radius:14px}
  .ao-main-category-head{grid-template-columns:1fr auto;gap:8px;margin-bottom:10px}
  .ao-main-category-identity>img,.ao-main-category-identity>.ao-category-fallback{width:46px;height:46px;min-width:46px;border-radius:11px}
  .ao-main-category-identity strong{font-size:15px}
  .ao-main-category-children{grid-column:1/-1;gap:5px}
  .ao-main-category-children a{font-size:9px;padding:6px 8px}
  .ao-main-category-all{font-size:9px}
}

/* 2.2.8 — Smart homepage merchandising / category balance engine. */
.ao-main-category-showcases.is-smart-balanced{gap:16px}
.ao-main-category-section.is-featured-category{min-height:0}
.ao-main-category-section.is-compact-category{padding:14px 16px;background:linear-gradient(180deg,#fff,var(--ao-main-cat-soft))}
.ao-main-category-section.is-compact-category .ao-main-category-head{margin-bottom:10px}
.ao-main-category-section.is-compact-category .ao-main-category-identity>img,
.ao-main-category-section.is-compact-category .ao-main-category-identity>.ao-category-fallback{width:48px;height:48px;min-width:48px;border-radius:12px}
.ao-main-category-section.is-compact-category .ao-main-category-identity strong{font-size:16px}
.ao-main-category-section.is-compact-category .ao-main-category-empty>div{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));overflow:visible;gap:8px}
.ao-main-category-section.is-compact-category .ao-main-category-empty a{width:auto;min-width:0;grid-template-columns:44px minmax(0,1fr);justify-items:start;align-items:center;text-align:start;padding:7px 8px}
.ao-main-category-section.is-compact-category .ao-main-category-empty img,
.ao-main-category-section.is-compact-category .ao-main-category-empty .ao-category-fallback{width:42px;height:42px;border-radius:10px}
.ao-main-category-section.is-compact-category .ao-main-category-empty strong{font-size:9px;-webkit-line-clamp:2}
@media (max-width:1024px){
  .ao-main-category-section.is-compact-category .ao-main-category-empty>div{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (max-width:767px){
  .ao-main-category-showcases.is-smart-balanced{gap:10px}
  .ao-main-category-section.is-compact-category{padding:10px 11px;border-radius:13px}
  .ao-main-category-section.is-compact-category .ao-main-category-head{grid-template-columns:1fr auto;margin-bottom:8px}
  .ao-main-category-section.is-compact-category .ao-main-category-children{display:none}
  .ao-main-category-section.is-compact-category .ao-main-category-empty>div{display:flex;overflow-x:auto;scroll-snap-type:x proximity;gap:7px;padding-bottom:2px}
  .ao-main-category-section.is-compact-category .ao-main-category-empty a{flex:0 0 116px;grid-template-columns:38px minmax(0,1fr);scroll-snap-align:start;padding:6px 7px}
  .ao-main-category-section.is-compact-category .ao-main-category-empty img,
  .ao-main-category-section.is-compact-category .ao-main-category-empty .ao-category-fallback{width:36px;height:36px}
  .ao-main-category-section.is-compact-category .ao-main-category-identity>img,
  .ao-main-category-section.is-compact-category .ao-main-category-identity>.ao-category-fallback{width:42px;height:42px;min-width:42px}
  .ao-main-category-section.is-compact-category .ao-main-category-identity strong{font-size:14px}
}

/* =========================================================
   Homepage Conversion + Rhythm Engine
   Visual rhythm only; no extra product queries or runtime fetches.
   ========================================================= */
.ao-home-rhythm-break{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;margin:4px 0 2px;padding:18px 20px;border:1px solid var(--ao-border,#e7e7e7);border-radius:18px;background:linear-gradient(135deg,#fff 0%,#fff8f1 100%);overflow:hidden;position:relative;isolation:isolate}
.ao-home-rhythm-break::before{content:"";position:absolute;inset:auto -28px -48px auto;width:140px;height:140px;border-radius:999px;background:color-mix(in srgb,var(--ao-primary,#fb7701) 12%,transparent);z-index:-1;transform:translateZ(0)}
.ao-home-rhythm-break--2{background:linear-gradient(135deg,#fff,#f8fafc)}
.ao-home-rhythm-break--3{background:linear-gradient(135deg,#fff,#fffbea)}
.ao-home-rhythm-break>div{display:grid;gap:3px;min-width:0}
.ao-home-rhythm-break span{font-size:10px;font-weight:900;color:var(--ao-primary,#fb7701)}
.ao-home-rhythm-break strong{font-size:20px;line-height:1.3;color:#111}
.ao-home-rhythm-break small{font-size:11px;line-height:1.7;color:var(--ao-muted,#737373)}
.ao-rhythm-cta{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 16px;border-radius:12px;background:#111;color:#fff!important;text-decoration:none;font-size:11px;font-weight:900;white-space:nowrap;transition:transform .18s ease,box-shadow .18s ease}
.ao-rhythm-cta:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(17,17,17,.12)}
.ao-main-category-showcases.has-rhythm-engine>.ao-main-category-section:nth-of-type(odd){scroll-margin-top:90px}
.ao-home .ao-section-link,.ao-home .ao-main-category-all{transition:transform .18s ease,color .18s ease}
.ao-home .ao-section-link:hover,.ao-home .ao-main-category-all:hover{transform:translateX(-2px)}

@media(max-width:767px){
  .ao-home-rhythm-break{grid-template-columns:1fr;gap:10px;padding:14px;margin-block:2px;border-radius:14px}
  .ao-home-rhythm-break strong{font-size:16px}
  .ao-home-rhythm-break small{font-size:10px}
  .ao-rhythm-cta{width:100%;min-height:40px}
  .ao-home.ao-mobile-section-density-auto .ao-main-category-section.is-featured-category:nth-of-type(n+5),
  .ao-home.ao-mobile-section-density-compact .ao-main-category-section.is-featured-category{padding:10px 11px;border-radius:13px}
  .ao-home.ao-mobile-section-density-auto .ao-main-category-section.is-featured-category:nth-of-type(n+5) .ao-main-category-children,
  .ao-home.ao-mobile-section-density-compact .ao-main-category-section.is-featured-category .ao-main-category-children{display:none}
  .ao-home.ao-mobile-section-density-compact .ao-home-block{--ao-section-my:12px!important;--ao-section-py:16px!important}
  .ao-home.ao-mobile-section-density-comfortable .ao-main-category-showcases{gap:14px}
  .ao-home.ao-mobile-section-density-comfortable .ao-main-category-section{padding:14px}
}
@media(max-width:380px){
  .ao-home-rhythm-break{padding:12px}
  .ao-home-rhythm-break strong{font-size:15px}
  .ao-home-rhythm-break::before{width:110px;height:110px}
}
@media(prefers-reduced-motion:reduce){
  .ao-rhythm-cta,.ao-home .ao-section-link,.ao-home .ao-main-category-all{transition:none!important;transform:none!important}
}

/* =========================================================
   3.0.1 — Mobile main-category rail hardening
   Use the rail container width rather than 100vw so cards stay
   readable inside padded/embedded/customizer viewports.
   ========================================================= */
@media (max-width:767px){
  .ao-home .ao-main-category-section,
  .ao-home .ao-main-category-head,
  .ao-home .ao-main-category-products,
  .ao-home .ao-main-category-products .ao-marketplace-rail{min-width:0;max-width:100%}

  .ao-home .ao-main-category-products .ao-marketplace-rail{
    display:flex!important;
    flex-wrap:nowrap!important;
    grid-template-columns:none!important;
    grid-auto-columns:unset!important;
    grid-auto-flow:unset!important;
    width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    gap:8px!important;
    padding:2px 1px 8px!important;
    scroll-snap-type:x mandatory;
    scroll-padding-inline:1px;
    overscroll-behavior-inline:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .ao-home .ao-main-category-products .ao-marketplace-rail::-webkit-scrollbar{display:none}
  .ao-home .ao-main-category-products .ao-marketplace-rail>.ao-product-card,
  .ao-home .ao-main-category-products .ao-marketplace-rail>.ao-product-loop-item{
    flex:0 0 calc((100% - 8px)/2)!important;
    width:calc((100% - 8px)/2)!important;
    min-width:0!important;
    max-width:none!important;
    scroll-snap-align:start;
  }

  .ao-home .ao-main-category-head{width:100%}
  .ao-home .ao-main-category-identity{min-width:0;overflow:hidden}
  .ao-home .ao-main-category-identity>span{min-width:0}
  .ao-home .ao-main-category-identity strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ao-home .ao-main-category-children{width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;padding-bottom:3px}
  .ao-home .ao-main-category-children::-webkit-scrollbar{display:none}
  .ao-home .ao-main-category-all{align-self:center;flex:0 0 auto}
}

@media (max-width:340px){
  .ao-home .ao-main-category-products .ao-marketplace-rail>.ao-product-card,
  .ao-home .ao-main-category-products .ao-marketplace-rail>.ao-product-loop-item{
    flex-basis:82%!important;
    width:82%!important;
  }
}


/* 3.1.0 — Category commerce showcases: real product samples instead of icon-only blocks. */
.ao-marketplace-category-product-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.ao-category-product-showcase{display:flex;flex-direction:column;gap:12px;padding:14px;border:1px solid var(--ao-border);border-radius:18px;background:var(--ao-card);min-width:0;overflow:hidden}
.ao-category-showcase-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0}
.ao-category-showcase-head .ao-marketplace-category-parent{display:flex;align-items:center;gap:10px;min-width:0;flex:1;text-decoration:none;color:inherit}
.ao-category-showcase-head .ao-marketplace-category-parent img,.ao-category-showcase-head .ao-marketplace-category-parent .ao-category-fallback{width:64px;height:54px;min-width:64px;border-radius:13px;object-fit:cover}
.ao-category-showcase-head .ao-marketplace-category-parent span{display:grid;gap:2px;min-width:0}.ao-category-showcase-head small{font-size:9px;color:var(--ao-muted)}.ao-category-showcase-head strong{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ao-category-showcase-head em{font-style:normal;font-size:10px;color:var(--ao-muted)}
.ao-category-showcase-all{font-size:10px;font-weight:800;color:var(--ao-primary);text-decoration:none;white-space:nowrap}
.ao-category-sample-products{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-width:0}
.ao-category-sample-products .ao-product-card,.ao-category-sample-products .ao-product-loop-item{min-width:0;width:100%}
.ao-category-sample-products .ao-product-card .ao-product-media{aspect-ratio:1/1}
.ao-marketplace-category-children.is-chip-list{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;padding:2px 0 3px}.ao-marketplace-category-children.is-chip-list::-webkit-scrollbar{display:none}.ao-marketplace-category-children.is-chip-list a{flex:0 0 auto;display:inline-flex;align-items:center;min-height:30px;padding:5px 10px;border:1px solid var(--ao-border);border-radius:999px;background:color-mix(in srgb,var(--ao-card) 92%,var(--ao-primary) 8%);text-decoration:none;color:var(--ao-text)}.ao-marketplace-category-children.is-chip-list a strong{font-size:9px;white-space:nowrap}
.ao-main-category-products.is-compact-product-samples{overflow:hidden}.ao-main-category-section.is-compact-category .ao-main-category-products.is-compact-product-samples .ao-marketplace-rail{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:visible;gap:8px}.ao-compact-category-chips{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;margin-top:9px;padding-bottom:2px}.ao-compact-category-chips::-webkit-scrollbar{display:none}.ao-compact-category-chips a{flex:0 0 auto;padding:5px 10px;border:1px solid var(--ao-border);border-radius:999px;background:var(--ao-card);color:var(--ao-text);font-size:9px;font-weight:700;text-decoration:none}.ao-main-category-empty.is-chip-fallback>div{display:flex!important;gap:7px;overflow-x:auto!important;grid-template-columns:none!important}.ao-main-category-empty.is-chip-fallback a{width:auto!important;min-width:auto!important;padding:7px 11px!important;border-radius:999px!important}.ao-main-category-empty.is-chip-fallback a strong{font-size:10px!important;white-space:nowrap!important}
@media(max-width:980px){.ao-marketplace-category-product-groups{grid-template-columns:1fr}.ao-category-sample-products{grid-template-columns:repeat(2,minmax(0,1fr))}.ao-main-category-section.is-compact-category .ao-main-category-products.is-compact-product-samples .ao-marketplace-rail{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:767px){.ao-category-product-showcase{padding:11px;border-radius:15px;gap:10px}.ao-category-showcase-head{align-items:flex-start}.ao-category-showcase-head .ao-marketplace-category-parent img,.ao-category-showcase-head .ao-marketplace-category-parent .ao-category-fallback{width:52px;height:48px;min-width:52px}.ao-category-showcase-head strong{font-size:13px}.ao-category-sample-products{display:flex;overflow-x:auto;gap:9px;scroll-snap-type:x proximity;scrollbar-width:none;padding-bottom:3px}.ao-category-sample-products::-webkit-scrollbar{display:none}.ao-category-sample-products>.ao-product-card,.ao-category-sample-products>.ao-product-loop-item{flex:0 0 calc((100% - 9px)/2);scroll-snap-align:start}.ao-main-category-section.is-compact-category .ao-main-category-products.is-compact-product-samples .ao-marketplace-rail{display:flex!important;overflow-x:auto!important;gap:9px!important;scroll-snap-type:x proximity}.ao-main-category-section.is-compact-category .ao-main-category-products.is-compact-product-samples .ao-marketplace-rail>.ao-product-card,.ao-main-category-section.is-compact-category .ao-main-category-products.is-compact-product-samples .ao-marketplace-rail>.ao-product-loop-item{flex:0 0 calc((100% - 9px)/2)!important;scroll-snap-align:start}.ao-marketplace-category-children.is-chip-list a,.ao-compact-category-chips a{min-height:32px}}
@media(max-width:359px){.ao-category-sample-products>.ao-product-card,.ao-category-sample-products>.ao-product-loop-item,.ao-main-category-section.is-compact-category .ao-main-category-products.is-compact-product-samples .ao-marketplace-rail>.ao-product-card,.ao-main-category-section.is-compact-category .ao-main-category-products.is-compact-product-samples .ao-marketplace-rail>.ao-product-loop-item{flex-basis:78%!important}}



/* 3.5.1 — Desktop section composer. Mobile styles are intentionally untouched. */
@media(min-width:1101px){
 .ao-home .ao-main-category-showcases.is-smart-balanced{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:18px!important;align-items:start!important;grid-auto-flow:row dense!important}
 .ao-home .ao-main-category-showcases.is-smart-balanced>.ao-main-category-section{grid-column:auto!important;min-width:0!important;width:100%!important;min-height:0!important;height:auto!important;align-self:start!important}
 .ao-home .ao-main-category-showcases.is-smart-balanced>.ao-main-category-section.is-featured-category,
 .ao-home .ao-main-category-showcases.is-smart-balanced>.ao-home-rhythm-break{grid-column:1/-1!important}
 .ao-home .ao-main-category-section.is-compact-category .ao-main-category-products.is-compact-product-samples .ao-marketplace-rail{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;overflow:visible!important;width:100%!important;grid-auto-columns:auto!important}
 .ao-home .ao-main-category-section.is-compact-category .ao-marketplace-rail>.ao-product-card,
 .ao-home .ao-main-category-section.is-compact-category .ao-marketplace-rail>.ao-product-loop-item{min-width:0!important;width:100%!important;max-width:none!important;flex:none!important}
 /* Odd final chapter may span the row but never blow up cards. */
 .ao-home .ao-main-category-showcases.is-smart-balanced>.ao-main-category-section.is-compact-category:last-of-type{grid-column:1/-1!important}
 .ao-home .ao-main-category-section.is-compact-category:last-of-type .ao-main-category-products .ao-marketplace-rail{grid-template-columns:repeat(4,minmax(0,1fr))!important}
 .ao-home .ao-main-category-section .ao-product-card img{object-fit:contain;max-width:100%}
}
@media(min-width:901px) and (max-width:1100px){
 .ao-home .ao-main-category-showcases.is-smart-balanced{display:grid!important;grid-template-columns:1fr!important;gap:14px!important}
 .ao-home .ao-main-category-showcases.is-smart-balanced>*{grid-column:1!important}
 .ao-home .ao-main-category-section.is-compact-category .ao-main-category-products .ao-marketplace-rail{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;overflow:visible!important;gap:10px!important}
}
@media print{
 .ao-home .ao-main-category-section{content-visibility:visible!important;contain-intrinsic-size:auto!important}
}


/* 3.5.2 — Mobile layout recovery (isolated from desktop composer).
   The old mobile flex rail and 3.4.9 grid override compete at <=767px.
   Give category showcases one layout owner and prevent narrow 70px cards. */
@media screen and (max-width:767px){
  body .ao-home .ao-main-category-showcases.is-smart-balanced{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    grid-auto-flow:row!important;gap:12px!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
  }
  body .ao-home .ao-main-category-showcases.is-smart-balanced>.ao-main-category-section{
    grid-column:1/-1!important;width:100%!important;min-width:0!important;
    max-width:100%!important;min-height:0!important;
  }
  body .ao-home .ao-main-category-section .ao-main-category-products,
  body .ao-home .ao-main-category-section .ao-main-category-products.is-compact-product-samples{
    width:100%!important;min-width:0!important;max-width:100%!important;
    overflow:visible!important;
  }
  body .ao-home .ao-main-category-showcases .ao-main-category-section .ao-main-category-products .ao-marketplace-rail{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-columns:unset!important;grid-auto-flow:row!important;
    align-items:stretch!important;justify-content:stretch!important;
    gap:9px!important;width:100%!important;min-width:0!important;
    max-width:100%!important;overflow:visible!important;
    padding:0!important;scroll-snap-type:none!important;
  }
  body .ao-home .ao-main-category-showcases .ao-main-category-section .ao-main-category-products .ao-marketplace-rail>.ao-product-card,
  body .ao-home .ao-main-category-showcases .ao-main-category-section .ao-main-category-products .ao-marketplace-rail>.ao-product-loop-item{
    display:flex!important;flex-direction:column!important;
    flex:none!important;flex-basis:auto!important;
    grid-column:auto!important;width:100%!important;min-width:0!important;
    max-width:100%!important;height:auto!important;min-height:0!important;
    margin:0!important;scroll-snap-align:none!important;
  }
  body .ao-home .ao-main-category-showcases .ao-product-card .ao-product-media,
  body .ao-home .ao-main-category-showcases .ao-product-card .ao-product-card-media-wrap{
    width:100%;min-width:0;max-width:100%;
  }
  body .ao-home .ao-main-category-showcases .ao-product-card .ao-product-media img{
    max-width:100%;object-fit:contain;
  }
  body .ao-home .ao-main-category-showcases .ao-product-card .ao-card-body{
    width:100%;min-width:0;
  }
  body .ao-home .ao-main-category-showcases .ao-product-card .ao-product-title{
    overflow-wrap:anywhere;
  }
}
@media screen and (max-width:359px){
  body .ao-home .ao-main-category-showcases .ao-main-category-section .ao-main-category-products .ao-marketplace-rail{
    grid-template-columns:minmax(0,1fr)!important;
  }
}
