/* ══════════════════════════════════════════════════
   Página de produtos — mesmo visual da página inicial
   ══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #f5f4f0;
    color: #1a1a1a;
    overflow-x: hidden;
}

.loja {
    --h-ink: #17131c;
    --h-muted: #6e6875;
    --h-line: rgba(23, 19, 28, .08);
    --h-surface: #ffffff;
    --h-soft: #efede8;
    --h-brand: var(--marca);
    --h-brand-dark: var(--marca-escura);
    --h-brand-soft: var(--marca-t90);
    --h-sale: #d9184b;
    --h-radius: 20px;
    --h-gap: 1.25rem;
    color: var(--h-ink);
    padding-bottom: 4rem;
}

/* ── Cabeçalho ─────────────────────────────────── */
.pl-hero { padding: 1.75rem 0 1.5rem; }

.pl-crumbs {
    display: flex; align-items: center; flex-wrap: wrap; gap: .4rem;
    font-size: .78rem; color: var(--h-muted);
    margin-bottom: 1.1rem;
}

.pl-crumbs a { color: var(--h-muted); text-decoration: none; }
.pl-crumbs a:hover { color: var(--h-brand); }
.pl-crumbs i { font-size: .62rem; opacity: .6; }
.pl-crumbs span { color: var(--h-ink); font-weight: 600; }

.h-kicker {
    display: inline-block;
    font-size: .72rem; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--h-brand);
    margin-bottom: .4rem;
}

.pl-title {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 800; letter-spacing: -.03em; line-height: 1.08;
    margin: 0 0 .35rem;
    overflow-wrap: anywhere;
}

.pl-sub { font-size: .9rem; color: var(--h-muted); margin: 0; }

.pl-chips {
    display: flex; gap: .5rem;
    margin-top: 1.4rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: .15rem;
}

.pl-chips::-webkit-scrollbar { display: none; }

.pl-chip {
    flex-shrink: 0;
    padding: .55rem 1.05rem;
    border-radius: 999px;
    background: var(--h-surface);
    border: 1px solid var(--h-line);
    color: var(--h-ink);
    font-size: .83rem; font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s, color .18s, border-color .18s;
}

.pl-chip:hover { border-color: var(--h-brand); color: var(--h-brand); }

.pl-chip.active {
    background: var(--h-brand); border-color: var(--h-brand); color: #fff;
}

/* ── Layout ────────────────────────────────────── */
.prods-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
}

/* ── Filtros ───────────────────────────────────── */
.prods-sidebar { min-width: 0; }

.sidebar-card {
    background: var(--h-surface);
    border: 1px solid var(--h-line);
    border-radius: var(--h-radius);
}

.sidebar-head {
    display: flex; align-items: center; gap: .75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--h-line);
}

.sidebar-title {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .95rem; font-weight: 800;
    margin-right: auto;
}

.sidebar-clear {
    font-size: .76rem; font-weight: 700;
    color: var(--h-brand); text-decoration: none;
}

.sidebar-clear:hover { text-decoration: underline; }

.sidebar-close {
    display: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--h-line);
    background: var(--h-surface);
    color: var(--h-ink);
}

.sidebar-section {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--h-line);
}

.sidebar-section:last-child { border-bottom: none; }

.sidebar-label {
    display: block;
    font-size: .7rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--h-muted);
    margin-bottom: .7rem;
}

/* categorias */
.cats-accordion { display: flex; flex-direction: column; gap: .15rem; margin: 0 -.5rem; }

