/**
 * AfifaSurgical Live Search Stylesheet
 * Hover Expandable Search Icon + AJAX Dropdown
 */

/* HIDE OLD CLUNKY THEME SEARCH INPUTS THAT STACKED UNDER CART */
html body header .header-search:not(.afifa-header-search-slot),
html body header .search-form:not(.afifa-live-search-form),
html body header form.header-search-form {
    display: none !important;
}

/* Slot container in header */
.afifa-header-search-slot {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 10px !important;
    position: relative !important;
    z-index: 99999 !important;
}

/* Expandable Container */
.afifa-search-bar-expandable {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.afifa-search-inner {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    padding: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Hover or Active State: Expands width */
.afifa-search-bar-expandable:hover .afifa-search-inner,
.afifa-search-bar-expandable.is-active .afifa-search-inner {
    border-color: #de7a33;
    box-shadow: 0 4px 14px rgba(222, 122, 51, 0.20);
}

/* Search Icon Button */
.afifa-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f8fafc;
    border: none;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.afifa-search-bar-expandable:hover .afifa-search-btn,
.afifa-search-bar-expandable.is-active .afifa-search-btn {
    background: #de7a33;
    color: #ffffff;
}

.afifa-search-svg {
    stroke: currentColor;
    transition: stroke 0.2s ease;
}

/* Input field: HIDDEN BY DEFAULT, EXPANDS ON HOVER OR FOCUS */
.afifa-search-input {
    width: 0 !important;
    opacity: 0 !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
    outline: none !important;
    pointer-events: none !important;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.35s ease !important;
}

/* Expanded state on hover or when active */
.afifa-search-bar-expandable:hover .afifa-search-input,
.afifa-search-bar-expandable.is-active .afifa-search-input,
.afifa-search-input:focus {
    width: 240px !important;
    opacity: 1 !important;
    padding: 0 12px 0 14px !important;
    pointer-events: auto !important;
}

/* AJAX Results Dropdown */
.afifa-search-results-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 350px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100000;
}

.afifa-search-results-dropdown.has-results {
    display: flex;
}

/* Results List */
.afifa-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.afifa-search-item:last-child {
    border-bottom: none;
}

.afifa-search-item:hover {
    background: #fff7ed;
}

.afifa-search-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.afifa-search-info {
    flex-grow: 1;
    overflow: hidden;
}

.afifa-search-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.afifa-search-price {
    font-size: 12.5px;
    font-weight: 700;
    color: #de7a33;
    display: block;
}

.afifa-search-price del {
    color: #94a3b8;
    font-weight: 400;
    margin-right: 4px;
    font-size: 11px;
}

.afifa-search-price ins {
    text-decoration: none;
}

/* View All Footer */
.afifa-search-view-all {
    display: block;
    text-align: center;
    padding: 10px;
    background: #f8fafc;
    color: #de7a33;
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    border-top: 1px solid #e2e8f0;
    transition: background 0.15s ease;
}

.afifa-search-view-all:hover {
    background: #f1f5f9;
}

/* Loading Spinner */
.afifa-search-loading {
    padding: 18px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

.afifa-search-empty {
    padding: 18px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}
