/* ==========================================================================
 * CATEGORIA GRID + OTIMIZACOES
 * 4 colunas, swatches compactos, tipografia ajustada, sidebar boutique
 * ========================================================================== */

/* --- IMAGEM: corrige exibicao na categoria ------------------------------- */
.bp-catalog-products .bp-product-image::before {
    display: none;
}

.bp-catalog-products .bp-product-image img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
}

.bp-catalog-products .bp-product-image {
    background: linear-gradient(135deg, #f4efed 0%, #ede2e5 50%, #f9f0f3 100%);
    overflow: visible;
}

.bp-product-image {
    background: linear-gradient(135deg, #f4efed 0%, #ede2e5 50%, #f9f0f3 100%);
}

/* --- 5 COLUNAS ----------------------------------------------------------- */
.bp-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* --- CENTRALIZAR --------------------------------------------------------- */
.bp-product-info,
.bp-product-info h2,
.bp-product-info h3,
.bp-product-info .product-name,
.bp-product-info .price-box,
.bp-product-info .bp-payment-info,
.bp-product-info .bp-payment-cash,
.bp-product-info .bp-product-actions {
    text-align: center;
    justify-content: center;
}

.bp-product-info h2 a,
.bp-product-info h3 a {
    display: block;
}

/* --- ESPACAMENTO VERTICAL REDUZIDO --------------------------------------- */
.bp-product-info {
    min-height: auto !important;
    padding-top: 9px !important;
}

.bp-product-info h2,
.bp-product-info h3,
.bp-product-info .product-name {
    font-size: .84rem;
    line-height: 1.3;
    margin: 0 0 2px !important;
    min-height: auto !important;
}

.bp-product-info .price-box {
    margin: 0 !important;
}

.bp-product-info .price {
    font-size: 1.06rem;
    font-weight: 850;
}

.bp-product-info .old-price .price {
    font-size: .74rem;
    font-weight: 500;
}

.bp-payment-info {
    gap: 0;
    margin: 2px 0 0 !important;
}

.bp-payment-cash {
    align-items: center;
    flex-wrap: wrap;
    gap: 4px !important;
}

/* --- BADGE PIX: peso 600 + alinhamento corrigido ------------------------- */
.bp-payment-badge {
    align-items: center;
    display: inline-flex;
    flex: none;
    font-weight: 600 !important;
    padding: 3px 7px !important;
    font-size: .6rem !important;
    letter-spacing: .02em !important;
}

.bp-payment-copy {
    align-items: baseline;
    gap: 3px;
}

.bp-payment-copy strong {
    font-weight: 600 !important;
    font-size: .86rem !important;
    line-height: 1.2;
}

.bp-payment-copy small {
    font-size: .66rem !important;
}

/* --- SWATCHES: 50% menor, preenche o card, centralizado ------------------ */
.products-grid .configurable-swatch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    margin: 5px 0 0 !important;
}

.products-grid .configurable-swatch-list li {
    display: inline-flex !important;
    float: none !important;
    margin: 0 !important;
    vertical-align: top !important;
}

.products-grid .swatch-link {
    border: 1px solid var(--bp-border) !important;
    border-radius: 4px !important;
    display: block !important;
    height: 20px !important;
    margin: 0 !important;
    min-height: 20px !important;
    min-width: 20px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: relative !important;
    width: 20px !important;
    box-sizing: content-box !important;
}

.products-grid .swatch-label {
    background: transparent !important;
    border: 0 !important;
    border-radius: 3px !important;
    display: block !important;
    font-size: 8px !important;
    height: 18px !important;
    line-height: 18px !important;
    margin: 0 !important;
    min-height: 18px !important;
    min-width: 18px !important;
    padding: 0 !important;
    position: relative !important;
    width: 18px !important;
}

.products-grid .swatch-link.has-image .swatch-label {
    position: relative;
}

.products-grid .swatch-label img {
    border-radius: 2px !important;
    height: 100% !important;
    inset: 0 !important;
    object-fit: cover !important;
    position: absolute !important;
    width: 100% !important;
}

.products-grid .swatch-link:hover,
.products-grid .configurable-swatch-list .hover .swatch-link,
.products-grid .configurable-swatch-list .selected .swatch-link {
    border-color: var(--bp-primary) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--bp-primary) 22%, transparent) !important;
    transform: translateY(-1px);
}

/* --- SIDEBAR FILTROS: design boutique do zero ----------------------------- */

.col-left.sidebar {
    padding-right: 28px;
}

/* Remove herancas do tema RWD antigo */
.block-layered-nav,
.block-layered-nav .block-content,
.block-layered-nav dl,
.block-layered-nav dt,
.block-layered-nav dd,
.block-layered-nav ol,
.block-layered-nav li {
    background: transparent;
    border: 0;
    float: none;
    margin: 0;
    padding: 0;
}

.block-layered-nav .block-title {
    border: 0;
    margin: 0 0 18px;
    padding: 0;
}

.block-layered-nav .block-title strong {
    color: var(--bp-text);
    font-family: var(--bp-display);
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: -.01em;
}

.block-layered-nav .block-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.block-layered-nav > .block-subtitle {
    display: none;
}

/* --- Filtros ativos (currently) --- */
.block-layered-nav .currently {
    border-bottom: 1px solid var(--bp-border);
    margin: 0 0 18px;
    padding: 0 0 16px;
}

