/*
 * Weblix Business Listings — frontend search bar (pill style).
 *
 * Brand accent color: #da4038 (used for the reset button).
 * Change the --weblix-bl-accent variable below to re-theme.
 */

.weblix-bl-search {
    --weblix-bl-accent: #da4038;
    --weblix-bl-accent-hover: #b92f28;
    --weblix-bl-bg: #ffffff;
    --weblix-bl-text: #1f2937;
    --weblix-bl-muted: #9ca3af;
    --weblix-bl-divider: #e5e7eb;
    --weblix-bl-radius: 999px;

    direction: rtl;
    text-align: right;
    font-family: 'Assistant', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    color: var(--weblix-bl-text);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.weblix-bl-search *,
.weblix-bl-search *::before,
.weblix-bl-search *::after {
    box-sizing: border-box;
}

/* --- The pill --------------------------------------------------------- */

.weblix-bl-search__form {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    height: 64px;
    background: var(--weblix-bl-bg);
    border-radius: var(--weblix-bl-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

/* --- Fields ----------------------------------------------------------- */

.weblix-bl-search__field {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
    border-inline-start: 1px solid var(--weblix-bl-divider);
}

/* First field (free-text search, on the right in RTL) has no divider. */
.weblix-bl-search__field--text {
    border-inline-start: 0;
    flex: 1.4 1 0;
}

/* Screen-reader-only labels — visible to assistive tech, not to sighted users. */
.weblix-bl-search__label--sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Free text input -------------------------------------------------- */

.weblix-bl-search__input {
    font-family: 'Assistant', sans-serif;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    height: 100%;
    padding: 0 28px;
    border: 0;
    background: transparent;
    color: var(--weblix-bl-text);
    text-align: right;
    direction: rtl;
    outline: none;
}

.weblix-bl-search__input::placeholder {
    color: var(--weblix-bl-muted);
    font-weight: 500;
}

/* --- Selects ---------------------------------------------------------- */

.weblix-bl-search__select {
    font-family: 'Assistant', sans-serif;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    height: 100%;
    padding: 0 24px 0 38px; /* room for chevron on the left (RTL trailing side) */
    border: 0;
    background-color: transparent;
    color: var(--weblix-bl-text);
    text-align: right;
    direction: rtl;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* Chevron icon rendered as inline SVG, positioned on the left. */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%231f2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: left 20px center;
    background-size: 12px 8px;
}

.weblix-bl-search__select:focus,
.weblix-bl-search__input:focus {
    background-color: rgba(218, 64, 56, 0.04);
}

.weblix-bl-search__select option {
    color: var(--weblix-bl-text);
    background: #ffffff;
    font-weight: 500;
}

/* --- Reset button (far left in RTL) ----------------------------------- */

.weblix-bl-search__reset {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 150px;
    padding: 0 28px;
    font-family: 'Assistant', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: var(--weblix-bl-accent);
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.weblix-bl-search__reset:hover,
.weblix-bl-search__reset:focus {
    background: var(--weblix-bl-accent-hover);
    color: #ffffff;
    text-decoration: none;
}

/* --- Hidden submit (keeps Enter-key submission working) --------------- */

.weblix-bl-search__submit-hidden {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* --- Responsive ------------------------------------------------------- */

@media (max-width: 900px) {
    .weblix-bl-search__form {
        flex-direction: column;
        height: auto;
        border-radius: 20px;
    }

    .weblix-bl-search__field {
        flex: 1 1 auto;
        width: 100%;
        height: 56px;
        border-inline-start: 0;
        border-bottom: 1px solid var(--weblix-bl-divider);
    }

    .weblix-bl-search__reset {
        width: 100%;
        min-width: 0;
        height: 56px;
    }
}
