/* ========== GENERAL STYLING ========== */
/* Main container */
.wcps-search-container {
    position: relative;
    display: inline-block;
}

/* Magnifier button (before search expands) */
.wcps-search-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease-in-out;
}

/* Fix magnifier hover effect */
.wcps-search-toggle:hover {
    color: var(--ast-global-color-2) !important;
    background: none !important;
    box-shadow: none !important;
}

/* Search form (Desktop: initially hidden, Mobile: always visible) */
.wcps-search-form {
    background: white !important;
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.4s ease, opacity 0.4s ease;
}

/* Expanded Search Form on Desktop */
.wcps-search-container.active .wcps-search-form {
    width: 350px;
    opacity: 1;
}

/* Input field styling */
.wcps-search-form input {
    background: white !important;
    width: 100%;
    padding: 8px 40px 8px 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease;
}

/* Highlight input when focused */
.wcps-search-form input:focus {
    background: white;
    border-color: #0073aa;
}

/* Magnifier inside input */
.wcps-search-submit {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #333;
    transition: color 0.3s ease-in-out;
}

/* Change only magnifier icon color on hover */
.wcps-search-submit:hover {
    color: var(--ast-global-color-1) !important;
    background: none !important;
}

/* ========== MOBILE STYLING: SEARCH ALWAYS OPEN ========== */
@media screen and (max-width: 768px) {
    /* Always show search form on mobile */
    .wcps-search-container {
        position: relative;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .wcps-search-form {
        position: relative;
        width: 100% !important;
        opacity: 1 !important;
        overflow: visible;
        display: flex;
        align-items: center;
        justify-content: center;
        background: white !important;
        padding: 5px 10px;
        border-radius: 5px;
        box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
    }

    .wcps-search-form input {
        width: 100%;
        font-size: 1rem;
        padding: 10px 50px 10px 15px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background: white;
    }

    /* Magnifier inside the input field */
    .wcps-search-submit {
        position: absolute;
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
        background: none;
        border: none;
        cursor: pointer;
        font-size: 1.2rem;
        color: #333;
    }

    /* Hide magnifier button (since search is always visible) */
    .wcps-search-toggle {
        display: none !important;
    }
}
