/* WoodMart keeps closed category dropdowns in the layout with opacity/visibility.
   A long Brands list therefore extended below the footer on category archives.
   Remove only closed desktop dropdown boxes. The theme controls open menus,
   and the existing mobile accordion remains unchanged. */
@media (min-width: 1025px) {
    .wd-page-title .wd-nav-product-cat > li:not(:hover):not(:focus-within):not(.wd-opened) > .wd-dropdown-menu {
        display: none !important;
    }
    .wd-page-title .wd-nav-product-cat > li:focus-within > .wd-dropdown-menu {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
}

/* Compact category card labels: wrap at spaces, never in the middle of a word. */
.wd-cat .wd-cat-content .wd-entities-title {
    font-size: 16px !important;
    line-height: 1.35 !important;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
}
@media (max-width: 767px) {
    .wd-cat .wd-cat-content .wd-entities-title {
        font-size: 14px !important;
    }
}

/* Matching brand cards and uncropped original logos. */
.term-brands .wd-cat .wd-cat-image {
    display: flex;
    width: 100%;
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}
.term-brands .wd-cat .wd-cat-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    object-fit: contain;
    padding: 16px;
    box-sizing: border-box;
}
.term-brands .wd-cat .wd-cat-content {
    min-height: 68px;
    padding: 12px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.term-brands .wd-cat img.go-brand-logo-white {
    filter: brightness(0);
}
@media (max-width: 767px) {
    .term-brands .wd-cat .wd-cat-content { min-height: 62px; }
    .term-brands .wd-cat .wd-cat-image img { padding: 12px; }
}
@media (max-width: 359px) {
    .wd-cat .wd-cat-content { padding-left: 6px; padding-right: 6px; }
}

/* Collection artwork uses one portrait format, with room for a two-line name. */
body.tax-product_cat:not(.term-brands) .wd-cat .wd-cat-wrap,
body.tax-product_cat:not(.term-brands) .wd-cat .wd-cat-inner {
    height: 100%;
}
body.tax-product_cat:not(.term-brands) .wd-cat .wd-cat-inner {
    display: flex;
    flex-direction: column;
}
body.tax-product_cat:not(.term-brands) .wd-cat .wd-cat-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 6px;
    background: #191919;
}
body.tax-product_cat:not(.term-brands) .wd-cat .wd-cat-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-height: none;
    object-fit: cover;
    object-position: center;
}
body.tax-product_cat:not(.term-brands) .wd-cat .wd-cat-content {
    flex: 1;
    min-height: 72px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
}
body.tax-product_cat:not(.term-brands) .wd-cat .wd-cat-content .wd-entities-title {
    margin: 0;
    text-align: center;
}
