/* =======================================================
   Premium Explore Categories - Robust Version 1.2
   (FINAL FIX: Overlay removed & Z-Index set to MAX to fix overlap)
   ======================================================= */

/* 0. Body Lock & Overlay (for Mobile) */
body.pec-body-lock {
    overflow: hidden !important; 
}

/* .pec-overlay code has been removed. */


/* 1. Wrapper (Container) */
.pec-wrapper {
    position: relative;
    display: inline-block;
    font-family: "Inter", system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* FIX: Set Z-index to an extremely high value to ensure it stacks above all fixed elements. */
    z-index: 999999 !important; 
}

/* 2. Main Button (.pec-trigger) */
.pec-wrapper .pec-trigger {
    /* Ensure the button itself is on top for absolute certainty. */
    z-index: 999999 !important; 
    
    background: #ffffff;
    color: #333333;
    border: 1px solid #e4e5e7;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px; 
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: none;
}

/* 3. Button Hover/Focus */
.pec-wrapper .pec-trigger:hover {
    background: #f0f0f0;
    color: #111111;
}
.pec-wrapper .pec-trigger:focus,
.pec-wrapper .pec-trigger:active:focus {
   background: #e9f5ff; /* Light Blue BG */
    border-color: #0087ff; /* Blue Border */
    color: #0087ff;
}

/* 4. Dropdown Panel - HIGHER SPECIFICITY & IMPORTANT RULES */
.pec-wrapper .pec-panel {
    position: absolute !important;
    top: 50px;
    left: 0;
    min-width: 260px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e4e5e7;
    padding: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-6px) scale(0.98) !important;
    transition: all 180ms ease-in-out !important;
    z-index: 99999 !important; 
}

.pec-wrapper .pec-panel.open {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

/* 5. Dropdown Options */
.pec-wrapper .pec-cats {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 260px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pec-wrapper .pec-cats li {
    padding: 8px 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s ease;
}
.pec-wrapper .pec-cats li:hover {
    background: #f5f5f5;
}
.pec-wrapper .pec-cats li.selected {
    background: #f0f0f0;
    font-weight: 600;
}

/* 6. Action Buttons Container */
.pec-wrapper .pec-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* 7. Common Button Styles */
.pec-wrapper .pec-actions button {
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 50%;
    flex-shrink: 0;
}

/* 8. Apply Button (Green) */
.pec-wrapper .pec-apply {
    background: #1dbf73;
    color: #fff;
}
.pec-wrapper .pec-apply:hover {
    background: #14a05b;
}

/* 9. Clear Button (Transparent/Grey) */
.pec-wrapper .pec-clear {
    background: transparent;
    color: #777;
}
.pec-wrapper .pec-clear:hover {
    background: #f0f0f0;
    color: #111111;
}

/* 10. Mobile Responsive Design (Bottom Sheet) */
@media (max-width: 768px) {
    .pec-wrapper .pec-panel {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        min-width: 100% !important;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(100%) !important;
        transition: transform 300ms ease-in-out, opacity 300ms ease-in-out !important;
    }

    .pec-wrapper .pec-panel.open {
        transform: translateY(0) !important;
    }
}