/* ==========================================================
   PILAR ONLINE | Catálogo das categorias
   Layout de vitrine com filtros laterais. Não altera o header
   nem o componente dos banners promocionais.
========================================================== */
.po-category-page,
.po-category-page * { box-sizing: border-box; }

.po-category-page.page-content {
    padding: 24px 0 78px !important;
    min-height: 400px;
    background: #fff;
    color: #202532;
    font-family: Poppins, sans-serif;
}
.po-category-page .po-category-container {
    width: 100%;
    max-width: 1570px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3.2vw, 46px);
}
.po-category-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 30px;
    margin-bottom: 24px;
    color: #333b49;
    font-size: 13px;
    font-weight: 500;
}
.po-category-crumbs a { color: #6a7280; text-decoration: none; }
.po-category-crumbs a:hover { color: #c1272d; }
.po-category-crumbs > span[aria-hidden] { color: #c3c8d0; }

.po-category-catalog {
    display: grid;
    grid-template-columns: minmax(220px, 248px) minmax(0, 1fr);
    align-items: start;
    column-gap: clamp(22px, 3.2vw, 45px);
}
.po-category-sidebar {
    align-self: start;
    padding: 8px 17px 22px 0;
    border-right: 1px solid #edf0f4;
    color: #272e3c;
}
.po-category-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid #e9ebef;
}
.po-category-sidebar-head h2 {
    margin: 0;
    font-size: 19px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: -.025em;
    color: #212630;
}
.po-category-sidebar-head a,
.po-category-clear {
    color: #9e3138;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
}
.po-category-sidebar-head a:hover,
.po-category-clear:hover { text-decoration: underline; }
.po-category-filter-section { padding: 20px 0; border-bottom: 1px solid #eef0f3; }
.po-category-filter-section h3 {
    margin: 0 0 14px;
    font-size: 15px;
    line-height: 1.3;
    color: #222632;
    font-weight: 600;
}
.po-category-tree { display: flex; flex-direction: column; gap: 5px; }
.po-category-tree-link {
    display: block;
    width: 100%;
    padding: 9px 10px 9px calc(11px + var(--po-nivel, 0) * 13px);
    border-radius: 8px;
    color: #4b5361;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 400;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: background-color .16s, color .16s;
}
.po-category-tree-link:hover { color: #c1272d; background: #fff3f3; }
.po-category-tree-link.is-selected {
    color: #ad1e28;
    background: #fdf0f1;
    font-weight: 600;
}
.po-category-filter-hint { display: block; font-size: 12px; line-height: 1.5; color: #8a919e; }
.po-category-filter-form { padding: 0; margin: 0; }
.po-category-price-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.po-category-price-fields label,
.po-category-label {
    display: block;
    color: #697180;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}
.po-category-price-fields input,
.po-category-filter-section select {
    display: block;
    width: 100%;
    height: 42px;
    margin-top: 7px;
    padding: 0 10px;
    color: #28303c;
    background: #fff;
    border: 1px solid #d8dde5;
    border-radius: 8px;
    outline: 0;
    font: 500 12px/1 Poppins, sans-serif;
}
.po-category-price-fields input:focus,
.po-category-filter-section select:focus,
.po-category-sort select:focus {
    border-color: #c1272d;
    box-shadow: 0 0 0 3px rgba(193,39,45,.10);
}
.po-category-price-fields input::placeholder { color: #a0a6b0; }
.po-category-price-fields input::-webkit-inner-spin-button { -webkit-appearance: none; }
.po-category-filter-section select { font-size: 13px; padding: 0 9px; }
.po-category-apply {
    display: block;
    width: 100%;
    min-height: 44px;
    margin-top: 20px;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: #c1272d;
    color: #fff;
    font: 600 13px/1.3 Poppins, sans-serif;
    cursor: pointer;
    transition: background-color .15s;
}
.po-category-apply:hover { background: #a62027; }
.po-category-clear { display: block; text-align: center; margin-top: 13px; }

.po-category-results { min-width: 0; }
.po-category-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #eff0f3;
}
.po-category-count {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    color: #626a78;
    font-size: 14px;
    font-weight: 400;
}
.po-category-count strong { color: #212936; font-weight: 600; }
.po-category-search-term { margin-left: 4px; font-size: 12px; color: #818996; }
.po-category-limit-note { margin: -7px 0 14px; color: #79818e; font-size: 12px; line-height: 1.55; }
.po-category-sort {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    color: #686f7c;
    font-size: 13px;
    font-weight: 500;
}
.po-category-sort select {
    min-height: 44px;
    max-width: 210px;
    padding: 0 32px 0 13px;
    border: 1px solid #dfe2e8;
    border-radius: 8px;
    background: #fff;
    color: #242936;
    font: 600 13px/1 Poppins, sans-serif;
    cursor: pointer;
    outline: none;
}

/* Lista de produtos: melhora a legibilidade sem mexer em outras vitrines. */
.po-category-page .po-category-product-grid.po-market-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 21px 15px;
    align-items: stretch;
}
.po-category-page .po-category-product-grid .po-market-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ecedf0;
    border-radius: 9px;
    background: #fff;
    box-shadow: none;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.po-category-page .po-category-product-grid .po-market-card:hover {
    border-color: #e0e2e7;
    box-shadow: 0 8px 24px rgba(30,35,50,.08);
    transform: translateY(-2px);
}
.po-category-page .po-category-product-grid .po-market-photo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    aspect-ratio: 4 / 5;
    border: 0;
    border-radius: 0;
    background: #f8f9fb;
    overflow: hidden;
}
.po-category-page .po-category-product-grid .po-market-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    transition: transform .3s ease;
}
.po-category-page .po-category-product-grid .po-market-card:hover .po-market-photo img { transform: scale(1.025); }
.po-category-page .po-category-product-grid .po-market-info {
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 12px 15px;
}
.po-category-page .po-category-product-grid .po-market-info small {
    display: block;
    color: #737c89;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}
.po-category-page .po-category-product-grid .po-market-info h2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    max-height: 43px;
    margin: 0;
    overflow: hidden;
    color: #252c37;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
    text-overflow: ellipsis;
}
.po-category-page .po-category-product-grid .po-market-info > strong {
    display: block;
    color: #1c2633;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}
.po-category-page .po-category-product-grid .po-store-open {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin-top: auto;
    color: #bb252e;
    background: none;
    border: 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.po-category-page .po-category-product-grid .po-store-open:hover { color: #ed6718; }
.po-category-page .po-category-empty { width: 100%; padding: 42px 20px; border: 1px solid #edeef0; border-radius: 12px; }
.po-category-mobile-toggle { display: none; }

/* Mantém quatro produtos lado a lado nas resoluções desktop usuais,
   inclusive 1280/1366px, com a barra lateral de filtros visível. */
@media (max-width: 1080px) {
    .po-category-page .po-category-product-grid.po-market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 980px) {
    .po-category-catalog { grid-template-columns: minmax(190px, 215px) minmax(0, 1fr); gap: 22px; }
    .po-category-page .po-category-product-grid.po-market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 720px) {
    .po-category-page.page-content { padding-top: 14px !important; }
    .po-category-page .po-category-container { padding: 0 15px; }
    .po-category-crumbs { margin-bottom: 15px; font-size: 12px; }
    .po-category-catalog { display: block; }
    .po-category-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        min-height: 44px;
        margin-bottom: 16px;
        padding: 10px 13px;
        border: 1px solid #dadde4;
        border-radius: 9px;
        background: #fff;
        color: #252b36;
        font: 600 14px/1.3 Poppins, sans-serif;
        cursor: pointer;
    }
    .po-category-mobile-toggle svg { width: 19px; height: 19px; flex: 0 0 19px; }
    .po-category-mobile-toggle span { margin-left: auto; font-size: 21px; line-height: 1; }
    .po-category-sidebar {
        display: none;
        padding: 0 15px 20px;
        margin-bottom: 18px;
        border: 1px solid #ebedf1;
        border-radius: 11px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(28,35,48,.04);
    }
    .po-category-sidebar.is-open { display: block; }
    .po-category-sidebar-head { padding: 16px 0 12px; }
    .po-category-toolbar { gap: 12px; }
    .po-category-sort { gap: 7px; font-size: 11px; }
    .po-category-sort select { min-height: 40px; max-width: 156px; font-size: 11px; padding-left: 9px; }
    .po-category-count { font-size: 12px; }
}
@media (max-width: 420px) {
    .po-category-page .po-category-product-grid.po-market-grid { gap: 12px 9px; }
    .po-category-page .po-category-product-grid .po-market-info { padding: 10px; gap: 6px; }
    .po-category-page .po-category-product-grid .po-market-info h2 { font-size: 12px; }
    .po-category-page .po-category-product-grid .po-market-info > strong { font-size: 17px; }
    .po-category-page .po-category-product-grid .po-market-info small { font-size: 10px; }
    .po-category-page .po-category-product-grid .po-store-open { font-size: 11px; }
    .po-category-toolbar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    .po-category-page .po-market-card,
    .po-category-page .po-market-photo img { transition: none !important; }
}
