/* Autoss Fast Search — styled to match autoss.in header */

.afs-wrap {
    width: 100%;
    max-width: 1100px; /* was 760px — was capping the bar well below the available header width on desktop */
    flex: 1 1 auto;
    font-family: 'Roboto', Arial, sans-serif;
    position: relative;
}

.afs-form {
    display: flex;
    align-items: stretch;
    width: 100%;
    border-radius: 3px;
    overflow: visible;
}

/* ===== Category dropdown ===== */
.afs-cat-select-wrap {
    position: relative;
    flex-shrink: 0;
}

.afs-cat-toggle {
    height: 100%;
    min-height: 46px; /* was 40px */
    background: #f0f0f0;
    border: none;
    border-right: 1px solid #ddd;
    border-radius: 3px 0 0 3px;
    padding: 0 16px;
    font-size: 14px; /* was 13px */
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.afs-cat-toggle:hover { background: #e6e6e6; }
.afs-cat-toggle svg { transition: transform .15s ease; flex-shrink: 0; }
.afs-cat-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.afs-cat-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    min-width: 240px;
    max-height: 360px;
    overflow-y: auto;
    z-index: 200;
}
.afs-cat-item {
    padding: 9px 16px;
    font-size: 13px;
    color: #16233a;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.afs-cat-item:hover, .afs-cat-item--active { background: #f4f4f4; color: #E05C09; }
.afs-cat-item .afs-cat-count { color: #999; font-size: 11px; }
.afs-cat-loading { padding: 12px 16px; font-size: 12px; color: #999; }

/* ===== Search input ===== */
.afs-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.afs-input {
    width: 100%;
    height: 100%;
    min-height: 46px; /* was 40px */
    border: none;
    outline: none;
    padding: 0 40px 0 16px; /* was 0 40px 0 38px — no more icon to clear on the left */
    font-size: 15px; /* was 14px */
    color: #16233a;
    background: #fff;
    box-sizing: border-box;
}

.afs-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px;
}
.afs-clear:hover { color: #333; }

/* ===== Submit button ===== */
.afs-submit {
    flex-shrink: 0;
    background: #FFB100;
    color: #0E2238;
    border: none;
    border-radius: 0 3px 3px 0;
    padding: 0 30px; /* was 26px */
    font-weight: 800;
    font-size: 14px; /* was 13px */
    letter-spacing: .5px;
    cursor: pointer;
    transition: background .15s ease;
}
.afs-submit:hover { background: #e6a000; }

/* ===== Live results dropdown ===== */
.afs-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 14px 40px rgba(0,0,0,.2);
    z-index: 150;
    overflow: hidden;
}

.afs-results-inner {
    max-height: 420px;
    overflow-y: auto;
}

.afs-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f2f2f2;
}
.afs-result-item:hover { background: #fafafa; }
.afs-result-item:last-child { border-bottom: none; }

.afs-result-thumb {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}

.afs-result-info { min-width: 0; flex: 1; }
.afs-result-title {
    font-size: 13px;
    font-weight: 600;
    color: #16233a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.afs-result-price {
    font-size: 12px;
    color: #E05C09;
    font-weight: 700;
}
.afs-result-price del { color: #999; font-weight: 400; margin-right: 5px; }

.afs-result-outofstock {
    font-size: 10px;
    text-transform: uppercase;
    color: #c0392b;
    font-weight: 700;
    margin-left: 6px;
}

.afs-results-empty, .afs-results-loading {
    padding: 22px 16px;
    text-align: center;
    font-size: 13px;
    color: #888;
}

.afs-results-footer {
    border-top: 1px solid #eee;
    padding: 10px 14px;
    text-align: center;
}
.afs-view-all {
    background: none;
    border: none;
    color: #E05C09;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 10px;
}
.afs-view-all:hover { text-decoration: underline; }

/* ===== Mobile ===== */
@media (max-width: 768px) {
    /* Full-bleed: breaks the bar out of whatever side padding its
       Elementor column/section has, so it spans edge-to-edge like the
       banner below it, regardless of that padding's value. */
    .afs-wrap {
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }
    .afs-form { flex-wrap: nowrap; border-radius: 0; } /* square corners at the screen edge, matches full-bleed look */

    /* Bigger touch targets — thumbs need more room than mouse clicks */
    .afs-cat-toggle { min-height: 56px; padding: 0 12px; font-size: 14px; border-radius: 0; } /* was 44px/12px */
    .afs-cat-toggle span { max-width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .afs-cat-toggle svg { display: none; } /* saves space on very small screens */

    .afs-input { min-height: 56px; font-size: 16px; padding: 0 40px 0 16px; } /* was 44px/16px, then 17px */
    .afs-input::placeholder { font-size: 14px; }

    .afs-clear { right: 8px; font-size: 24px; }

    .afs-submit { min-height: 56px; padding: 0 20px; font-size: 14px; flex-shrink: 0; border-radius: 0; } /* was 44px/12px */

    /* Results dropdown: use available width, keep it usable on small screens */
    .afs-results { left: -1px; right: -1px; max-width: none; }
    .afs-result-thumb { width: 40px; height: 40px; }
    .afs-result-title { font-size: 12.5px; }
    .afs-cat-list { min-width: 200px; max-width: 90vw; }
}

@media (max-width: 480px) {
    .afs-input::placeholder { font-size: 13px; }
    .afs-cat-toggle span { max-width: 36px; }
    .afs-submit { padding: 0 14px; font-size: 13px; }
}
