/* Danner only: repair native card layers without rebuilding WooCommerce cards. */
body:not(.single-product) .products .product-small.box .box-image {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
    overflow: hidden;
    flex-shrink: 0;
}
body:not(.single-product) .products .product-small.box .box-image > div:first-child {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    padding: 0 !important;
}
body:not(.single-product) .products .product-small.box .box-image > div:first-child > a {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0 !important;
}
body:not(.single-product) .products .product-small.box .box-image > div:first-child > a > img {
    position: absolute !important;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center;
    transform: none !important;
}

/* Keep the native Quick View request, focus handling and modal intact. */
body:not(.single-product) .products .product-small.box .box-image > .grid-tools {
    position: absolute;
    inset: auto 0 0 !important;
    display: flex !important;
    width: 100%;
    height: auto !important;
    min-height: 0;
    padding: 0 12px 12px !important;
    margin: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    transform: none !important;
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
    z-index: 4;
    transition: opacity .16s ease, visibility .16s ease;
}
body:not(.single-product) .products .product-small.box .box-image > .grid-tools > a.quick-view {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: auto !important;
    min-height: 38px;
    max-width: 100%;
    padding: 10px 22px !important;
    margin: 0;
    line-height: 1.2;
    box-sizing: border-box;
    pointer-events: none;
}
body:not(.single-product) .products .product-small.box:focus-within .box-image > .grid-tools {
    opacity: 1 !important;
    visibility: visible;
}
body:not(.single-product) .products .product-small.box:focus-within .box-image > .grid-tools > a.quick-view {
    pointer-events: auto;
}
@media (hover: hover) and (pointer: fine) {
    body:not(.single-product) .products .product-small.box:hover .box-image > .grid-tools {
        opacity: 1 !important;
        visibility: visible;
    }
    body:not(.single-product) .products .product-small.box:hover .box-image > .grid-tools > a.quick-view {
        pointer-events: auto;
    }
}
/* Flatsome's original small-screen cards link directly to the product. */
@media (max-width: 849px), (hover: none), (pointer: coarse) {
    body:not(.single-product) .products .product-small.box .box-image > .grid-tools.hide-for-small {
        display: none !important;
    }
}
@media (prefers-reduced-motion: reduce) {
    body:not(.single-product) .products .product-small.box .box-image > .grid-tools { transition: none; }
}

/* The mobile parent label uses the native submenu toggle; child links stay real. */
@media (max-width: 849px) {
    #main-menu .nav-sidebar > li > button.danner-mobile-parent {
        display: block;
        width: 100%;
        min-height: 52px;
        height: auto;
        margin: 0;
        padding: 15px 50px 15px 20px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        color: inherit;
        font: inherit;
        font-size: .8em;
        font-weight: 700;
        line-height: 1.5;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: inherit;
        white-space: normal;
        cursor: pointer;
    }
    #main-menu .nav-sidebar > li > button.danner-mobile-parent:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: -3px;
    }
}
