/* *
 * WooCommerce Custom Search - Estilos del dropdown de sugerencias
 */

/* ─── Dropdown Container ──────────────────────────────────── */
.wcs-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.wcs-suggestions-dropdown::-webkit-scrollbar {
    width: 6px;
}

.wcs-suggestions-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ─── Suggestion Item ─────────────────────────────────────── */
.wcs-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none !important;
    color: #333 !important;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.wcs-suggestion-item:last-of-type {
    border-bottom: none;
}

.wcs-suggestion-item:hover,
.wcs-suggestion-item.active {
    background-color: #f7f7f7;
}

/* ─── Imagen ──────────────────────────────────────────────── */
.wcs-suggestion-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcs-suggestion-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── Info ─────────────────────────────────────────────────── */
.wcs-suggestion-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0; /* Para que el truncate funcione */
    flex: 1;
}

.wcs-suggestion-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wcs-suggestion-name mark {
    background-color: #fff3cd;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.wcs-suggestion-price {
    font-size: 14px;
    font-weight: 700;
    color: #2d7d32;
}

.wcs-suggestion-sku {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ─── Ver todos los resultados ────────────────────────────── */
.wcs-view-all {
    display: block;
    padding: 12px 14px;
    text-align: center;
    font-size: 13px;
    color: #0066cc !important;
    text-decoration: none !important;
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
    border-radius: 0 0 8px 8px;
    transition: background-color 0.15s ease;
}

.wcs-view-all:hover {
    background: #f0f0f0;
    color: #004499 !important;
}

.wcs-view-all strong {
    font-weight: 600;
}

/* ─── Loading State ───────────────────────────────────────── */
.wcs-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    font-size: 13px;
    color: #888;
}

.wcs-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #666;
    border-radius: 50%;
    animation: wcs-spin 0.6s linear infinite;
}

@keyframes wcs-spin {
    to { transform: rotate(360deg); }
}

/* ─── No Results ──────────────────────────────────────────── */
.wcs-no-results {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #999;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .wcs-suggestions-dropdown {
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        bottom: 0;
        max-height: 60vh;
        border-radius: 12px 12px 0 0;
        border: 1px solid #e0e0e0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    }

    .wcs-suggestion-item {
        padding: 12px 16px;
    }

    .wcs-suggestion-image {
        width: 44px;
        height: 44px;
    }
}
