/*
 * Native product-collection catalogue grid: element-neutral adapters for the two native wrappers.
 *
 * The active card put its image anchor, its rating row and its action button directly under
 * li.project-product-card, and the project stylesheet keys off those direct-child relationships. The
 * native Woo leaves wrap the anchor and the button, so each wrapper is neutralised with display:contents
 * and every direct-child rule that the wrapper would otherwise hide is repeated with one extra class.
 *
 * Mirrored rules (all with one more class, so they win on specificity and do not depend on file order):
 *   native.css:322       .project-product-card>.card-add.button
 *   native.css:335       .project-product-card>a.cardimage
 *   native.css:336       .project-product-card>a.cardimage>img
 *   components.css:186   .card>.card-add
 *   project.css          .card>.cardimage{margin-bottom:0}
 *
 * Everything else in the card keys off descendants, not children, so it keeps matching unchanged. The
 * direct-child rating rules (native.css:782-787) need nothing here: the rating leaf is a dynamic block
 * without a wrapper, so div.rating is still a direct child of the li.
 */

/* The native image leaf wraps its anchor in div.wc-block-components-product-image. */
body.woohoo-project-design .project-product-card>.wc-block-components-product-image{display:contents}
body.woohoo-project-design .project-product-card>.wc-block-components-product-image>a.cardimage{display:block;position:relative;width:100%;aspect-ratio:1 / 1!important;height:auto!important;min-height:0;flex:0 0 auto;overflow:visible;margin-bottom:0}
body.woohoo-project-design .project-product-card>.wc-block-components-product-image>a.cardimage>img{width:100%!important;height:100%!important;max-height:none;object-fit:contain!important;position:absolute;inset:0}

/* Inner leaves (discount badge, merchandising badges) are wrapped by the image leaf's own container. */
body.woohoo-project-design .project-product-card .wc-block-components-product-image__inner-container{display:contents}

/* The native product-button leaf wraps its control in div.wc-block-components-product-button. */
body.woohoo-project-design .project-product-card>.wc-block-components-product-button{display:contents}
body.woohoo-project-design .project-product-card>.wc-block-components-product-button>.card-add.button,body.woohoo-project-design .project-product-card>noscript.woohoo-native-card-fallback>.card-add.button{background:var(--pink);border:1px solid var(--pink);color:white;font:700 14px/1.3 var(--wp--preset--font-family--woohoo-body);box-shadow:var(--button-raised);height:var(--card-action-height);min-height:var(--card-action-height);padding:8px 10px;display:flex;text-decoration:none}
body.woohoo-project-design .card>.wc-block-components-product-button>.card-add,body.woohoo-project-design .card>noscript.woohoo-native-card-fallback>.card-add{border-radius:var(--action-radius);font-size:14px;box-shadow:var(--button-raised)}

/* Native Woo collection spacing must not override the active grid's zero card margins. */
body.woohoo-project-design .woohoo-native-catalog ul.products>li.project-product-card{margin:0!important}

/* Home retains its existing grid; the native list adds no layout box or list inset. */
body.woohoo-project-design .woohoo-native-home{display:contents}
body.woohoo-project-design .woohoo-native-home>ul.home-product-grid{padding:0;margin:0;list-style:none}
/* Mobile home cards already own their spacing; neutralise Woo's list-row margin. */
@media(max-width:767px){body.woohoo-project-design .woohoo-native-home>ul.home-product-grid>li.project-product-card{margin:0}}

/* Native desktop price view; shared soft-navigation stylesheet, no extra request. */
.widget_price_filter .woohoo-native-price-slider{margin-bottom:1.2em;touch-action:none;display:none}
.widget_price_filter [data-woohoo-native-price] .price_label{display:none}
.widget_price_filter [data-woohoo-native-price].is-enhanced .woohoo-native-price-slider,.widget_price_filter [data-woohoo-native-price].is-enhanced .price_label{display:block}
.widget_price_filter [data-woohoo-native-price].is-enhanced .woohoo-native-price-value{display:none}
.widget_price_filter .woohoo-native-price-slider .ui-slider-handle:focus-visible{outline:2px solid #777;outline-offset:2px}

/* PDP's legacy touch rule targets anchors; give native controls the same target and inset. */
@media(max-width:770px){body.woohoo-project-design .woohoo-native-recommendations .project-product-card>.wc-block-components-product-button>button.card-add.button{min-height:44px;padding:8px 12px}}

/* PDP recommendations inherit the same responsive card paint group as classic cards.
 * The shared desktop hover rule owns isolation; touch cards retain auto. */

/* The saved-page owner keeps its grid, empty state and private navigation boundary. */
body.woohoo-project-design .woohoo-native-wishlist{display:contents}
body.woohoo-project-design .woohoo-native-wishlist>ul.project-saved-grid{padding:0;margin:0;list-style:none}
