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

/* --- IMAGEM: altura fixa e preenchimento integral na categoria ----------- */
.bp-catalog-products .bp-product-grid .bp-product-card > .bp-product-image {
    background: #f4efed;
    border-radius: var(--bp-radius) !important;
    display: block !important;
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    isolation: isolate;
    overflow: hidden !important;
    position: relative !important;
}

.bp-catalog-products .bp-product-grid .bp-product-card > .bp-product-image::before {
    content: none !important;
    display: none !important;
    padding: 0 !important;
}

.bp-catalog-products .bp-product-grid .bp-product-card > .bp-product-image > img {
    border-radius: inherit !important;
    display: block !important;
    height: 200px !important;
    inset: 0 !important;
    margin: 0 !important;
    max-height: 200px !important;
    max-width: none !important;
    min-height: 200px !important;
    object-fit: cover !important;
    object-position: center center !important;
    padding: 0 !important;
    position: absolute !important;
    visibility: visible !important;
    width: 100% !important;
    z-index: 1;
}

.bp-catalog-products .bp-product-grid .bp-product-badge {
    z-index: 2;
}

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

/* --- 5 COLUNAS ----------------------------------------------------------- */
.bp-product-grid {
    grid-template-columns: repeat(5, 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(4, 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;
    }
}

/* --- SIDEBAR BOUTIQUE: templates proprios, sem estrutura visual RWD ------ */
.bp-filter-sidebar {
    color: var(--bp-text);
    font-family: var(--bp-sans);
    width: 100%;
}

.bp-filter-sidebar__heading {
    border-bottom: 1px solid var(--bp-border);
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 14px;
    padding-bottom: 15px;
}

.bp-filter-sidebar__eyebrow,
.bp-filter-active__label {
    color: var(--bp-primary);
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.bp-filter-sidebar__heading strong {
    color: var(--bp-text);
    font-family: var(--bp-display);
    font-size: 1.45rem;
    font-weight: 500;
    line-height: 1.05;
}

.bp-filter-active {
    background: var(--bp-soft);
    border-radius: 14px;
    margin-bottom: 14px;
    padding: 12px;
}

.bp-filter-active__label {
    display: block;
    margin-bottom: 8px;
}

.bp-filter-active ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bp-filter-active li {
    align-items: center;
    background: var(--bp-card);
    border: 1px solid var(--bp-border);
    border-radius: 999px;
    display: inline-flex;
    font-size: .68rem;
    font-weight: 600;
    gap: 6px;
    line-height: 1;
    max-width: 100%;
    padding: 5px 7px 5px 9px;
}

.bp-filter-active li > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bp-filter-active li a {
    align-items: center;
    background: var(--bp-primary);
    border-radius: 50%;
    color: var(--bp-on-primary);
    display: inline-flex;
    font-size: .8rem;
    height: 15px;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    width: 15px;
}

.bp-filter-sidebar__clear {
    margin: -5px 0 14px;
}

.bp-filter-sidebar__clear a {
    color: var(--bp-muted);
    font-size: .7rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bp-filter-sidebar__clear a:hover {
    color: var(--bp-primary);
}

.bp-filter-groups {
    display: block;
    margin: 0;
    padding: 0;
}

.bp-filter-group {
    border-top: 1px solid var(--bp-border);
    padding: 14px 0;
}

.bp-filter-group:first-child {
    border-top: 0;
    padding-top: 0;
}

.bp-filter-group dt {
    color: var(--bp-text);
    font-size: .73rem;
    font-weight: 800;
    letter-spacing: .055em;
    line-height: 1.2;
    margin: 0 0 9px;
    text-transform: uppercase;
}

.bp-filter-group dd {
    margin: 0;
}

.bp-filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bp-filter-option > a,
.bp-filter-option > span {
    align-items: center;
    border-radius: 8px;
    color: var(--bp-muted);
    display: flex;
    font-size: .76rem;
    gap: 8px;
    justify-content: space-between;
    line-height: 1.2;
    padding: 7px 8px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.bp-filter-option > a:hover {
    background: var(--bp-soft);
    color: var(--bp-text);
}

.bp-filter-option small {
    color: var(--bp-muted);
    font-size: .64rem;
    font-weight: 600;
}

.bp-filter-option.is-disabled > span {
    opacity: .4;
}

/* Exatamente seis cores por linha. Rotulo e quantidade ficam dentro do card. */
.bp-filter-color-grid {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}

.bp-filter-color {
    aspect-ratio: 1;
    min-width: 0;
}

.bp-filter-color > a,
.bp-filter-color > span {
    border: 1px solid var(--bp-border);
    border-radius: 9px;
    display: block;
    height: 100%;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    width: 100%;
}

.bp-filter-color > a:hover {
    border-color: var(--bp-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bp-primary) 18%, transparent);
    transform: translateY(-1px);
}

.bp-filter-color__swatch,
.bp-filter-color__swatch img {
    display: block;
    height: 100%;
    width: 100%;
}

.bp-filter-color__swatch {
    background: var(--bp-soft);
    color: var(--bp-text);
    font-size: .54rem;
    line-height: 1.1;
    overflow: hidden;
    text-align: center;
}

.bp-filter-color__swatch > span {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    overflow: hidden;
    padding: 3px;
}

.bp-filter-color__swatch img {
    object-fit: cover;
}

.bp-filter-color__meta > span {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.bp-filter-color__meta small {
    align-items: center;
    background: rgba(31, 22, 25, .72);
    border-radius: 999px;
    color: #fff;
    display: flex;
    font-size: .58rem;
    font-weight: 700;
    height: 17px;
    justify-content: center;
    line-height: 1;
    min-width: 17px;
    padding: 0 4px;
    position: absolute;
    right: 4px;
    top: 4px;
}

.bp-filter-color.is-disabled > span {
    cursor: default;
    opacity: .35;
}

@media (max-width: 770px) {
    .bp-filter-sidebar {
        margin-bottom: 22px;
    }

    .bp-filter-color-grid {
        gap: 7px;
    }
}
