.cmd-palette-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cmd-palette-backdrop.cmd-palette-visible {
    opacity: 1;
}

@property --cmd-gradient-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.cmd-palette-panel {
    position: fixed;
    top: 15vh;
    left: 50%;
    transform: translateX(-50%) translateY(-12px);
    width: 640px;
    max-width: calc(100vw - 2rem);
    max-height: 70vh;
    border: 4px solid transparent;
    border-radius: 12px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        conic-gradient(from var(--cmd-gradient-angle), #DAE343, #00AEEC, #DAE343) border-box;
    box-shadow: 0 16px 70px rgba(0, 0, 0, 0.35);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    animation: cmdGradientRotate 3s linear infinite;
}

@keyframes cmdGradientRotate {
    to { --cmd-gradient-angle: 360deg; }
}

.cmd-palette-panel.cmd-palette-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cmd-palette-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.cmd-palette-search-icon {
    flex-shrink: 0;
    color: #9ca3af;
}

.cmd-palette-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    color: #111827;
    background: transparent;
    line-height: 1.5;
}

.cmd-palette-input::placeholder {
    color: #9ca3af;
}

.cmd-palette-search-btn {
    display: none;
}

.cmd-palette-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.cmd-palette-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: #6b7280;
    border-radius: 50%;
    animation: cmdPaletteSpin 0.6s linear infinite;
}

@keyframes cmdPaletteSpin {
    to { transform: rotate(360deg); }
}

.cmd-palette-results {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cmd-palette-result {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.1s ease;
    cursor: pointer;
}

.cmd-palette-result:hover,
.cmd-palette-result.cmd-palette-result-active {
    background-color: #f9fafb;
}

.cmd-palette-result:last-child {
    border-bottom: none;
}

.cmd-palette-result-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 6px;
    background: #f9fafb;
    flex-shrink: 0;
}

.cmd-palette-result-info {
    flex: 1;
    min-width: 0;
}

.cmd-palette-result-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-palette-result-brand {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

.cmd-palette-result-meta {
    text-align: right;
    flex-shrink: 0;
}

.cmd-palette-result-price {
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
}

.cmd-palette-result-price-original {
    font-weight: 400;
    font-size: 0.8rem;
    color: #9ca3af;
    text-decoration: line-through;
    margin-left: 0.375rem;
}

.cmd-palette-result-price-sale {
    color: #dc2626;
}

.cmd-palette-result-stock {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.cmd-palette-result-stock-in {
    color: #16a34a;
}

.cmd-palette-result-stock-out {
    color: #9ca3af;
}

.cmd-palette-empty,
.cmd-palette-error {
    padding: 2rem 1.25rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.cmd-palette-error {
    color: #dc2626;
}

.cmd-palette-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.625rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 0.75rem;
    color: #9ca3af;
    border-radius: 0 0 10px 10px;
}

.cmd-palette-footer-logo {
    height: 20px;
    width: auto;
    transition: opacity 0.2s ease;
}

.cmd-palette-footer-logo:hover {
    opacity: 1;
}

.cmd-palette-footer-hints {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.cmd-palette-footer kbd {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.7rem;
    line-height: 1.4;
    box-shadow: 0 1px 0 #d1d5db;
}

@media (max-width: 680px) {
    .cmd-palette-panel {
        top: 1rem;
        width: auto;
        left: 1rem;
        right: 1rem;
        transform: translateY(-12px);
        max-width: none;
    }

    .cmd-palette-panel.cmd-palette-visible {
        transform: translateY(0);
    }
}
