/* ==========================================================
   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; }
}

/* ==============================================================
   PILAR ONLINE | Diretório de categorias A–Z e destaque principal
   Escopo isolado: categoria.php (sem interferir nas vitrines).
================================================================ */
.po-az-categories {
    width: 100%;
    min-width: 0;
    font-family: Poppins, sans-serif;
    color: #232b38;
}
.po-az-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 24px;
}
.po-az-heading { min-width: 0; }
.po-az-eyebrow {
    display: inline-block;
    margin-bottom: 11px;
    color: #c1272d;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
}
.po-az-heading h1 {
    margin: 0 0 7px;
    font-size: clamp(27px, 2.5vw, 38px);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.2;
    color: #212938;
}
.po-az-heading p {
    margin: 0;
    max-width: 660px;
    color: #687386;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
}
.po-az-search-wrap { flex: 0 1 355px; min-width: 230px; }
.po-az-search-wrap label {
    display: block;
    margin-bottom: 7px;
    color: #344054;
    font-size: 12px;
    font-weight: 500;
}
.po-az-search-field { position: relative; }
.po-az-search-field svg {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: #8b93a3;
    pointer-events: none;
}
.po-az-search-field input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    border: 1px solid #dfe4eb;
    border-radius: 11px;
    background: #fff;
    color: #273143;
    outline: none;
    font: 400 13px/1.4 Poppins, sans-serif;
    box-shadow: 0 2px 7px rgba(35,42,55,.025);
    transition: border-color .18s, box-shadow .18s;
}
.po-az-search-field input:focus {
    border-color: #d35658;
    box-shadow: 0 0 0 4px rgba(193,39,45,.09);
}
.po-az-search-field input::placeholder { color: #929bac; }
.po-az-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    color: #737e91;
    font-size: 12px;
}
.po-az-summary strong { color: #263247; font-weight: 700; }
.po-az-index {
    display: grid;
    grid-template-columns: repeat(26, minmax(0, 1fr));
    align-items: center;
    gap: 4px;
    margin-bottom: 30px;
    padding: 10px 12px;
    border: 1px solid #e9ecf0;
    border-radius: 12px;
    background: #fbfcfd;
}
.po-az-index a,
.po-az-index span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 32px;
    border-radius: 7px;
    color: #b4bcc9;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.po-az-index a { color: #414c60; transition: background-color .18s, color .18s; }
.po-az-index a:hover,
.po-az-index a:focus-visible {
    background: #fdf0f0;
    color: #bb2831;
    outline: none;
}
.po-az-index span { user-select: none; }
.po-az-groups { display: grid; gap: 31px; }
.po-az-group { scroll-margin-top: 110px; }
.po-az-letter-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 15px;
}
.po-az-letter {
    display: grid;
    place-items: center;
    flex: 0 0 39px;
    height: 39px;
    border-radius: 11px;
    background: linear-gradient(135deg, #c1272d, #ed572b);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 4px 11px rgba(193,39,45,.12);
}
.po-az-letter-line { height: 1px; flex: 1; background: #e9edf2; }
.po-az-letter-head small { flex-shrink: 0; font-size: 11px; color: #919aab; }
.po-az-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.po-az-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 84px;
    padding: 15px 13px;
    border: 1px solid #e9ecf1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(31,41,58,.025);
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.po-az-card:hover,
.po-az-card:focus-visible {
    border-color: #f0b6ad;
    box-shadow: 0 9px 21px rgba(58,48,51,.08);
    transform: translateY(-2px);
    outline: none;
}
.po-az-card-symbol {
    display: grid;
    place-items: center;
    flex: 0 0 43px;
    height: 43px;
    border: 1px solid #ffdbd6;
    border-radius: 10px;
    background: #fff4f1;
    color: #c1272d;
    font-size: 19px;
    font-weight: 700;
}
.po-az-card:nth-child(3n+2) .po-az-card-symbol {
    border-color: #ffdfc8;
    background: #fff7ed;
    color: #d65d20;
}
.po-az-card:nth-child(3n+3) .po-az-card-symbol {
    border-color: #dee6f1;
    background: #f5f7fb;
    color: #556a83;
}
.po-az-card-text { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }
.po-az-card-text strong {
    overflow-wrap: anywhere;
    color: #293143;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}
.po-az-card-text small { overflow-wrap: anywhere; color: #8d96a5; font-size: 10px; line-height: 1.4; }
.po-az-card-arrow { flex: 0 0 16px; color: #b4bdc9; transition: transform .18s, color .18s; }
.po-az-card:hover .po-az-card-arrow { transform: translateX(2px); color: #c1272d; }
.po-az-no-results {
    padding: 42px 24px;
    border: 1px dashed #e0e6ed;
    border-radius: 13px;
    background: #fbfcfd;
    text-align: center;
}
.po-az-no-results strong { color: #293345; font-size: 16px; font-weight: 600; }
.po-az-no-results p { margin: 7px 0 0; color: #7d8798; font-size: 13px; }
.po-az-card[hidden], .po-az-group[hidden], .po-az-index[hidden],
.po-az-no-results[hidden] { display: none !important; }

/* Alternativa premium quando a categoria mais popular não possui banner cadastrado. */
.po-category-hero-fallback {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: clamp(170px, 21vw, 330px);
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(136,45,51,.12);
    background: linear-gradient(110deg, #581c28 0%, #b72931 49%, #f47016 100%);
    color: #fff;
    font-family: Poppins, sans-serif;
}
.po-category-hero-fallback::after {
    content: '';
    position: absolute;
    z-index: -1;
    top: -120%; right: -10%;
    width: 60vw; height: 60vw;
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 50%;
    box-shadow: 0 0 0 45px rgba(255,255,255,.035), 0 0 0 96px rgba(255,255,255,.025);
}
.po-category-hero-picture {
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.po-category-hero-fallback:has(.po-category-hero-picture)::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(90deg, rgba(30,25,29,.78), rgba(30,25,29,.15));
}
.po-category-hero-content {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 32px clamp(20px, 4vw, 56px);
}
.po-category-hero-tag { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #ffe0d1; }
.po-category-hero-content h2 {
    margin: 8px 0;
    max-width: 720px;
    color: #fff;
    font-size: clamp(28px, 4.2vw, 52px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.035em;
}
.po-category-hero-content p { margin: 0 0 18px; max-width: 580px; font-size: 14px; line-height: 1.5; color: #fff3ee; }
.po-category-hero-content a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 9px;
    background: #fff;
    color: #a52129;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.po-category-hero-content a:hover { background: #fff1e9; }
@media (max-width: 1180px) {
    .po-az-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .po-az-index { grid-template-columns: repeat(13, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .po-az-intro { align-items: stretch; flex-direction: column; gap: 18px; }
    .po-az-search-wrap { flex: none; min-width: 0; }
    .po-az-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .po-az-index { grid-template-columns: repeat(13, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .po-az-heading h1 { font-size: 29px; }
    .po-az-heading p { font-size: 13px; }
    .po-az-summary-hint { display: none; }
    .po-az-card-grid { gap: 9px; }
    .po-az-card { padding: 11px; min-height: 91px; gap: 8px; align-items: flex-start; }
    .po-az-card-symbol { flex-basis: 33px; height: 33px; font-size: 15px; border-radius: 8px; }
    .po-az-card-text strong { font-size: 12px; }
    .po-az-card-text small { font-size: 10px; }
    .po-az-card-arrow { display: none; }
    .po-az-index { padding: 8px; gap: 0; }
    .po-az-index a, .po-az-index span { height: 32px; font-size: 11px; }
    .po-az-letter-head { gap: 10px; }
    .po-az-groups { gap: 26px; }
    .po-category-hero-fallback { min-height: 210px; }
    .po-category-hero-content { padding: 24px 18px; }
    .po-category-hero-content h2 { font-size: 29px; }
    .po-category-hero-content p { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .po-az-card, .po-az-card-arrow { transition: none; }
}

/* Categoria com foto cadastrada: usa a imagem real, sem perder o fallback. */
.po-az-card-symbol img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}
