/**
 * Nice Select Final Fix
 * Ultimate solution for icon positioning in nice-select
 */

/* Ensure field container is properly positioned */
.contact-from .xb-item--field:has(.nice-select),
.xb-contact .xb-item--field:has(.nice-select) {
    position: relative !important;
}

/* Icon must be on top with maximum z-index */
.contact-from .xb-item--field > span:first-child,
.xb-contact .xb-item--field > span:first-child {
    position: absolute !important;
    left: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Nice select must have lower z-index and proper padding */
.contact-from .xb-item--field .nice-select,
.xb-contact .xb-item--field .nice-select {
    position: relative !important;
    z-index: 1 !important;
    padding: 0 40px 0 50px !important;
    background-color: #fff !important;
}

/* Current text inside nice-select */
.contact-from .xb-item--field .nice-select .current,
.xb-contact .xb-item--field .nice-select .current {
    padding-left: 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Nice select when opened */
.contact-from .xb-item--field .nice-select.open,
.xb-contact .xb-item--field .nice-select.open {
    z-index: 999 !important;
}

/* Nice select dropdown list */
.contact-from .xb-item--field .nice-select .list,
.xb-contact .xb-item--field .nice-select .list {
    z-index: 1000 !important;
    background: #fff !important;
}

/* Placeholder style */
.contact-from .xb-item--field .nice-select .current[data-placeholder],
.xb-contact .xb-item--field .nice-select .current[data-placeholder] {
    color: #999 !important;
}

/* Override any inline styles with maximum specificity */
body .contact-from .xb-item--field .nice-select[style*="padding-left"] {
    padding-left: 50px !important;
}

body .xb-contact .xb-item--field .nice-select[style*="padding-left"] {
    padding-left: 50px !important;
}

/* Ensure icon images are visible */
.contact-from .xb-item--field > span:first-child img,
.xb-contact .xb-item--field > span:first-child img {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    opacity: 1 !important;
}

/* Media query for mobile */
@media (max-width: 768px) {
    .contact-from .xb-item--field .nice-select,
    .xb-contact .xb-item--field .nice-select {
        padding-left: 45px !important;
    }
    
    .contact-from .xb-item--field > span:first-child,
    .xb-contact .xb-item--field > span:first-child {
        left: 12px !important;
    }
}