/* ═══════════════════════════════════════════════════════════
   📦 PRODUTOS-PASTA.CSS — mesmo tom dark/vinho do histórico
   Overlay de Meus Produtos dentro da Pasta do frame.
   ═══════════════════════════════════════════════════════════ */

/* 🌑 OVERLAY FULLSCREEN */
.pp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483647 !important;
    background: rgba(0, 0, 0, .78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    animation: ppFadeIn .2s ease;
    isolation: isolate;
}
.pp-overlay.active { display: flex !important; }

@keyframes ppFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* 🗂️ CARD CENTRAL */
.pp-card {
    background: linear-gradient(145deg, #1a1a1a 0%, #111 100%);
    border: 1px solid #2e2e2e;
    border-radius: 18px;
    padding: 22px 20px;
    width: 600px;
    max-width: 94vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .04);
    animation: ppCardIn .25s ease;
    position: relative;
    z-index: 2147483647 !important;
}
@keyframes ppCardIn {
    from { transform: scale(.92) translateY(12px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* HEADER */
.pp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a2a2a;
}
.pp-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ededed;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pp-title .pp-icon { font-size: 1.3rem; }
.pp-count-badge {
    font-size: .7rem;
    font-weight: 700;
    color: #cfcfe0;
    background: rgba(255, 255, 255, .06);
    padding: 3px 9px;
    border-radius: 8px;
}
.pp-frame-tag {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #ff7a8a;
    background: rgba(209, 0, 36, .2);
    padding: 3px 10px;
    border-radius: 8px;
}
.pp-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color .2s;
}
.pp-close:hover { color: #d10024; }

/* 🔍 BARRA DE BUSCA */
.pp-search-wrap {
    position: relative;
    margin-bottom: 12px;
}
.pp-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 38px 11px 38px;
    background: linear-gradient(135deg, #1c1c1c 0%, #141414 100%);
    border: 1px solid #2e2e2e;
    border-radius: 12px;
    color: #ededed;
    font-size: .92rem;
    font-weight: 500;
    transition: all .2s ease;
}
.pp-search-input::placeholder { color: #666; }
.pp-search-input:focus {
    outline: none;
    border-color: #d10024;
    box-shadow: 0 0 0 3px rgba(209, 0, 36, .15);
}
.pp-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .95rem;
    opacity: .6;
    pointer-events: none;
}
.pp-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    display: none;
    transition: color .2s;
}
.pp-search-clear.visible { display: block; }
.pp-search-clear:hover { color: #d10024; }

/* 🏷️ FILTROS */
.pp-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    transition: opacity .2s ease;
}
.pp-filters.disabled {
    opacity: .35;
    pointer-events: none;
}
.pp-filter-select {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    background: linear-gradient(135deg, #1c1c1c 0%, #141414 100%);
    border: 1px solid #2e2e2e;
    border-radius: 10px;
    color: #d0d0d0;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    color-scheme: dark;      /* 🌙 lista nativa ESCURA (sem o branco/azul do SO) */
    accent-color: #d10024;
}
/* a lista que abre segue a roupa do painel, igual ao resto dos selects da casa */
.pp-filter-select option { background: #141414; color: #d0d0d0; }
.pp-filter-select option:checked { background: #d10024; color: #fff; }
.pp-filter-select:hover { border-color: #5e0010; }
.pp-filter-select:focus {
    outline: none;
    border-color: #d10024;
}

/* ═══════════════════════════════════════════════════════════
   🧱 TRILHO DE PRATELEIRAS — produto · textura · acessório
   Pré-filtro acima dos selects. Pílula, não select, de propósito:
   são 3 fixos e o estado tem que ficar VISÍVEL sem abrir nada.
   ═══════════════════════════════════════════════════════════ */
.pp-trilho {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.pp-tp {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: linear-gradient(135deg, #1c1c1c 0%, #141414 100%);
    border: 1px solid #2e2e2e;
    border-radius: 999px;
    color: #d0d0d0;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}
.pp-tp:hover { border-color: #5e0010; color: #fff; }
.pp-tp.on {
    background: linear-gradient(135deg, #d10024 0%, #8e0018 100%);
    border-color: #d10024;
    color: #fff;
}
/* o número do acervo — discreto, some no estado ligado pra não competir */
.pp-tp-n {
    font-size: .72rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #9a9a9a;
}
.pp-tp.on .pp-tp-n { background: rgba(0,0,0,.25); color: #fff; }
/* prateleira ainda sem nada: apagada, mas CLICÁVEL — é assim que ele descobre
   que falta marcar. Nunca disabled mudo. */
.pp-tp.vazia { opacity: .45; }
.pp-tp.vazia:hover { opacity: .8; }

/* 🖼️ GRID DE PRODUTOS */
.pp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    overflow-y: auto;
    padding: 4px;
    flex: 1;
    min-height: 140px;
    transition: opacity .2s ease;
}
.pp-grid::-webkit-scrollbar { width: 8px; }
.pp-grid::-webkit-scrollbar-track { background: #111; border-radius: 8px; }
.pp-grid::-webkit-scrollbar-thumb { background: #5e0010; border-radius: 8px; }
.pp-grid::-webkit-scrollbar-thumb:hover { background: #d10024; }

/* 🖼️ ITEM */
.pp-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #2a2a2a;
    cursor: pointer;
    background: #0d0d0d;
    aspect-ratio: 1 / 1;
    transition: all .2s ease;
}
.pp-item:hover {
    border-color: #d10024;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(209, 0, 36, .35);
}
.pp-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pp-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .9));
    color: #eaeaea;
    padding: 16px 6px 6px;
}
.pp-item-name {
    font-size: .68rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pp-item-tags {
    display: flex;
    gap: 3px;
    justify-content: center;
    margin-top: 3px;
    flex-wrap: wrap;
}
.pp-item-tag {
    font-size: .55rem;
    font-weight: 600;
    color: #ff9aa8;
    background: rgba(209, 0, 36, .25);
    padding: 1px 5px;
    border-radius: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

/* ESTADOS */
.pp-loading, .pp-empty, .pp-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    font-weight: 600;
}
.pp-loading { color: #40e0ff; }
.pp-empty   { color: rgba(255, 255, 255, .5); }
.pp-error   { color: #ff4444; }
.pp-empty small, .pp-error small {
    display: block;
    margin-top: 6px;
    opacity: .7;
    font-weight: 500;
}

/* 📱 TELA "ATIVE SEU CATÁLOGO" (precisa número) */
.pp-precisa-numero {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 44px 24px;
    gap: 16px;
}
.pp-precisa-numero .pp-pn-emoji { font-size: 50px; line-height: 1; }
.pp-precisa-numero h3 {
    margin: 0;
    font-size: 17px;
    color: #e8e8f0;
    font-weight: 700;
}
.pp-precisa-numero p {
    margin: 0;
    color: #cfcfe0;
    font-size: 13.5px;
    line-height: 1.6;
    max-width: 300px;
}
.pp-precisa-numero a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 30px;
    border-radius: 12px;
    background: #25d366;
    color: #fff;
    font-weight: 700;
    font-size: 14.5px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(37, 211, 102, .4);
    transition: transform .15s ease;
}
.pp-precisa-numero a:hover { transform: translateY(-2px); }

/* 📄 PAGINAÇÃO */
.pp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #2a2a2a;
}
.pp-page-btn {
    background: linear-gradient(135deg, #1c1c1c 0%, #141414 100%);
    border: 1px solid #5e0010;
    color: #d8d8d8;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
}
.pp-page-btn:hover {
    border-color: #d10024;
    background: linear-gradient(135deg, #2a0a10 0%, #1a0608 100%);
    color: #fff;
}
.pp-page-info {
    font-size: .82rem;
    font-weight: 600;
    color: #b0b0b0;
}

/* 🍞 TOAST */
.pp-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    color: #fff;
    padding: 14px 24px;
    border-radius: 10px;
    border: 1px solid rgba(209, 0, 36, .5);
    font-size: 14px;
    font-weight: 600;
    z-index: 2147483647;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .5);
    animation: ppToastIn .3s ease;
}
@keyframes ppToastIn {
    from { transform: translateX(400px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes ppToastOut {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(400px); opacity: 0; }
}

/* 📱 MOBILE */
@media (max-width: 600px) {
    .pp-card { width: 96vw; padding: 18px 14px; }
    .pp-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .pp-filters { flex-direction: column; }
    .pp-filter-select { min-width: 100%; }
}
@media (max-width: 380px) {
    .pp-grid { grid-template-columns: repeat(2, 1fr); }
}
