/**
 * wmcategory — Category Page Customizations
 * Workmind · workmind.pt · v2.2.2
 */

/* ─── 1. Esconder header nativo quando banner ativo ──────────────────── */
.wm-banner-active .page-header,
.wm-banner-active #js-product-list-header .category-cover,
.wm-banner-active #js-product-list-header h1 {
    display: none !important;
}

/* ─── 2. Banner fullwidth ─────────────────────────────────────────────── */
.wm-category-banner {
    position: relative;
    width: 100%;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: 120px;
    margin-bottom: -100px;
    height: var(--wm-cat-height, 420px);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    background: #1a1a2e;
}

.wm-category-banner__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.wm-category-banner__overlay {
    position: absolute;
    inset: 0;
    background-color: var(--wm-cat-overlay-color, #000000);
    opacity: var(--wm-cat-overlay-opacity, 0.45);
    pointer-events: none;
}

.wm-category-banner__content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 32px 15px 32px 30px;
}

@media (min-width: 992px) {
    .wm-category-banner__content {
        padding-left: calc((93vw - 1170px) / 2 + 15px);
        padding-right: calc((100vw - 1170px) / 2 + 15px);
    }
}

.wm-category-banner__title {
    font-size: var(--wm-cat-title-size, 52px) !important;
    font-weight: 800 !important;
    color: var(--wm-cat-title-color, #ffffff) !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.1 !important;
    text-shadow: 0 2px 12px rgba(0,0,0,.5) !important;
    letter-spacing: -0.5px;
    text-align: left !important;
}

.wm-category-banner__desc {
    font-size: 1rem !important;
    color: var(--wm-cat-desc-color, #ffffff) !important;
    margin: 0 !important;
    max-width: 520px;
    line-height: 1.5;
    opacity: 0.88;
    text-shadow: 0 1px 6px rgba(0,0,0,.4);
    text-align: left !important;
}

/* ─── 3. Barra de ordenação — select alinhado à direita ──────────────── */

/* Row principal vira flex para empurrar a coluna do sort para a direita */
.wm-sort-right #js-product-list-top .products-selection > .row {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

/* Coluna de contagem — fica à esquerda, ocupa o mínimo */
.wm-sort-right #js-product-list-top .total-products {
    flex: 0 0 auto !important;
    width: auto !important;
}

/* Coluna do sort — empurrada para a direita */
.wm-sort-right #js-product-list-top .grid-selecting {
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: auto !important;
}

/* sort-by-row vira flex horizontal */
.wm-sort-right #js-product-list-top .sort-by-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin: 0 !important;
}

/* "Ordenar por:" na mesma linha */
.wm-sort-right #js-product-list-top .sort-by {
    white-space: nowrap !important;
    width: auto !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    font-size: 13px !important;
}

/* Coluna do dropdown */
.wm-sort-right #js-product-list-top .products-sort-order {
    flex: 0 0 auto !important;
    width: auto !important;
    padding: 0 !important;
}

/* Botão do dropdown */
.wm-sort-right #js-product-list-top .select-title {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    font-size: 13px !important;
    padding: 6px 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background: #fff !important;
    min-width: 160px !important;
    cursor: pointer !important;
}

/* ─── 4. Ocultar contagem ─────────────────────────────────────────────── */
.wm-hide-count .total-products {
    display: none !important;
}

/* ─── 5. Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .wm-category-banner {
        margin-top: 60px;
        margin-bottom: -50px;
        height: 260px !important;
    }
    .wm-category-banner__title {
        font-size: calc(var(--wm-cat-title-size, 52px) * 0.55) !important;
    }
    .wm-category-banner__content {
        padding: 20px 16px !important;
    }
    .wm-sort-right #js-product-list-top .products-selection > .row {
        flex-wrap: wrap !important;
    }
}
