/**
 * Tenbit AJAX Product Search Popup Styles
 * Author: Team Tenbit (https://tenbitsol.com)
 * Version: 1.0.0
 */

.tenbit-search-trigger-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* -------------------------------------------------------------
   TRIGGER BUTTONS (HEADER TRIGGER)
------------------------------------------------------------- */
.tenbit-search-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
    outline: none;
}

.tenbit-search-trigger-btn:hover {
    color: #ff5500;
}

.tenbit-search-trigger-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.tenbit-search-trigger-btn:hover svg {
    transform: scale(1.1);
}

/* Pill Bar Variant */
.tenbit-search-trigger-btn.is-pill {
    background: #14171c;
    border: 1px solid #282f3a;
    border-radius: 30px;
    padding: 8px 18px;
    color: #8e97a5;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tenbit-search-trigger-btn.is-pill:hover {
    border-color: #ff5500;
    color: #ffffff;
    background: #181c22;
}

/* -------------------------------------------------------------
   POPUP MODAL OVERLAY
------------------------------------------------------------- */
.tenbit-search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: rgba(8, 10, 13, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.tenbit-search-modal-overlay *,
.tenbit-search-modal-overlay *::before,
.tenbit-search-modal-overlay *::after {
    box-sizing: border-box;
}

.tenbit-search-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Content Container */
.tenbit-search-modal-container {
    position: relative;
    width: 100%;
    max-width: 860px;
    margin-top: 40px;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tenbit-search-modal-overlay.is-open .tenbit-search-modal-container {
    transform: translateY(0);
}

/* Modal Top Bar (Kicker & Close Button) */
.tenbit-search-modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.tenbit-search-modal-kicker {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 11px;
    font-weight: 700;
    color: #ff5500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tenbit-search-modal-close-btn {
    background: transparent;
    border: 1px solid #282f3a;
    border-radius: 4px;
    color: #8e97a5;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.tenbit-search-modal-close-btn:hover {
    color: #ffffff;
    border-color: #ff5500;
    background: rgba(255, 85, 0, 0.1);
}

/* -------------------------------------------------------------
   SEARCH INPUT BOX
------------------------------------------------------------- */
.tenbit-search-input-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
}

.tenbit-search-input-prefix {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff5500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.tenbit-search-input-prefix svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.tenbit-search-input-field {
    width: 100%;
    background: #111419;
    border: 2px solid #282f3a;
    border-radius: 6px;
    padding: 18px 54px 18px 56px;
    font-size: 18px;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    letter-spacing: 0.5px;
}

.tenbit-search-input-field::placeholder {
    color: #64748b;
    font-size: 16px;
    font-weight: 500;
}

.tenbit-search-input-field:focus {
    border-color: #ff5500;
    box-shadow: 0 0 0 3px rgba(255, 85, 0, 0.15);
}

.tenbit-search-clear-btn {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #8e97a5;
    font-size: 18px;
    cursor: pointer;
    display: none;
    padding: 6px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.tenbit-search-clear-btn:hover {
    color: #ffffff;
}

/* Animated Scanning Progress Bar */
.tenbit-search-scan-bar {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    height: 2px;
    overflow: hidden;
    display: none;
    border-radius: 0 0 4px 4px;
}

.tenbit-search-scan-bar::after {
    content: '';
    display: block;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #ff5500, #ff7733, transparent);
    animation: tenbitScan 1s infinite linear;
}

@keyframes tenbitScan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* -------------------------------------------------------------
   POPULAR / TRENDING TAGS (EMPTY STATE)
------------------------------------------------------------- */
.tenbit-search-trending-wrap {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
    padding: 14px 18px;
    background: #111419;
    border: 1px solid #1f252e;
    border-radius: 6px;
}

.tenbit-trending-label {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #8e97a5;
    text-transform: uppercase;
}

.tenbit-trending-chip {
    background: #191e26;
    color: #cbd5e1;
    border: 1px solid #28303d;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.tenbit-trending-chip:hover {
    background: #232a35;
    color: #ff5500;
    border-color: #ff5500;
}

/* -------------------------------------------------------------
   LIVE RESULTS LIST & CARDS
------------------------------------------------------------- */
.tenbit-search-results-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding-right: 6px;
}

/* Custom Scrollbar for Results */
.tenbit-search-results-container::-webkit-scrollbar {
    width: 5px;
}

.tenbit-search-results-container::-webkit-scrollbar-track {
    background: #111419;
}

.tenbit-search-results-container::-webkit-scrollbar-thumb {
    background: #28303d;
    border-radius: 3px;
}

.tenbit-search-result-item {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #111419;
    border: 1px solid #1f252e;
    border-radius: 6px;
    padding: 14px 18px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.tenbit-search-result-item:hover {
    background: #161a22;
    border-color: #333d4b;
    transform: translateX(4px);
}

.tenbit-result-thumb-wrap {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    background: #090b0e;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #222934;
}

.tenbit-result-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.tenbit-search-result-item:hover .tenbit-result-thumb {
    transform: scale(1.08);
}

.tenbit-result-info {
    flex: 1;
    min-width: 0;
}

.tenbit-result-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.tenbit-result-category {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 10.5px;
    font-weight: 800;
    color: #ff5500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tenbit-result-sku {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 10.5px;
    color: #64748b;
    letter-spacing: 0.5px;
}

.tenbit-result-title {
    font-family: "Barlow Condensed", "Oswald", sans-serif;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.tenbit-search-result-item:hover .tenbit-result-title {
    color: #ff7733;
}

.tenbit-result-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 700;
}

.tenbit-result-price {
    color: #ffffff;
}

.tenbit-result-sale-price {
    color: #ff5500;
    font-weight: 800;
}

.tenbit-result-regular-price {
    color: #64748b;
    text-decoration: line-through;
    font-size: 13px;
}

.tenbit-result-arrow-wrap {
    color: #8e97a5;
    font-size: 18px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tenbit-search-result-item:hover .tenbit-result-arrow-wrap {
    color: #ff5500;
    transform: translateX(3px);
}

/* View All Results Button */
.tenbit-search-view-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 14px 20px;
    background: transparent;
    border: 1px solid #ff5500;
    color: #ff5500;
    border-radius: 4px;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.25s ease;
}

.tenbit-search-view-all-btn:hover {
    background: #ff5500;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(255, 85, 0, 0.35);
}

/* Empty State */
.tenbit-search-empty-state {
    padding: 48px 24px;
    text-align: center;
    background: #111419;
    border: 1px solid #1f252e;
    border-radius: 6px;
    color: #8e97a5;
}

.tenbit-empty-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
    color: #64748b;
}

.tenbit-empty-title {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 6px 0;
}

.tenbit-empty-desc {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
}

/* -------------------------------------------------------------
   RESPONSIVE DESIGN (MOBILE)
------------------------------------------------------------- */
@media (max-width: 640px) {
    .tenbit-search-modal-overlay {
        padding: 20px 14px;
    }

    .tenbit-search-modal-container {
        margin-top: 10px;
    }

    .tenbit-search-input-field {
        font-size: 15px;
        padding: 14px 44px 14px 48px;
    }

    .tenbit-search-input-field::placeholder {
        font-size: 14px;
    }

    .tenbit-search-result-item {
        gap: 12px;
        padding: 12px;
    }

    .tenbit-result-thumb-wrap {
        width: 52px;
        height: 52px;
    }

    .tenbit-result-title {
        font-size: 16px;
    }
}
