:root {
    --psb-primary: #F5B800; /* Requested Gold border color */
    --psb-dark: #000000;
    --psb-border: #F5B800;
    --psb-text: #ffffff;
    --psb-text-dim: #ffffff; /* Placeholder white as requested */
    --psb-bg: #000000; /* Full black background */
    --psb-radius: 8px; /* Slightly sharper corners for smaller look */
    --psb-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.psb-outer-wrapper {
    width: 100% !important;
    background: #000000 !important;
    display: flex !important;
    justify-content: center !important;
    padding: 20px 0 !important; /* Increased for more vertical space */
    /* Box shadow expansion trick for full width regardless of parent */
    box-shadow: 0 0 0 100vmax #000000 !important;
    clip-path: inset(0 -100vmax) !important;
    position: relative !important;
    z-index: 1 !important; /* Set to priority 1 to stay behind menus */
}

.psb-search-container {
    width: 100%;
    max-width: 300px;
    margin: 0;
    background: #000000;
    position: relative;
    z-index: 2;
}

.psb-search-wrapper {
    position: relative;
    width: 100%;
    z-index: 100001;
}

.psb-input-group {
    display: flex;
    align-items: center;
    background: var(--psb-bg);
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    padding: 6px 14px;
    transition: all 0.2s ease-in-out;
}

/* White background and black text on focus */
.psb-input-group:focus-within {
    background: #ffffff;
    border-color: var(--psb-primary);
    box-shadow: 0 0 15px rgba(245, 184, 0, 0.3);
}

.psb-input-group:focus-within #psb-search-input {
    color: #000000;
}

.psb-input-group:focus-within .psb-search-icon {
    color: #000000;
}

.psb-search-icon {
    color: var(--psb-primary);
    margin-right: 10px;
    display: flex;
    align-items: center;
}

.psb-search-icon svg {
    width: 16px;
    height: 16px;
}

#psb-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--psb-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    width: 100%;
}

#psb-search-input::placeholder {
    color: var(--psb-text-dim);
    opacity: 0.8;
}

#psb-search-input:focus::placeholder {
    color: #666666;
}

/* Spinner */
.psb-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--psb-primary);
    border-radius: 50%;
    animation: psb-spin 0.8s linear infinite;
    margin-left: 8px;
}

@keyframes psb-spin {
    to { transform: rotate(360deg); }
}

/* Results Dropdown */
.psb-results-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #000000; /* Full black results */
    border: 1px solid var(--psb-border);
    border-radius: var(--psb-radius);
    overflow: hidden;
    z-index: 100002 !important; /* Extremely high z-index */
    box-shadow: var(--psb-shadow);
    display: none;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s ease;
}

.psb-results-dropdown.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.psb-result-item {
    display: flex;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(245, 184, 0, 0.2);
    text-decoration: none;
    transition: background 0.2s ease;
    align-items: center;
}

.psb-result-item:last-child {
    border-bottom: none;
}

.psb-result-item:hover {
    background: #111111;
}

.psb-result-image {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    margin-right: 10px;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
}

.psb-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.psb-result-info {
    flex: 1;
}

.psb-result-title {
    display: block;
    color: #ffffff;
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.psb-result-price {
    display: block;
    color: var(--psb-primary);
    font-size: 11px;
    font-weight: 500;
}

.psb-result-tax {
    font-size: 9px;
    color: #888888;
}

.psb-cat {
    background: rgba(245, 184, 0, 0.1);
    color: var(--psb-primary);
    padding: 1px 4px;
    border-radius: 2px;
    margin-right: 2px;
}

.psb-no-results {
    padding: 15px;
    text-align: center;
    color: #888888;
    font-size: 12px;
    font-style: italic;
}

/* Responsive Logic */
@media (max-width: 768px) {
    .psb-outer-wrapper {
        padding: 15px 0 !important; /* Increased for more vertical space */
    }

    .psb-search-container {
        max-width: 75%; /* Narrower width */
    }
    
    .psb-input-group {
        padding: 4px 12px; /* Thinner bar (less vertical height) */
    }

    #psb-search-input {
        font-size: 14px; /* Slightly smaller font to match thin look */
    }

    .psb-search-icon svg {
        width: 14px; /* Smaller icon */
        height: 14px;
    }
}

@media (max-width: 480px) {
    .psb-search-container {
        max-width: 80%; /* Slightly more space on very small screens */
    }
}
