/* ==================== LAYOUT CHUNG ==================== */
.pla-page-wrap { max-width: 100%; padding: 40px 20px; background: #0E0C18 !important; }

.pla-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.pla-badge { display: inline-block; background: rgba(139,92,246,0.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.3); padding: 5px 14px; border-radius: 20px; font-size: 12px; margin-bottom: 14px; }
.pla-title { font-size: 32px; font-weight: 800; color: #fff; margin: 0 0 10px; }
.pla-title em { color: #a78bfa; font-style: italic; }
.pla-subtitle { color: #a89fb0; font-size: 15px; max-width: 600px; margin: 0; }
.pla-total-badge { display: flex; align-items: center; gap: 8px; color: #d8d0e0; font-size: 14px; white-space: nowrap; }

/* ==================== SEARCH + SORT ROW ==================== */
.pla-search-sort-row { display: flex; gap: 12px; margin-bottom: 16px; align-items: stretch;}

/* ---- Search Box: chiều cao cố định, không để input tự phình to ---- */
.pla-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1a0d24 !important;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 0 16px !important;
    height: 50px !important;
    box-sizing: border-box;
}
.pla-search-box svg { flex-shrink: 0; color: #6f6878; }

.pla-search-box input[type="text"] {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    line-height: normal !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
}
.pla-search-box input::placeholder { color: #6f6878; }

.pla-sort-inline {
    display: flex !important;
    gap: 4px;
    background: #1a0d24;
    border-radius: 8px;
    padding: 5px;              /* đây chính là khoảng đệm quanh nút active */
    box-sizing: border-box;
    align-items: center;
    height: auto;               /* bỏ height cứng, để nội dung tự quyết định */
}

.pla-sort-btn {
    background: transparent !important;
    border: none !important;
    color: #8b8494 !important;
    border-radius: 10px !important;   /* bo góc nhỏ hơn khung cha 1 chút để thấy rõ 2 lớp */
    font-weight: 500 !important;
    font-size: 14px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: all 0.15s ease;
    line-height: 1.2;
    margin: 0 !important;
}

.pla-sort-btn--active {
    background: #8b5cf6 !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 5px !important;
}

/* ---- Nút "Lọc" dạng dropdown — MẶC ĐỊNH ẨN trên Desktop ---- */
.pla-filter-dropdown-wrap {
    display: none !important;
    position: relative;
}
.pla-filter-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1a0d24 !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #fff !important;
    padding: 12px 18px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-transform: none !important;
    cursor: pointer;
    height: 50px;
    box-sizing: border-box;
}
.pla-filter-dropdown {
    display: none !important;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1a0d24;
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 12px;
    padding: 14px;
    min-width: 180px;
    flex-direction: column;
    gap: 8px;
    z-index: 20;
}
.pla-filter-dropdown--open {
    display: flex !important;
}
.pla-filter-dropdown-label { color: #a89fb0; font-size: 12px; margin: 0 0 4px; }
.pla-filter-dropdown .pla-sort-btn { width: 100%; text-align: left; }

/* ==================== MODEL CHIPS ==================== */
.pla-model-tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 16px;
    scrollbar-width: none;
}
.pla-model-tabs::-webkit-scrollbar { display: none; }

.pla-model-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1a0d24 !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    color: #d8d0e0 !important;
    padding: 0 10px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none !important;
    transition: all 0.15s ease;
}
.pla-model-chip--active {
    background: #8b5cf6 !important;
    border-color: #8b5cf6 !important;
    color: #fff !important;
    font-weight: 600 !important;
}

/* ==================== RESULT COUNT + GRID ==================== */
.pla-result-count { color: #a78bfa; font-size: 14px; font-weight: 600; margin: 0 0 16px; }

.pla-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    min-height: 200px;
    transition: opacity 0.2s;
}
.pla-grid--loading { opacity: 0.4; }
.pla-empty { color: #a89fb0; grid-column: 1 / -1; text-align: center; padding: 40px 0; }

.pla-card { background: #16081e; border: 1px solid rgba(139,92,246,0.15); border-radius: 14px; overflow: hidden; }
.pla-image-wrap { position: relative; aspect-ratio: 1/1; }
.pla-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pla-image-count {
    position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.65);
    color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 8px;
}
.pla-info { padding: 14px 16px; }
.pla-card-title { font-size: 15px; font-weight: 700; color: #fff; margin: 0 0 8px; }
.pla-preview { font-size: 12px; color: #8b8494; line-height: 1.5; margin: 0; }

/* ==================== RESPONSIVE ==================== */

/* Tablet: 3 cột, chuyển sort sang nút Lọc */
@media (max-width: 900px) {
    .pla-grid { grid-template-columns: repeat(3, 1fr); }

    .pla-sort-inline {
        display: none !important;
    }
    .pla-filter-dropdown-wrap {
        display: block !important;
    }
}

/* Mobile: 2 cột */
@media (max-width: 600px) {
    .pla-header { flex-direction: column; }
    .pla-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}