.block-layered-nav .currently .block-subtitle {
    color: var(--bp-muted);
    display: block;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.block-layered-nav .currently ol {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.block-layered-nav .currently li {
    background: var(--bp-primary);
    border: 0;
    border-radius: 999px;
    color: var(--bp-on-primary);
    display: inline-flex;
    align-items: center;
    font-size: .68rem;
    font-weight: 600;
    gap: 5px;
    line-height: 1;
    padding: 6px 10px;
}

.block-layered-nav .currently li .btn-remove {
    background: rgba(255,255,255,.25);
    border: 0;
    border-radius: 50%;
    color: var(--bp-on-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    height: 16px;
    line-height: 1;
    margin: 0;
    padding: 0;
    position: static;
    text-decoration: none;
    width: 16px;
    transition: background .15s;
}

.block-layered-nav .currently li .btn-remove:hover {
    background: rgba(255,255,255,.5);
}

.block-layered-nav .currently .swatch-current {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: static;
}

.block-layered-nav .currently .swatch-current .btn-remove {
    margin: 0;
    position: static;
}

.block-layered-nav .currently .swatch-link {
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 3px;
    height: 14px;
    margin: 0;
    min-height: 14px;
    min-width: 14px;
    width: 14px;
}

.block-layered-nav .currently .swatch-label {
    border: 0;
    border-radius: 2px;
    height: 12px;
    line-height: 12px;
    min-height: 12px;
    min-width: 12px;
    width: 12px;
}

.block-layered-nav .currently .swatch-label img {
    border-radius: 2px;
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

.block-layered-nav .actions {
    border: 0;
    margin: 0;
    padding: 4px 0 0;
}

.block-layered-nav .actions a {
    color: var(--bp-muted);
    font-size: .68rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .15s;
}

.block-layered-nav .actions a:hover {
    color: var(--bp-primary);
}

/* --- Lista de filtros --- */
.block-layered-nav dl {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.block-layered-nav dt {
    border: 0;
    border-top: 1px solid var(--bp-border);
    color: var(--bp-text);
    cursor: default;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    padding: 15px 0 0;
    text-transform: uppercase;
    user-select: none;
}

.block-layered-nav dt:first-child {
    border-top: 0;
    padding-top: 4px;
}

.block-layered-nav dd {
    padding: 6px 0 2px;
}

.block-layered-nav dd ol {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.block-layered-nav dd li {
    color: var(--bp-text);
    font-size: .76rem;
    line-height: 1.4;
}

.block-layered-nav dd a {
    align-items: center;
    border-radius: 6px;
    color: var(--bp-muted);
    display: flex;
    font-size: .74rem;
    font-weight: 500;
    padding: 7px 8px;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
}

.block-layered-nav dd a:hover {
    background: var(--bp-soft);
    color: var(--bp-text);
}

.block-layered-nav dd .count {
    color: var(--bp-muted);
    font-size: .62rem;
    font-weight: 500;
    margin-left: auto;
    opacity: .6;
    padding-left: 8px;
}

/* --- Swatches no filtro lateral: grid compacto de cores --- */
#narrow-by-list .configurable-swatch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 2px 0 0;
}

#narrow-by-list .configurable-swatch-list li {
    margin: 0;
    width: auto;
}

#narrow-by-list .swatch-link {
    border: 1px solid var(--bp-border);
    border-radius: 5px;
    cursor: pointer;
    display: block;
    height: 28px;
    line-height: normal;
    margin: 0;
    min-height: 28px;
    min-width: 28px;
    overflow: hidden;
    padding: 0;
    position: relative;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    width: 28px;
}

#narrow-by-list .swatch-link.has-image {
    line-height: inherit;
}

#narrow-by-list .swatch-label {
    background: transparent;
    border: 0;
    border-radius: 4px;
    display: block;
    font-size: 9px;
    height: 26px;
    line-height: 26px;
    margin: 0;
    min-height: 26px;
    min-width: 26px;
    padding: 0;
    position: relative;
    text-align: center;
    width: 26px;
}

#narrow-by-list .swatch-label img {
    border-radius: 4px;
    display: block;
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

#narrow-by-list .swatch-link:hover {
    border-color: var(--bp-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--bp-primary) 18%, transparent);
    transform: translateY(-1px);
}

#narrow-by-list dd .swatch-link:hover .swatch-label {
    border-color: transparent;
}

/* --- RESPONSIVO ---------------------------------------------------------- */
@media (max-width: 1199px) {
    .bp-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 770px) {
    .bp-product-grid {
        gap: 18px 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .bp-product-info {
        padding-top: 7px !important;
    }

    .bp-product-info h2,
    .bp-product-info h3,
    .bp-product-info .product-name {
        font-size: .76rem;
    }

    .bp-product-info .price {
        font-size: .92rem;
    }

    .bp-payment-copy strong {
        font-size: .78rem !important;
    }

    .bp-payment-cash {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 3px !important;
    }

    .bp-payment-copy {
        gap: 2px;
    }

    .col-left.sidebar {
        padding-right: 0;
    }

    .sidebar .block-layered-nav {
        margin-bottom: 20px;
    }
}

@media (max-width: 420px) {
    .bp-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
