/* ===================================================
   Live Search Modern Styles
   =================================================== */

.header-search-wrapper {
    position: relative;
}

.live-search-spinner {
    display: none;
    color: #64748b;
    font-size: 14px;
}

/* Dropdown Container */
.live-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    width: 100%;
    min-width: 320px;
    max-height: 480px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15), 0 3px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    overflow-y: auto;
    z-index: 99999999;
    text-align: left;
    display: none;
    animation: liveSearchFadeIn 0.18s ease-out;
}

@keyframes liveSearchFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
.live-search-dropdown::-webkit-scrollbar {
    width: 6px;
}
.live-search-dropdown::-webkit-scrollbar-track {
    background: #f8fafc;
}
.live-search-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.live-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Loading State */
.live-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px 16px;
    color: #64748b;
    font-size: 14px;
    background: #ffffff;
}

.live-search-spinner-icon {
    width: 22px;
    height: 22px;
    border: 2.5px solid #e2e8f0;
    border-top-color: var(--primary_color, #275dff);
    border-radius: 50%;
    animation: liveSearchSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes liveSearchSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Header count */
.live-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

/* Products List */
.live-search-items-list {
    padding: 4px 0;
}

.live-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none !important;
    transition: background 0.15s ease, transform 0.15s ease;
    color: inherit !important;
}

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

.live-search-item:hover {
    background: #f8fafc;
    text-decoration: none !important;
}

.live-search-thumb {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #edf2f7;
}

.live-search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.live-search-details {
    flex: 1;
    min-width: 0;
}

.live-search-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
}

.live-search-item:hover .live-search-title {
    color: var(--primary_color, #275dff);
}

.live-search-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11.5px;
    color: #64748b;
    margin-bottom: 3px;
}

.live-search-meta span i {
    font-size: 10px;
    margin-right: 3px;
    opacity: 0.8;
}

.live-search-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.live-search-current-price {
    font-weight: 700;
    color: var(--primary_color, #275dff);
}

.live-search-old-price {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: line-through;
}

.live-search-discount-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 4px;
}

.live-search-arrow {
    color: #cbd5e1;
    font-size: 12px;
    transition: transform 0.15s ease, color 0.15s ease;
    padding-left: 4px;
    flex-shrink: 0;
}

.live-search-item:hover .live-search-arrow {
    color: var(--primary_color, #275dff);
    transform: translateX(3px);
}

/* Empty State ("na pele na bolbe") */
.live-search-empty {
    padding: 32px 20px;
    text-align: center;
    background: #ffffff;
}

.live-search-empty .empty-icon {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.live-search-empty .empty-title {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.live-search-empty .empty-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    word-break: break-word;
}

.live-search-empty .empty-tip {
    font-size: 12px;
    color: #94a3b8;
}

/* Footer / View All */
.live-search-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.live-search-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary_color, #275dff) !important;
    text-decoration: none !important;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.live-search-view-all:hover {
    text-decoration: underline !important;
}

/* Mobile Responsiveness for all headers */
@media (max-width: 767px) {
    .header-search-wrapper,
    .search-box {
        width: 100% !important;
        flex-basis: 100% !important;
        margin-top: 8px !important;
        margin-bottom: 5px !important;
        order: 10;
        display: block !important;
    }

    .header-search-form,
    .search-box form {
        display: flex !important;
        width: 100% !important;
    }

    .top-header .containe {
        flex-wrap: wrap !important;
    }

    .other-search {
        display: none !important;
    }

    .live-search-dropdown {
        min-width: 100%;
        max-height: 380px;
    }
}

/* Cart Button Loading State */
.btn-product-info.is-loading,
.redirect.is-loading,
button.is-loading {
    cursor: wait !important;
    opacity: 0.8 !important;
    pointer-events: none !important;
}

.btn-product-info.is-loading i,
.redirect.is-loading i,
button.is-loading i {
    display: inline-block;
    animation: liveSearchSpin 0.7s linear infinite;
}
