/* Final contract layer: card settings must survive page-specific legacy rules.
   Section/page outer padding is intentionally independent of inter-card gaps. */
body :is(.app-linked-product-grid, .category-app-grid, .shop-app-grid, .offers-app-grid, .product-app-grid, .dynamic-home-products-grid) {
    --product-track: var(--dynamic-product-card-width,var(--global-product-card-width,150px));
    display:grid!important;
    grid-template-columns:repeat(auto-fill,min(100%,var(--product-track)))!important;
    justify-content:center!important;
    row-gap:var(--dynamic-product-card-row-gap,var(--global-product-card-row-gap,var(--global-product-card-gap,12px)))!important;
    column-gap:var(--dynamic-product-card-column-gap,var(--global-product-card-column-gap,var(--global-product-card-gap,12px)))!important;
    margin-inline:0!important;
}
body :is(.app-linked-product-grid, .category-app-grid, .shop-app-grid, .offers-app-grid, .product-app-grid, .dynamic-home-products-grid) > :is([class*="col-"], [data-category-product], .dynamic-home-products-grid-item) {
    padding:0!important; margin:0!important; width:100%!important; max-width:none!important; min-width:0;
}
body .app-linked-product-grid > :is(.col-12, .w-100) { grid-column:1/-1; }
body :is(.dynamic-home-products-app-rail, .dynamic-home-products-native-rail) {
    column-gap:var(--dynamic-product-card-column-gap,var(--global-product-card-column-gap,var(--global-product-card-gap,12px)))!important;
}
body :is(.dynamic-home-products-app-rail, .dynamic-home-products-native-rail) > .dynamic-home-product-slide {
    padding:0!important;
    flex:0 0 min(100%,var(--dynamic-product-card-width,var(--global-product-card-width,150px)))!important;
    width:min(100%,var(--dynamic-product-card-width,var(--global-product-card-width,150px)))!important;
}
body .app-linked-product-card-surface.dynamic-home-product-card {
    height:auto!important;
    min-height:var(--dynamic-product-card-height,var(--global-product-card-height,250px))!important;
    border-radius:var(--dynamic-product-card-radius,var(--global-product-card-radius,10px))!important;
    align-self:stretch;

}
/* Typography uses the generated shared role tokens, including preview scaling. */
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-card-link { height:auto!important; }
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-card-top-row {
    height:34px; min-height:34px; padding:3px var(--dynamic-product-body-padding,10px)!important; box-sizing:border-box;
}
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-media {
    height:var(--resolved-product-image-height,var(--dynamic-product-image-height,var(--global-product-card-image-height,140px)))!important;
    padding:var(--dynamic-product-media-padding,var(--global-product-card-media-padding,10px))!important;
    background:var(--dynamic-product-image-background,#fff)!important;
    aspect-ratio:auto!important; box-sizing:border-box; flex-shrink:0;
}
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-image {
    width:100%; height:100%; object-fit:var(--dynamic-product-image-fit,contain)!important;
    object-position:var(--dynamic-product-image-alignment,center)!important;
    border-radius:var(--dynamic-product-card-radius,10px)!important;
}
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-action {
    top:calc(18px + var(--resolved-product-image-height,var(--dynamic-product-image-height,var(--global-product-card-image-height,140px))))!important;
    inset-inline-end:10px!important;
}
body .app-linked-product-card-surface.dynamic-home-product-card .card-body {
    padding:var(--dynamic-product-body-padding,var(--global-product-card-body-padding,10px))!important; min-width:0;
}
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-rating-row {
    margin:0!important; min-height:calc(var(--ct-caption-size) * 1.5)!important; line-height:1.5!important;
    visibility:var(--dynamic-product-rating-visibility,visible);
}
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-rating-row--empty { visibility:hidden; }
body .app-linked-product-card-surface.dynamic-home-product-card :is(.dynamic-home-product-rating-value,.dynamic-home-product-rating-count) { font-size:var(--ct-caption-size)!important; font-weight:400!important; }
body .app-linked-product-card-surface.dynamic-home-product-card :is(.dynamic-home-product-brand,.dynamic-home-product-old-price-line) { min-height:calc(var(--ct-secondary-size) * 1.5)!important; margin:0!important; }
body .app-linked-product-card-surface.dynamic-home-product-card :is(.dynamic-home-product-brand,.dynamic-home-product-old-price) { font-size:var(--ct-secondary-size)!important; font-weight:400!important; line-height:1.5!important; }
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-title {
    font-size:var(--ct-card-title-size)!important; font-weight:var(--ct-card-title-weight)!important; line-height:1.5!important;
    min-height:calc(var(--ct-card-title-size) * 1.5 * var(--dynamic-product-title-lines,var(--global-product-card-title-lines,2)) + 2px)!important;
    -webkit-line-clamp:var(--dynamic-product-title-lines,var(--global-product-card-title-lines,2))!important;
}
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-price-block { margin-top:2px!important; gap:4px; }
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-price-row { min-height:24px; }
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-current-price {
    font-size:var(--ct-product-card-price-size)!important; font-weight:var(--ct-product-card-price-weight)!important; line-height:1.5!important;
    overflow-x:auto!important; overflow-y:hidden!important;
    padding-block:.214286em; min-height:calc(var(--ct-product-card-price-size) * 1.928572); box-sizing:border-box;
}
body .app-linked-product-card-surface.dynamic-home-product-card .dynamic-home-product-current-price .currency-price { max-width:none!important; flex-shrink:0; line-height:inherit!important; }

body .shop-app-clearance-products { gap:var(--dynamic-product-card-column-gap,var(--global-product-card-column-gap,12px))!important; }
body .shop-app-clearance-products > div { flex:0 0 min(100%,var(--dynamic-product-card-width,var(--global-product-card-width,150px)))!important; width:min(100%,var(--dynamic-product-card-width,var(--global-product-card-width,150px)))!important; padding:0!important; }

/* Product section spacing has a separate owner from card gaps. Cancel the
   stack's built-in gap so an explicit section_gap=0 really yields zero. */
body .dynamic-home-sections-stack > [data-product-card-section] {
    margin-block-end:calc(var(--section-product-gap,15px) - var(--dynamic-home-section-gap,12px))!important;
}
body .dynamic-home-sections-stack > [data-product-card-section]:last-child { margin-block-end:var(--section-product-gap,15px)!important; }
body [data-product-card-section] { padding-inline:var(--section-outer-padding,10px)!important; }
body.mobile-web-body [data-product-card-section] { padding-inline:var(--section-mobile-outer-padding,var(--section-outer-padding,10px))!important; }
body [data-product-card-section] .dynamic-home-products-shell .dynamic-home-products-app-rail { padding-inline:0!important; }
body [data-product-card-section] .dynamic-home-products-shell .dynamic-home-section-header { padding-top:0!important; }

body .app-linked-product-card-surface .dynamic-home-product-metadata {
    display:flex; flex-wrap:wrap; align-content:start; align-items:center; column-gap:6px;
    min-height:calc(var(--ct-caption-size) * 1.5 + var(--ct-secondary-size) * 1.5);
}
body .app-linked-product-card-surface .dynamic-home-product-metadata .dynamic-home-product-brand {
    color:#667085!important; flex:1 1 calc(var(--ct-secondary-size) * 3); min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
body .app-linked-product-card-surface .dynamic-home-product-metadata .dynamic-home-product-rating-row {
    display:flex; flex:0 1 auto; max-width:100%; gap:4px; white-space:nowrap;
    overflow-x:auto; overflow-y:hidden; text-decoration:none; color:#667085;
}
body .app-linked-product-card-surface .dynamic-home-product-rating-row > span { flex-shrink:0; }
body .app-linked-product-card-surface .dynamic-home-product-rating-star { width:16px; text-align:center; font-size:16px!important; line-height:1; color:#FFD700; }
