/**
 * Header live product search dropdown
 */

.dt-product-search {
    position: relative;
    width: 100%;
}

.dt-product-search__panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 1060;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    max-height: min(70vh, 420px);
    display: flex;
    flex-direction: column;
}

.dt-product-search__panel[hidden] {
    display: none !important;
}

.dt-product-search__state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 16px;
    color: #64748b;
    font-size: 14px;
}

.dt-product-search__state[hidden] {
    display: none !important;
}

.dt-product-search__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--main-color-one, #2563eb);
    border-radius: 50%;
    animation: dt-search-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes dt-search-spin {
    to {
        transform: rotate(360deg);
    }
}

.dt-product-search__list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
    flex: 1 1 auto;
}

.dt-product-search__list:empty {
    display: none;
}

.dt-product-search__item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #1e293b;
    transition: background 0.15s ease;
}

.dt-product-search__item a:hover,
.dt-product-search__item.is-active a {
    background: #f8fafc;
}

.dt-product-search__thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
}

.dt-product-search__meta {
    min-width: 0;
    flex: 1;
}

.dt-product-search__title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dt-product-search__price {
    display: block;
    font-size: 13px;
    color: var(--main-color-one, #2563eb);
    font-weight: 600;
}

.dt-product-search__price.is-out {
    color: #94a3b8;
}

.dt-product-search__all {
    display: block;
    text-align: center;
    padding: 12px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    color: var(--main-color-one, #2563eb);
    text-decoration: none;
}

.dt-product-search__all:hover {
    background: #f8fafc;
}

.dt-product-search__all[hidden] {
    display: none !important;
}

/* Desktop: dropdown must stack above sticky mega-menu bar (z-index 1030) */
@media (min-width: 992px) {
    .header.dt-header-search-open {
        z-index: 1100;
    }

    .header .dt-product-search--live {
        position: relative;
        z-index: 2;
    }

    .header .dt-product-search__panel {
        z-index: 1101;
    }
}

.header-search-pos .dt-product-search__panel,
.offcanvas-body .dt-product-search__panel {
    min-width: 280px;
}

@media (max-width: 991.98px) {
    .offcanvas-body .dt-product-search__panel {
        position: static;
        margin-top: 8px;
        max-height: 50vh;
        box-shadow: none;
        border-radius: 10px;
    }
}
