.category-picker-source {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.category-picker {
    position: relative;
    width: 100%;
    margin-bottom: 18px;
}

.category-picker-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 8px;
    align-items: stretch;
}

.category-picker-button,
.category-picker-ai,
.category-picker-close {
    font: inherit;
}

.category-picker-button {
    width: 100%;
    min-height: 52px;
    padding: 9px 13px;
    border: 1.5px solid #d8e0eb;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.edit-product-form .category-picker-button,
.product-form .category-picker-button {
    width: 100%;
    min-height: 52px;
    padding: 9px 13px;
    margin-bottom: 0;
    border: 1.5px solid #d8e0eb;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    box-shadow: none;
    font-size: 16px;
}

.category-picker-button:hover,
.category-picker.is-open .category-picker-button {
    border-color: #0ea5e9;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .12);
}

.edit-product-form .category-picker .category-picker-button:hover,
.edit-product-form .category-picker.is-open .category-picker-button,
.product-form .category-picker .category-picker-button:hover,
.product-form .category-picker.is-open .category-picker-button {
    background: #ffffff;
    color: #111827;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .12);
}

.category-picker-current-icon,
.category-picker-option-icon,
.category-picker-group-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef7ff;
    color: #0f6fa8;
    flex: 0 0 auto;
    overflow: hidden;
}

.category-picker-current-icon img,
.category-picker-option-icon img,
.category-picker-group-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-picker-current-icon svg,
.category-picker-option-icon svg,
.category-picker-group-icon svg {
    width: 22px;
    height: 22px;
}

.category-picker-label {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-picker-label-main {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 650;
}

.category-picker-label-group {
    color: #64748b;
    font-size: 12px;
    line-height: 1.2;
}

.category-picker-placeholder {
    color: #64748b;
    font-weight: 550;
}

.category-picker-chevron {
    color: #64748b;
    transition: transform .18s ease;
}

.category-picker.is-open .category-picker-chevron {
    transform: rotate(180deg);
}

.category-picker-ai {
    min-width: 0;
    min-height: 52px;
    padding: 0 8px;
    border: 1.5px solid #fed7aa;
    border-radius: 10px;
    background: #fff7ed;
    color: #c2410c;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
    box-shadow: none;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.category-picker-ai i {
    font-size: 15px;
}

.category-picker-ai:hover,
.category-picker-ai:focus-visible {
    background: #ffedd5;
    border-color: #fb923c;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, .12);
    outline: none;
}

.edit-product-form .category-picker .category-picker-ai,
.product-form .category-picker .category-picker-ai {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
    box-shadow: none;
}

.edit-product-form .category-picker .category-picker-ai:hover,
.edit-product-form .category-picker .category-picker-ai:focus-visible,
.product-form .category-picker .category-picker-ai:hover,
.product-form .category-picker .category-picker-ai:focus-visible {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fb923c;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, .12);
}

.category-picker-ai:disabled {
    opacity: .68;
    cursor: wait;
}

.category-picker.is-ai-loading .category-picker-ai i {
    animation: category-picker-spin 1s linear infinite;
}

.category-picker-panel {
    position: absolute;
    z-index: 80;
    left: 0;
    top: calc(100% + 10px);
    width: min(820px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    padding: 14px;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
    display: none;
}

.category-picker.is-open .category-picker-panel {
    display: block;
}

.category-picker.is-align-right .category-picker-panel {
    left: auto;
    right: 0;
}

.category-picker-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.category-picker-panel-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-picker-panel-title span {
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
}

.category-picker-panel-title small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.25;
}

.category-picker-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.category-picker-close:hover {
    background: #e2e8f0;
}

.category-picker-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.category-picker-search {
    position: relative;
}

.category-picker-search > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
}

.category-picker-search input {
    width: 100% !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 10px 12px 10px 36px !important;
    border: 1px solid #dbe4ef !important;
    border-radius: 9px !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    font-size: 15px !important;
    box-shadow: none !important;
}

.category-picker-search.has-voice-search input.vm-voice-search-input {
    padding-right: 58px !important;
}

.category-picker-search .vm-voice-search-btn {
    position: absolute !important;
    right: 6px !important;
    top: 50% !important;
    z-index: 5 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #dbeafe !important;
    border-radius: 8px !important;
    background: #eff6ff !important;
    color: #3b82f6 !important;
    box-shadow: none !important;
    line-height: 1 !important;
    transform: translateY(-50%) !important;
}

