/*
 * ===================================================================
 * Required CSS for Custom Search Plugin
 * Extracted and adapted from main_680542df.css 113
 * ===================================================================
*/

/* --- Font Awesome Icon Base --- */
/* Your theme must load the Font Awesome font library for this to work. */
.fa {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

.fa-search:before {
    content: "\F002";
}


/* --- Desktop Search Form (Expanding Input) --- */

.custom-search-desktop {
    margin-left: auto;
    margin-right: 1rem;
    position: relative; /* Needed for the button positioning */
}

/* The search input field - starts small */
.custom-search-desktop .form-control {
    position: relative;
    height: 40px;
    font-size: 18px;
    outline: none !important;
    line-height: 1.5;
    box-shadow: none !important;
    display: block;
    width: 29px; /* Initial small width */
    border: 1px solid transparent;
    background: transparent;
    margin-left: auto;
    z-index: 999;
    color: #fff;
    padding: 3px 10px 3px 40px;
    transition: all 0.5s;
    cursor: pointer;
}

/* The search input field on focus - expands */
.custom-search-desktop .form-control:focus {
    width: 250px; /* Expanded width */
    z-index: 0;
    cursor: auto;
    border: 2px solid #fff;
    border-radius: 0;
}

/* The search icon/button for the desktop form */
.custom-search-desktop .btn {
    position: absolute;
    padding: 1px 9px;
    color: #fff !important;
    background: transparent;
    font-size: 24px;
    top: 0;
    left: 0;
    margin: 0 auto;
    border: none;
    cursor: pointer;
}


/* --- Mobile Search Toggle & Dropdown --- */

/* The mobile search icon trigger */
.mobile-search-icon-trigger {
    color: #fff;
    font-size: 24px;
    padding: 5px; /* Added for easier clicking */
    display: inline-block;
}

/* The dropdown container - hidden by default */
.custom-search-mobile-dropdown {
    display: none;
    position: absolute; /* Changed from fixed to work within Elementor header */
    width: 100%;
    right: 0;
    background: #10342f; /* Background from your theme */
    top: 100%; /* Position right below the header */
    padding: 15px;
    margin-right: 0;
    z-index: 1000;
}

/* The class toggled by JS to show the dropdown */
.custom-search-mobile-dropdown.is-visible {
    display: flex;
}

/* Ensure form elements inside the dropdown take full width */
.custom-search-mobile-dropdown .form-group {
    width: 100%;
    position: relative;
    margin: 0;
}

/* Input field inside the mobile dropdown */
.custom-search-mobile-dropdown .form-control {
    width: 100%;
    z-index: 0;
    background: transparent;
    cursor: auto;
    transition: all .5s;
    border: 2px solid #fff;
    border-radius: 0;
    height: 40px;
    font-size: 18px;
    color: #fff;
    fill:#fff;
    padding: 3px 10px 3px 40px;
}

/* Button inside the mobile dropdown */
.custom-search-mobile-dropdown .btn {
    position: absolute;
    padding: 1px 9px;
    color: #fff !important;
    background: transparent;
    font-size: 24px;
    top: 0;
    left: 0;
    margin: 0;
    border: none;
    height: 100%;
}


/* --- Responsive Display Rules --- */

/* Hide desktop form on screens smaller than 992px */
@media (max-width: 991.98px) {
    .custom-search-desktop {
        display: none !important;
    }
    /*
     * FIX 1: Keep the search icon white.
     * Some themes may override the default 'a' tag color, making it dark.
     * Using !important ensures this style takes priority.
    */
    .mobile-search-icon-trigger {
        color: #fff !important;
    }
    /*
     * FIX 2: Make the search dropdown full-width and prevent overflow.
     * This overrides the default positioning to break the form
     * out of its parent container and centers it on the screen.
     * Using position: fixed ensures it's relative to the viewport.
    */
    .custom-search-mobile-dropdown {
        position: fixed; /* Position relative to the viewport */
        top: 60px; /* Adjust this value to position it below your header */
        left: 50%; /* Position the left edge at the center of the screen */
        transform: translateX(-50%); /* Pull the element back by half its width to center it */
        width: 95%; /* Use percentage for better compatibility */
        max-width: 350px; /* Set a maximum width as requested */
        right: auto; /* Unset the right property to avoid conflicts */
        box-sizing: border-box; /* Ensures padding is included in the total width */
        border-radius: 4px; /* Optional: add some rounded corners */
    }
}

/* Hide mobile toggle on screens larger than 991.98px */
@media (min-width: 992px) {
    .custom-search-mobile-toggle {
        display: none !important;
    }
}

/* --- Fix for Expanded Search Appearance --- */

/* This targets both the focused desktop input and the mobile input */
.custom-search-desktop .form-control:focus,
.custom-search-mobile-dropdown .form-control {
    background: transparent !important; /* Forces the background to be transparent */
    color: #fff !important;             /* Ensures any text you type is white */
}

/* This styles the placeholder text (e.g., "Search...") for all modern browsers */
.custom-search-form .form-control::placeholder {
  color: #ccc; /* A light gray, similar to the image */
  opacity: 1; /* Ensures full visibility */
}

/* --- Disable Icon Hover Effect When Search is Active --- */

.custom-search-desktop .form-control:focus ~ .btn,
.custom-search-mobile-dropdown.is-visible .btn {
    transform: none !important;
    transition: none !important;
    font-size: 24px !important; /* Locks the font size to prevent zoom */
    color: #10342f;
    z-index: 200;
}



/* --- Final Fix: Disable ALL Icon Hover Effects When Search is Active --- */

.custom-search-desktop .form-control:focus ~ .btn,
.custom-search-mobile-dropdown.is-visible .btn {
    /* Lock size and disable scaling */
    transform: none !important;
    font-size: 24px !important;

    /* Lock position and spacing */
    padding: 1px 9px !important;
    margin: 0 !important;
    border: none !important;

    /* Lock color and disable shadows */
    background: transparent !important;
    color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;

    /* Disable all animations */
    transition: none !important;
}

/* --- Icon Color Change on Text Entry --- */
/* Changes the search icon to a dark color when the input field has text,
   making it visible against the browser's default white autofill background. */
.custom-search-form .form-control:not(:placeholder-shown) ~ .btn {
    color: #10342f !important; /* A dark color from the theme */
}