.cat-row {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    width: 100%;
    padding: .55rem .6rem;
    border: none; background: transparent;
    border-radius: 10px;
    font: inherit; font-size: .86rem; font-weight: 600;
    color: var(--h-ink); text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.cat-row:hover { background: var(--h-soft); color: var(--h-ink); }

.cat-row.active,
.cat-row.active-parent { background: var(--h-brand-soft); color: var(--h-brand); }

.cat-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cat-chevron { font-size: .72rem; opacity: .6; transition: transform .2s; }
.cat-toggle[aria-expanded="true"] .cat-chevron { transform: rotate(180deg); }

.cat-sub-list {
    display: none;
    margin: .2rem 0 .35rem .85rem;
    padding-left: .6rem;
    border-left: 2px solid var(--h-line);
}

.cat-sub-list.open { display: block; }

.cat-sub-item {
    display: block;
    padding: .42rem .6rem;
    border-radius: 8px;
    font-size: .82rem; color: var(--h-muted);
    text-decoration: none;
}

.cat-sub-item:hover { color: var(--h-ink); background: var(--h-soft); }
.cat-sub-item.active { color: var(--h-brand); font-weight: 700; }

/* busca e preço */
.sidebar-search,
.price-field {
    display: flex; align-items: center; gap: .45rem;
    background: var(--h-soft);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0 .8rem;
    transition: border-color .15s, background .15s;
}

.sidebar-search:focus-within,
.price-field:focus-within { background: var(--h-surface); border-color: var(--h-brand); }

.sidebar-search i,
.price-field span { color: var(--h-muted); font-size: .8rem; flex-shrink: 0; }

.sidebar-search input,
.price-input {
    flex: 1; min-width: 0;
    border: none; background: transparent;
    padding: .65rem 0;
    font: inherit; font-size: .84rem; color: var(--h-ink);
}

.sidebar-search input:focus,
.price-input:focus { outline: none; }

.price-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.price-field { min-width: 0; margin: 0; }
.price-input { width: 100%; }

/* promoção como chave */
.promo-toggle {
    display: flex; align-items: center; gap: .65rem;
    font-size: .86rem; font-weight: 600;
    cursor: pointer; user-select: none;
    margin: 0;
}

.promo-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.promo-switch {
    position: relative;
    width: 38px; height: 22px; flex-shrink: 0;
    border-radius: 99px;
    background: #d8d4dc;
    transition: background .2s;
}

.promo-switch::after {
    content: "";
    position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
}

.promo-toggle input:checked + .promo-switch { background: var(--h-brand); }
.promo-toggle input:checked + .promo-switch::after { transform: translateX(16px); }
.promo-toggle input:focus-visible + .promo-switch { outline: 2px solid var(--h-brand); outline-offset: 2px; }

.btn-apply {
    width: 100%;
    border: none; border-radius: 12px;
    padding: .75rem;
    background: var(--h-brand); color: #fff;
    font: inherit; font-size: .88rem; font-weight: 700;
    transition: background .18s;
}

.btn-apply:hover { background: var(--h-brand-dark); }

/* ── Barra de resultados ───────────────────────── */
.prods-toolbar {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.btn-mobile-filter {
    display: none;
    align-items: center; gap: .45rem;
    padding: .6rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--h-line);
    background: var(--h-surface);
    font: inherit; font-size: .85rem; font-weight: 700; color: var(--h-ink);
}

.filter-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--h-brand);
}

.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; min-width: 0; }

.fchip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .38rem .55rem .38rem .85rem;
    border-radius: 999px;
    background: var(--h-brand-soft);
    color: var(--h-brand);
    font-size: .78rem; font-weight: 600;
    text-decoration: none;
}

.fchip:hover { background: var(--h-brand); color: #fff; }

.sort-wrap {
    display: flex; align-items: center; gap: .5rem;
    margin: 0 0 0 auto;
    font-size: .82rem; color: var(--h-muted);
    white-space: nowrap;
}

.sort-select {
    border: 1px solid var(--h-line);
    border-radius: 12px;
    background: var(--h-surface);
    padding: .55rem 2rem .55rem .85rem;
    font: inherit; font-size: .85rem; font-weight: 600; color: var(--h-ink);
    cursor: pointer;
}

.sort-select:focus { outline: none; border-color: var(--h-brand); }

/* ── Grade ─────────────────────────────────────── */
.prods-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--h-gap);
}

/* ── Card de produto (igual à home) ────────────── */
.pcard {
    position: relative;
    display: flex; flex-direction: column;
    height: 100%;
    background: var(--h-surface);
    border: 1px solid var(--h-line);
    border-radius: var(--h-radius);
    overflow: hidden;
    transition: box-shadow .25s ease, transform .25s ease, opacity .6s ease;
}

.pcard:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px -18px rgba(23,19,28,.35);
}

.pcard-img-wrap {
    position: relative; overflow: hidden;
    flex-shrink: 0;
    background: var(--h-soft);
}

.pcard-img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
    transition: opacity .35s ease, transform .5s ease;
}

.pcard-img-hover { position: absolute; inset: 0; opacity: 0; }

.pcard:hover .pcard-img-hover { opacity: 1; transform: scale(1.04); }
.pcard:hover .pcard-img-main  { opacity: 0; transform: scale(1.04); }

.pcard-badge {
    position: absolute; top: 12px; left: 12px; z-index: 3;
    background: var(--h-sale); color: #fff;
    font-size: .72rem; font-weight: 800; letter-spacing: .02em;
    padding: .3rem .6rem; border-radius: 8px;
}

.pcard-fav {
    position: absolute; top: 10px; right: 10px; z-index: 4;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    color: var(--h-ink);
    font-size: .95rem;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0,0,0,.1);
    transition: color .18s, transform .18s;
}

.pcard-fav:hover { color: var(--h-sale); transform: scale(1.08); }
.pcard-fav.active { color: var(--h-sale); }

.pcard-body {
    display: flex; flex-direction: column; flex: 1;
    padding: 1rem 1.1rem 1.1rem;
}

