/* Magnamaa: minimal category navigation, scoped to the two parent archives. */
.mm-tabs-archive .mm-category-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: clamp(12px, 1.4vw, 22px);
    row-gap: 8px;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    text-align: center;
}

.mm-tabs-archive .mm-category-tabs .mm-category-tab {
    display: inline-block;
    width: auto;
    position: relative;
    margin: 0;
    padding: 4px 0 6px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    color: #666;
    font-family: inherit;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: .045em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s ease, border-color .2s ease;
}

.mm-tabs-archive .mm-category-tabs .mm-category-tab:hover,
.mm-tabs-archive .mm-category-tabs .mm-category-tab:focus-visible {
    color: #1f1f1f;
}

.mm-tabs-archive .mm-category-tabs .mm-category-tab.is-active {
    color: #171717;
    border-bottom-color: #171717;
}

.mm-tabs-archive .mm-category-tabs .mm-category-tab:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 3px;
}

/* Exact layout visible in the supplied Blocksy HTML: counter | tabs | sorting. */
@media (min-width: 901px) {
    .mm-tabs-archive .woo-listing-top {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        column-gap: clamp(12px, 1.8vw, 26px);
    }

    .mm-tabs-archive .woo-listing-top > .woocommerce-result-count {
        grid-column: 1;
        justify-self: start;
        margin: 0;
    }

    .mm-tabs-archive .woo-listing-top > .mm-category-tabs {
        grid-column: 2;
        justify-self: center;
    }

    .mm-tabs-archive .woo-listing-top > .woocommerce-ordering {
        grid-column: 3;
        justify-self: end;
        margin: 0;
    }
}

/* Mobile / tablet: tabs on the left, native Blocksy sort control on the right.
   If the product counter is visible, it occupies its own row above them.
   Tabs can wrap naturally without horizontal scrolling. */
@media (max-width: 900px) {
    .mm-tabs-archive .woo-listing-top {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 10px;
        row-gap: 10px;
        width: 100%;
    }

    .mm-tabs-archive .woo-listing-top > .woocommerce-result-count {
        grid-column: 1 / -1;
        margin: 0;
        justify-self: start;
    }

    .mm-tabs-archive .woo-listing-top > .mm-category-tabs {
        grid-column: 1;
        min-width: 0;
        justify-self: start;
        justify-content: flex-start;
        text-align: left;
        column-gap: 12px;
    }

    .mm-tabs-archive .woo-listing-top > .woocommerce-ordering {
        grid-column: 2;
        justify-self: end;
        align-self: center;
        width: auto;
        margin: 0 !important;
    }
}

@media (max-width: 480px) {
    .mm-tabs-archive .mm-category-tabs {
        column-gap: 14px;
        row-gap: 7px;
    }

    .mm-tabs-archive .mm-category-tabs .mm-category-tab {
        font-size: 10px;
        letter-spacing: .02em;
    }
}

/* In an empty category the tabs are rendered above WooCommerce's no-results info. */
.mm-tabs-archive .woocommerce-no-products-found + .mm-category-tabs,
.mm-tabs-archive .woocommerce-notices-wrapper + .mm-category-tabs {
    margin-bottom: 24px;
}
