/**
 * Z-Index Hierarchy System
 * 
 * This file establishes a consistent z-index scale across the entire theme.
 * Updated to match realistic needs and BuddyBoss integration requirements.
 * 
 * Scale:
 * 1-99:         Base content
 * 100-999:      Elevated content (cards, product hovers)
 * 1000-1999:    Sticky elements and floating UI
 * 2000-4999:    Dropdowns and tooltips
 * 5000-8999:    BuddyBoss components (panels, notifications)
 * 9000-9999:    Modals and overlays
 * 10000-99999:  Critical UI (checkout, digital checks)
 * 100000+:      Emergency/system critical only
 */

:root {
    /* Base layers */
    --z-base: 1;
    --z-product-card: 10;
    --z-product-hover: 20;
    
    /* Elevated content */
    --z-elevated: 100;
    --z-sticky-header: 150;
    --z-loading-overlay: 200;
    
    /* Floating UI elements */
    --z-floating-cart: 1000;
    --z-floating-button: 1100;
    
    /* Interactive elements */
    --z-dropdown: 2000;
    --z-tooltip: 2500;
    --z-dropdown-content: 3000;
    
    /* BuddyBoss integration layer */
    --z-buddypanel: 5000;
    --z-bb-notifications: 5100;
    --z-bb-chat: 5200;
    --z-bb-tooltips: 5500;
    
    /* Modal system */
    --z-modal-overlay: 9000;
    --z-modal-content: 9100;
    --z-modal-close: 9200;
    --z-filter-modal: 9300;
    
    /* Notifications and alerts */
    --z-notification: 10000;
    --z-alert: 10100;
    --z-system-message: 10200;
    
    /* Critical overlays */
    --z-digital-check: 100000;
    --z-checkout-transition: 100100;
    --z-critical-overlay: 100200;
    
    /* Maximum (emergency use only) */
    --z-maximum: 999999;
}

/* Apply to common elements */
.dropdown-content {
    z-index: var(--z-dropdown-content);
}

.modal-overlay,
.cart-modal-overlay,
.product-modal-overlay,
.filter-modal-overlay {
    z-index: var(--z-modal-overlay);
}

.modal,
.cart-modal,
.product-modal {
    z-index: var(--z-modal-content);
}

.filter-modal {
    z-index: var(--z-filter-modal);
}

.modal-close,
.cart-modal-close,
.product-modal-close,
.filter-modal-close {
    z-index: var(--z-modal-close);
}

.floating-cart,
.floating-cart-button {
    z-index: var(--z-floating-cart);
}

.notification,
.alert,
.system-message {
    z-index: var(--z-notification);
}

/* Product card hover states */
.custom-product-item:hover,
.product-item:hover {
    z-index: var(--z-product-hover);
}

/* Sticky elements */
.sticky-header,
.sticky-filters {
    z-index: var(--z-sticky-header);
}

/* Loading overlays */
.loading-overlay,
.skeleton-loading {
    z-index: var(--z-loading-overlay);
}

/* Digital check and checkout overlays */
.digital-check-overlay {
    z-index: var(--z-digital-check);
}

.checkout-transition-overlay {
    z-index: var(--z-checkout-transition);
}