.pcard-cat {
    font-size: .72rem; color: var(--h-muted);
    margin-bottom: .3rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pcard-title {
    font-size: .9rem; font-weight: 600;
    line-height: 1.35; min-height: 2.7em;
    margin: 0 0 .55rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

.pcard-title a { color: var(--h-ink); text-decoration: none; }
.pcard-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }

.pcard-price {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .5rem;
    margin-bottom: 1rem;
}

.pcard-price-normal,
.pcard-price-promo {
    font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em;
    color: var(--h-ink);
}

.pcard-price-promo { color: var(--h-sale); }

.pcard-price-old { font-size: .8rem; color: #9b96a0; text-decoration: line-through; }

.pcard-btn {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    margin-top: auto;
    padding: .65rem .75rem;
    border-radius: 12px;
    background: var(--h-brand-soft);
    color: var(--h-brand);
    font-size: .82rem; font-weight: 700;
    text-decoration: none;
    transition: background .18s, color .18s;
}

.pcard-btn i { transition: transform .2s; }

.pcard:hover .pcard-btn,
.pcard-btn:focus-visible { background: var(--h-brand); color: #fff; }

.pcard:hover .pcard-btn i { transform: translateX(3px); }

/* ── Vazio ─────────────────────────────────────── */
.empty-box {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--h-surface);
    border: 1px solid var(--h-line);
    border-radius: var(--h-radius);
}

.empty-icon {
    display: inline-grid; place-items: center;
    width: 64px; height: 64px;
    border-radius: 18px;
    background: var(--h-brand-soft); color: var(--h-brand);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.empty-title { font-size: 1.2rem; font-weight: 800; margin: 0 0 .4rem; }
.empty-sub { color: var(--h-muted); font-size: .9rem; margin-bottom: 1.5rem; }

.btn-empty {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .8rem 1.4rem;
    border-radius: 12px;
    background: var(--h-brand); color: #fff;
    font-weight: 700; font-size: .88rem;
    text-decoration: none;
}

.btn-empty:hover { background: var(--h-brand-dark); color: #fff; }

/* ── Paginação ─────────────────────────────────── */
.prods-paginacao {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: .4rem;
    margin-top: 2.5rem;
}

.pag-btn {
    min-width: 42px; height: 42px;
    padding: 0 .8rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--h-line);
    background: var(--h-surface);
    color: var(--h-ink);
    font-weight: 700; font-size: .88rem;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}

.pag-btn:hover { border-color: var(--h-brand); color: var(--h-brand); }
.pag-btn.active { background: var(--h-brand); border-color: var(--h-brand); color: #fff; }
.pag-gap { color: var(--h-muted); padding: 0 .2rem; }

/* ── Animação ──────────────────────────────────── */
.fade-up { opacity: 0; transform: translateY(18px); }
.fade-up.visible { opacity: 1; transform: none; }
.fade-up.visible:hover { transform: translateY(-4px); }

@media (prefers-reduced-motion: reduce) {
    .fade-up { opacity: 1; transform: none; }
    .pcard, .pcard-img { transition: none; }
}

/* ── Responsivo ────────────────────────────────── */
@media (max-width: 1199.98px) {
    .prods-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 1.25rem; }
}

@media (max-width: 991.98px) {
    .prods-layout { grid-template-columns: minmax(0, 1fr); }

    /* filtros viram gaveta lateral */
    .prods-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 1050;
        width: min(340px, 88vw);
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--h-surface);
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform .28s ease, visibility 0s linear .28s;
    }

    .prods-sidebar.open {
        transform: none;
        visibility: visible;
        transition: transform .28s ease;
        box-shadow: 20px 0 50px rgba(0,0,0,.18);
    }

    .sidebar-card { border: none; border-radius: 0; min-height: 100%; }
    .sidebar-head { position: sticky; top: 0; z-index: 1; background: var(--h-surface); }
    .sidebar-close { display: grid; place-items: center; }

    .pl-overlay {
        position: fixed; inset: 0; z-index: 1040;
        background: rgba(23,19,28,.45);
    }

    .btn-mobile-filter { display: inline-flex; }
}

@media (max-width: 767.98px) {
    .loja { --h-gap: .85rem; --h-radius: 16px; padding-bottom: 2.75rem; }

    .pl-hero { padding: 1.1rem 0 1.1rem; }
    .pl-crumbs { margin-bottom: .8rem; }
    .pl-chips {
        margin-top: 1rem;
        margin-right: calc(-1 * var(--bs-gutter-x, 1.5rem) * .5);
        padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    }

    .prods-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .prods-toolbar { margin-bottom: 1rem; }
    .filter-chips { order: 3; flex-basis: 100%; }
    .sort-wrap > span { display: none; }

    .pcard-body { padding: .8rem .85rem .9rem; }
    .pcard-title { font-size: .82rem; }
    .pcard-price-normal, .pcard-price-promo { font-size: 1rem; }
    .pcard-price { margin-bottom: .75rem; }
    .pcard-btn { font-size: .78rem; padding: .55rem .5rem; border-radius: 10px; }
    .pcard-btn i { display: none; }
    .pcard-fav { width: 32px; height: 32px; font-size: .85rem; }
}
