/**
 * Smart Search frontend overrides.
 *
 * Fibo's CSS (ajax-search-for-woocommerce-premium/assets/css/style.css)
 * is left enqueued and styles all .dgwt-wcas-* classes our JS uses,
 * including .dgwt-wcas-sku and .dgwt-wcas-has-sku spacing. This file
 * only adds the few rules Fibo doesn't ship.
 *
 * Critical positioning for .zss-dropdown is set inline via JS (see
 * applyDropdownPosition) because WP Rocket RUCSS strips this stylesheet
 * from above-the-fold optimized pages — relying on CSS for the overlay
 * caused the dropdown to push the header taller instead of overlaying.
 */

.zss-dropdown {
    display: none;
}

@media (max-width: 768px) {
    .zss-dropdown .dgwt-wcas-st-title {
        font-size: 13px;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

.dgwt-wcas-suggestion-product .dgwt-wcas-stock {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    padding: 2px 6px;
    margin-left: 8px;
    border-radius: 2px;
    white-space: nowrap;
}
.dgwt-wcas-suggestion-product .dgwt-wcas-stock.in-stock {
    color: #0f834d;
    background: rgba(15, 131, 77, 0.08);
}
.dgwt-wcas-suggestion-product .dgwt-wcas-stock.out-of-stock {
    color: #e2401c;
    background: rgba(226, 64, 28, 0.08);
}

.dgwt-wcas-suggestion.dgwt-wcas-nores {
    padding: 16px 12px;
    color: #888;
    font-style: italic;
    text-align: center;
    cursor: default;
}

.zss-empty {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px;
}
.zss-empty .zss-empty-title {
    color: #444;
    font-style: normal;
}
.zss-empty .zss-empty-link {
    display: inline-block;
    margin-top: 4px;
    color: #2563eb;
    text-decoration: none;
    font-style: normal;
    font-size: 13px;
}
.zss-empty .zss-empty-link:hover {
    text-decoration: underline;
}

/* Spinner appears after 250ms if results haven't arrived */
.zss-spinner-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 12px;
    color: #888;
    font-size: 13px;
}
.zss-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: zss-spin 0.7s linear infinite;
}
@keyframes zss-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .zss-spinner { animation: none; opacity: 0.6; }
}
