/* ===============================================
 * SEARCH BAR Z-INDEX AND POSITIONING FIX
 * ===============================================
 * Fixes:
 * 1. Z-index conflict - navbar was blocking search input
 * 2. Search bar positioning - moves closer to cart
 * 3. Search dropdown display - ensures proper layering
 * =============================================== */

/* Fix navbar z-index - reduce from 999 to 50 to allow search interaction */
.navbar {
    z-index: 50 !important;
}

/* Fix header z-index - keep it reasonable */
header,
.header {
    z-index: 60 !important;
}

/* Ensure search components are above navbar and header */
.desktop-search-wrapper {
    z-index: 1100 !important;
    position: relative !important;
}

.enhanced-search-form {
    z-index: 1100 !important;
    position: relative !important;
    pointer-events: auto !important;
}

.search-field {
    z-index: 1101 !important;
    position: relative !important;
    pointer-events: auto !important;
    cursor: text !important;
}

.search-submit-btn {
    z-index: 1102 !important;
    position: relative !important;
    pointer-events: auto !important;
}

/* Search suggestions dropdown - highest z-index */
.search-suggestions,
.search-dropdown,
.suggestions-dropdown,
[class*="suggestion"] {
    z-index: 1150 !important;
    position: absolute !important;
}

/* Fix search bar positioning - move closer to cart - FORCED */
@media (min-width: 992px) {
    .desktop-search-wrapper {
        margin-right: 0px !important;
        margin-left: auto !important;
        max-width: 320px !important;
    }

    /* FORCE search column to move right and reduce width */
    .search-col,
    .col.order-2.search-col {
        padding-right: 0px !important;
        padding-left: 0px !important;
        margin-right: 0px !important;
        margin-left: auto !important;
        max-width: 350px !important;
        flex: 0 0 auto !important;
    }

    /* Reduce gap between search and cart/icons - AGGRESSIVE */
    .icons-col,
    .col-auto.order-3.icons-col {
        padding-left: 0px !important;
        margin-left: -10px !important; /* Negative margin to pull closer */
    }

    /* Pull search form to the right edge */
    .enhanced-search-form {
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    /* NUCLEAR: Force header row to use flexbox properly */
    .header .row,
    header .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0px !important;
    }

    /* Ensure icons column stays at the end */
    .order-3 {
        margin-left: 0px !important;
    }
}/* Force input interactivity */
.search-field input,
input.search-field,
.enhanced-search-form input {
    pointer-events: auto !important;
    z-index: 1101 !important;
    position: relative !important;
    cursor: text !important;
}

/* Ensure dropdown is clickable and visible */
.search-suggestions *,
.search-dropdown *,
.suggestions-dropdown * {
    pointer-events: auto !important;
}

/* Mobile responsiveness */
@media (max-width: 991px) {
    .mobile-search-wrapper,
    .mobile-search-form {
        z-index: 1100 !important;
        position: relative !important;
    }

    .mobile-search-wrapper input,
    .mobile-search-form input {
        z-index: 1101 !important;
        pointer-events: auto !important;
    }
}
