/**
 * WC Lightning Search - Styles
 *
 * @package WC_Lightning_Search
 */

/* Dropdown Container */
.wcls-dropdown {
    position: absolute;
    z-index: 999999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* Results Container */
.wcls-results {
    padding: 4px 0;
}

/* Individual Result Item */
.wcls-item {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

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

.wcls-item:hover,
.wcls-item--active {
    background-color: #f7f9fc;
}

.wcls-item__link {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    text-decoration: none;
    color: inherit;
    gap: 12px;
}

.wcls-item__link:hover {
    text-decoration: none;
    color: inherit;
}

/* Product Image */
.wcls-item__image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}

.wcls-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Product Content */
.wcls-item__content {
    flex: 1;
    min-width: 0;
}

.wcls-item__title {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.wcls-item__title mark {
    background: #fff3cd;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.wcls-item__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
}

.wcls-item__sku {
    color: #666;
    font-family: monospace;
    font-size: 11px;
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 3px;
}

.wcls-item__price {
    font-weight: 600;
    color: #2d7d32;
}

.wcls-item__price del {
    color: #999;
    font-weight: normal;
    margin-right: 4px;
}

.wcls-item__price ins {
    text-decoration: none;
    color: #c62828;
    font-weight: 700;
}

.wcls-item__stock {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.wcls-stock--in {
    background: #e8f5e9;
    color: #2e7d32;
}

.wcls-stock--out {
    background: #fbe9e7;
    color: #c62828;
}

.wcls-item__categories {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No Results */
.wcls-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

.wcls-no-results p {
    margin: 0;
}

/* Loading State */
.wcls-loading {
    padding: 16px 20px;
    text-align: center;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wcls-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: wcls-spin 0.6s linear infinite;
}

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

/* View All Link */
.wcls-view-all {
    padding: 10px 14px;
    text-align: center;
    border-top: 1px solid #eee;
}

.wcls-view-all a {
    color: #0073aa;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}

.wcls-view-all a:hover {
    text-decoration: underline;
}

/* Footer */
.wcls-footer {
    padding: 6px 14px;
    font-size: 11px;
    color: #999;
    text-align: right;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wcls-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    }

    .wcls-item__link {
        padding: 12px 16px;
    }

    .wcls-item__image {
        width: 44px;
        height: 44px;
    }

    .wcls-item__title {
        font-size: 15px;
    }
}

/* Scrollbar Styling */
.wcls-dropdown::-webkit-scrollbar {
    width: 6px;
}

.wcls-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.wcls-dropdown::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.wcls-dropdown::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}
