/**
 * Farmacia Ajax Search - Estilos
 * Replica el diseño del buscador de PrestaShop
 */

/* ---- Contenedor principal ---- */
.fas-wrapper {
    position: relative;
    width: 100%;
    font-family: inherit;
    z-index: 9999;
}

/* ---- Caja de input ---- */
.fas-input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid #d0dce8;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.fas-input-wrap:focus-within {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.fas-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    padding: 10px 14px;
    font-size: 15px;
    color: #333;
    background: transparent;
    box-shadow: none !important;
    line-height: 1.4;
}

.fas-input::placeholder {
    color: #999;
}

.fas-btn-search {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 8px 14px;
    cursor: pointer;
    color: #555;
    transition: color 0.2s;
    flex-shrink: 0;
}

.fas-btn-search:hover {
    color: #4a90d9;
}

/* ---- Dropdown de resultados ---- */
.fas-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d9e3ec;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 99999;
    overflow: hidden;
}

/* Lista scrollable */
.fas-list {
    max-height: 420px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #c5d5e5 transparent;
}

.fas-list::-webkit-scrollbar {
    width: 5px;
}

.fas-list::-webkit-scrollbar-thumb {
    background: #c5d5e5;
    border-radius: 3px;
}

/* ---- Cada ítem de resultado ---- */
.fas-item {
    border-bottom: 1px solid #eef2f7;
}

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

.fas-item-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.15s;
}

.fas-item-link:hover {
    background: #f4f8fd;
}

/* Imagen */
.fas-item-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 3px;
}

/* Texto */
.fas-item-info {
    flex: 1;
    min-width: 0;
}

.fas-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
    /* Truncar a 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.fas-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #7ab648; /* verde PrestaShop */
    line-height: 1;
}

.fas-item-price ins {
    text-decoration: none;
}

.fas-item-price del {
    color: #aaa;
    font-weight: 400;
    font-size: 12px;
    margin-right: 4px;
}

/* ---- Estado: buscando / sin resultados ---- */
.fas-state {
    padding: 14px 16px;
    font-size: 13px;
    color: #777;
    text-align: center;
}

/* ---- Botón "Mostrar todos los resultados" ---- */
.fas-show-all {
    display: block;
    width: 100%;
    padding: 11px 16px;
    background: #f4f8fd;
    border: none;
    border-top: 1px solid #d9e3ec;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #4a90d9;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
}

.fas-show-all:hover {
    background: #4a90d9;
    color: #fff;
}
