/* ── Layout: .woocommerce-archive-container é o grid (sem wrapper .woocommerce no archive) ── */
.archive {
    padding-top: 0;
}

.woocommerce-archive .woocommerce-archive-container {
    display: flex;
    column-gap: 5rem;
    align-items: start;
}

/* Título e notices abrangem as 2 colunas */
.woocommerce-archive .woocommerce-archive-container>.page-title,
.woocommerce-archive .woocommerce-archive-container>.woocommerce-products-header,
.woocommerce-archive .woocommerce-archive-container>.term-description,
.woocommerce-archive .woocommerce-archive-container>.woocommerce-notices-wrapper {
    margin-bottom: 1.5rem;
}

.banner-archive {
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: calc(var(--header-height) + 20px);
    padding-bottom: 20px;
    position: relative;
}

.banner-archive .container {
    position: relative;
    z-index: 3;
    color: var(--cor-branco);
}

.banner-archive:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(270deg, rgba(0, 0, 0, 0) 0%, #020202 100%);
    z-index: 1;
}

/* Sidebar de filtros — col 1, se estende verticalmente */
.act-shop-filters {
    grid-column: 1;
    grid-row: 2 / span 10;
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    border-radius: 10px;
    padding: 1.25rem 0;
    min-width: 280px;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Sem filtros ativos: volta a 1 coluna */
.woocommerce-archive .container:not(:has(.act-shop-filters)) {
    grid-template-columns: 1fr;
}

.woocommerce-archive .container:not(:has(.act-shop-filters))>* {
    grid-column: 1;
}

.act-filter-group[data-attr="pa_tamanho"] label.act-filter-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    border: 1px solid var(--cor-texto, #444);
    position: relative;
}

.act-filter-group[data-attr="pa_tamanho"] .act-filter-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.act-filter-group[data-attr="pa_tamanho"] label.act-filter-option input {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
}

.act-filter-group[data-attr="pa_tamanho"] label.act-filter-option:has(input:checked) {
    background: var(--cor-principal);
    border-color: var(--cor-principal);
    color: var(--cor-branco, #fff);
}

.woocommerce-archive-products {
    width: 100%;
    margin-top: 3rem;
    margin-bottom: 2.75rem
}

.woocommerce-archive-products .woocommerce-archive-ordenacao {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.woocommerce-archive-products .woocommerce-archive-ordenacao .woocommerce-ordering,
.woocommerce-archive-products .woocommerce-archive-ordenacao .woocommerce-result-count {
    margin-bottom: 0;
}

.woocommerce-archive-products .woocommerce-archive-ordenacao .woocommerce-ordering select {
    font-size: var(--fs-6);
    background: transparent;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* ── Header dos filtros ──────────────────────────────────── */
.act-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    ;
}

.act-filters-title {
    font-size: var(--fs-2);
    color: var(--cor-principal, #111);
}

.act-filters-clear {
    font-size: 0.78rem;
    color: #bbb;
    cursor: default;
    text-decoration: none;
    pointer-events: none;
}

.act-filters-clear.is-active {
    color: var(--cor-principal, #333);
    text-decoration: underline;
    cursor: pointer;
    pointer-events: auto;
}

/* ── Grupo de filtro ─────────────────────────────────────── */
.act-filter-group {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1.25rem 0;
}

.act-filter-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.act-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cor-texto, #333);
    cursor: pointer;
    text-align: left;
}

.act-filter-toggle svg {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.act-filter-toggle[aria-expanded="false"] svg {
    transform: rotate(-90deg);
}

.act-filter-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.act-filter-body[hidden] {
    display: none !important;
}

/* ── Opções (checkbox / radio) ───────────────────────────── */
.act-filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--cor-texto, #444);
    line-height: 1.3;
}

.act-filter-option input {
    accent-color: var(--cor-principal, #333);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.act-filter-option small {
    color: #aaa;
    font-size: 0.78rem;
}

.act-filter-option:hover {
    color: var(--cor-principal, #000);
}

/* ── Hierarquia de categorias ────────────────────────────── */
.act-filter-cat-children {
    padding-left: 1.25rem;
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ── Dropdown ────────────────────────────────────────────── */
.act-filter-select {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--cor-texto, #333);
    background: var(--cor-branco, #fff);
}

/* ── Swatches ────────────────────────────────────────────── */
.act-filter-body:has(.act-filter-swatch) {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.act-filter-swatch {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Oculta o input nativo dentro do swatch */
.act-filter-swatch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.act-filter-swatch:hover,
.act-filter-swatch.is-checked {
    border-color: var(--cor-principal, #333);
    transform: scale(1.08);
}

.act-swatch-color {
    display: block;
    width: 100%;
    height: 100%;
}

.act-swatch-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.act-swatch-text {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--cor-texto, #333);
    text-transform: uppercase;
}

/* ── Price Range Slider ──────────────────────────────────── */
.act-price-range {
    padding: 0.5rem 0;
}

.act-price-range__track {
    position: relative;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 1.5rem 0 0.75rem;
}

.act-price-range__fill {
    position: absolute;
    height: 100%;
    background: var(--cor-principal, #333);
    border-radius: 2px;
    pointer-events: none;
}

.act-price-range__input {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 4px;
    background: none;
    border: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.act-price-range__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cor-branco, #fff);
    cursor: pointer;
    pointer-events: all;
    border: 2px solid var(--cor-principal, #333);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.act-price-range__input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cor-branco, #fff);
    cursor: pointer;
    pointer-events: all;
    border: 2px solid var(--cor-principal, #333);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.act-price-range__labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--cor-texto, #555);
    font-weight: 600;
}

/* ── Botão aplicar ───────────────────────────────────────── */
.act-filters-submit {
    display: block;
    width: 100%;
    margin-top: 1.25rem;
    background: var(--cor-btn, var(--cor-principal, #333));
    color: var(--cor-branco, #fff);
    border: none;
    border-radius: 4px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.act-filters-submit:hover {
    opacity: 0.85;
}

.woocommerce-info.act-no-products {
    padding: 2rem 0;
}

/* ── Botão mobile (oculto no desktop) ───────────────────── */
.act-filter-mobile-btn {
    display: none;
}

/* ── Modal: passthrough no desktop ──────────────────────── */
.act-filter-modal__backdrop {
    display: none;
}

.act-filter-modal__head {
    display: none;
}

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 991px) {

    /* Oculta o filtro lateral, exibe botão trigger */
    .act-filter-modal {
        display: contents;
    }

    .act-filter-mobile-btn {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.55rem 1.1rem;
        background: var(--cor-btn, var(--cor-principal, #333));
        color: var(--cor-branco, #fff);
        border: none;
        border-radius: 4px;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        position: relative;
        margin-top: 4rem;
        min-width: unset;
        width: 100%;
        max-width: 300px;
        transition: opacity 0.2s;
    }

    .act-filter-mobile-btn:hover {
        opacity: 0.85;
    }

    .act-filter-mobile-btn__badge {
        position: absolute;
        top: -4px;
        right: -4px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--cor-destaque, #e74c3c);
        border: 2px solid var(--cor-branco, #fff);
    }

    /* Modal overlay — fechado por padrão */
    .act-filter-modal {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9998;
        pointer-events: none;
    }

    .act-filter-modal.is-open {
        pointer-events: all;
    }

    /* Backdrop */
    .act-filter-modal__backdrop {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .act-filter-modal.is-open .act-filter-modal__backdrop {
        opacity: 1;
    }

    /* Painel lateral (slide da direita) */
    .act-filter-modal__panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(360px, 90vw);
        background: var(--cor-branco, #fff);
        display: flex;
        flex-direction: column;
        overflow: hidden;
        transform: translateX(100%);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1;
    }

    .act-filter-modal.is-open .act-filter-modal__panel {
        transform: translateX(0);
    }

    /* Cabeçalho do modal */
    .act-filter-modal__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        flex-shrink: 0;
    }

    .act-filter-modal__title {
        font-size: var(--fs-5, 1.1rem);
        font-weight: 700;
        color: var(--cor-texto, #333);
    }

    .act-filter-modal__close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--cor-texto, #333);
        border-radius: 4px;
        transition: background 0.15s;
    }

    .act-filter-modal__close:hover {
        background: rgba(0, 0, 0, 0.06);
    }

    /* Corpo scrollável */
    .act-filter-modal__body {
        flex: 1;
        overflow-y: auto;
        padding: 0 1.25rem 1.25rem;
        overscroll-behavior: contain;
    }

    /* Oculta o header interno do form (substituído pelo cabeçalho do modal) */
    .act-filter-modal__body .act-filters-header {
        display: none;
    }

    /* Sidebar vira bloco normal dentro do modal */
    .act-shop-filters {
        position: static;
        min-width: 0;
        width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 1.25rem 0 0;
    }

    .woocommerce-archive .woocommerce-archive-container {
        flex-direction: column;
    }

    .woocommerce-archive .woocommerce-archive-container>.woocommerce-result-count,
    .woocommerce-archive .woocommerce-archive-container>.woocommerce-ordering,
    .woocommerce-archive .woocommerce-archive-container>ul.products,
    .woocommerce-archive .woocommerce-archive-container>nav.woocommerce-pagination {
        grid-column: 1;
    }
}