/* ══════════════════════════════════════
   SEARCH DROPDOWN — nrg.ro 2026
   ══════════════════════════════════════ */

.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 420px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    display: none;
    overflow: hidden;
    max-height: 520px;
    overflow-y: auto;
}

.search-dropdown.active {
    display: block;
    animation: searchDropIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Section headers */
.search-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 14px 16px 6px;
}

/* Product result row */
.search-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
    text-decoration: none;
    color: inherit;
}

.search-product-item:hover,
.search-product-item.kb-active {
    background-color: #f1f5f9;
}

.search-product-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    padding: 3px;
}

.search-product-info {
    flex: 1;
    min-width: 0;
}

.search-product-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-product-name mark {
    background: transparent;
    color: #0ea5e9;
    font-weight: 700;
}

.search-product-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.search-product-price {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.search-product-stock {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}

.search-product-stock.in-stock {
    color: #10b981;
    background: #ecfdf5;
}

.search-product-stock.supplier {
    color: #f59e0b;
    background: #fffbeb;
}

.search-product-stock.out-of-stock {
    color: #ef4444;
    background: #fef2f2;
}

/* Category / Brand items */
.search-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
    text-decoration: none;
    color: inherit;
}

.search-link-item:hover,
.search-link-item.kb-active {
    background-color: #f1f5f9;
}

.search-link-name {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-link-name svg {
    color: #94a3b8;
    flex-shrink: 0;
}

.search-link-count {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

/* "See all results" footer */
.search-all-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 16px;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
    font-weight: 600;
    color: #0ea5e9;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.search-all-results:hover {
    background: #f8fafc;
    color: #0284c7;
}

/* Recent searches */
.search-recent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px 14px;
}

.search-recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    text-decoration: none;
}

.search-recent-chip:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.search-recent-chip svg {
    color: #94a3b8;
}

/* Loading state */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    color: #94a3b8;
    font-size: 14px;
    gap: 8px;
}

.search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* No results */
.search-no-results {
    padding: 24px 16px;
    text-align: center;
}

.search-no-results-text {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
}

.search-no-results-text strong {
    color: #1e293b;
}

/* Divider */
.search-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 4px 0;
}

/* Mobile search overlay */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.mobile-search-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-search-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: #ffffff;
    padding: 12px 16px;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-search-bar.active {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: mobileSearchSlideIn 0.2s ease-out;
}

@keyframes mobileSearchSlideIn {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.mobile-search-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 16px;
    outline: none;
    font-family: inherit;
    background: #f8fafc;
}

.mobile-search-input:focus {
    border-color: #0ea5e9;
    background: #fff;
}

.mobile-search-close {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    white-space: nowrap;
}

.mobile-search-dropdown {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 10001;
    overflow-y: auto;
    display: none;
}

.mobile-search-dropdown.active {
    display: block;
}

/* Desktop search container needs relative positioning */
.glass-search {
    position: relative;
}