.category-picker-search .vm-voice-search-btn i {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    color: inherit !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

.category-picker-search .vm-voice-search-btn:hover {
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
    color: #2563eb !important;
    box-shadow: none !important;
}

.category-picker-search .vm-voice-search-btn:active {
    transform: translateY(-50%) scale(.96) !important;
}

.category-picker-search .vm-voice-search-btn.is-listening {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
    color: #fff !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .14) !important;
}

.category-picker-search input:focus {
    border-color: #0ea5e9 !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, .12) !important;
    outline: none !important;
}

.category-picker-ai-status {
    min-width: 170px;
    max-width: 260px;
    min-height: 20px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.25;
    text-align: right;
}

.category-picker-ai-status.is-success {
    color: #15803d;
    font-weight: 650;
}

.category-picker-ai-status.is-error {
    color: #b91c1c;
    font-weight: 650;
}

.category-picker-ai-status.is-loading {
    color: #c2410c;
    font-weight: 650;
}

.category-picker-list {
    max-height: 430px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 1px;
}

.category-picker-group {
    min-width: 0;
    border: 1px solid #e5edf6;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.category-picker-group-head {
    min-height: 56px;
    padding: 10px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e5edf6;
}

.category-picker-group-name {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.category-picker-group-options {
    display: grid;
    gap: 1px;
    padding: 4px;
}

.category-picker-option {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    padding: 8px;
    text-align: left;
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 8px;
    box-shadow: none;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.category-picker-option:not(.has-no-icon) {
    grid-template-columns: 34px minmax(0, 1fr) 18px;
}

.edit-product-form .category-picker-option,
.product-form .category-picker-option {
    width: 100%;
    min-height: 42px;
    padding: 8px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    box-shadow: none;
    font-size: 14px;
}

.category-picker-list.is-searching .category-picker-option {
    min-height: 58px;
    border: 1px solid #e5edf6;
    border-radius: 10px;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    padding: 10px;
}

.category-picker-option.has-no-icon .category-picker-option-spacer {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #cbd5e1;
    justify-self: center;
}

.category-picker-list.is-searching .category-picker-option.has-no-icon .category-picker-option-spacer {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f1f5f9;
}

.category-picker-option:hover,
.category-picker-option:focus-visible {
    background: #f8fbff;
    box-shadow: none;
    outline: none;
}

.edit-product-form .category-picker-option:hover,
.product-form .category-picker-option:hover {
    background: #f8fbff;
    color: #111827;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
    transform: none;
}

.category-picker-option.is-selected {
    background: #fff7ed;
}

.category-picker-option-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.category-picker-option-name {
    color: #0f172a;
    font-weight: 750;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.category-picker-option-group {
    color: #64748b;
    font-size: 12px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-picker-option-check {
    color: #f97316;
    opacity: 0;
    justify-self: end;
}

.category-picker-option.is-selected .category-picker-option-check {
    opacity: 1;
}

.category-picker-empty {
    grid-column: 1 / -1;
    color: #64748b;
    padding: 28px 10px;
    text-align: center;
    font-size: 14px;
}

@keyframes category-picker-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
    .category-picker-panel {
        width: min(680px, calc(100vw - 24px));
    }

    .category-picker-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .category-picker-modal-open {
        overflow: hidden;
    }

    .category-picker-control {
        grid-template-columns: minmax(0, 1fr) 50px;
    }

    .category-picker-button,
    .category-picker-ai,
    .edit-product-form .category-picker-button,
    .product-form .category-picker-button {
        min-height: 48px;
    }

    .category-picker-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        top: 70px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 86px);
        padding: 12px;
        border-radius: 12px;
    }

    .category-picker.is-align-right .category-picker-panel {
        left: 10px;
        right: 10px;
    }

    .category-picker-tools {
        grid-template-columns: 1fr;
    }

    .category-picker-ai-status {
        min-width: 0;
        max-width: none;
        text-align: left;
    }

    .category-picker-list {
        max-height: calc(100vh - 220px);
        grid-template-columns: 1fr;
    }

    .category-picker-option,
    .edit-product-form .category-picker-option,
    .product-form .category-picker-option {
        min-height: 42px;
    }
}
