/* Bootflow Product Importer - Admin Styles */

/* General Layout */
.bfpi-wrap {
    background: #fff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-x: hidden;
}

.bfpi-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    align-items: flex-start;
    overflow: hidden;
}

.bfpi-sidebar {
    flex: 0 0 420px;
    min-width: 0;
    position: sticky;
    top: 32px;
    max-height: none;
    overflow: visible;
}

.bfpi-sidebar .bfpi-card {
    margin-bottom: 0;
    height: auto;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.bfpi-sidebar .bfpi-card > * {
    overflow: visible;
}

.bfpi-sidebar #file-structure-browser {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: visible;
}

.bfpi-main {
    flex: 1;
    min-width: 0;
}

.bfpi-card {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.bfpi-card h2,
.bfpi-card h3 {
    margin-top: 0;
    color: #333;
}

/* Progress Indicator */
.bfpi-progress-indicator {
    margin: 20px 0;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 6px;
}

.bfpi-steps {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.bfpi-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #ddd;
    z-index: 1;
}

.bfpi-steps .step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.bfpi-steps .step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    font-weight: bold;
    margin-bottom: 5px;
}

.bfpi-steps .step.active .step-number {
    background: #0073aa;
    color: white;
}

.bfpi-steps .step.completed .step-number {
    background: #46b450;
    color: white;
}

.bfpi-steps .step-name {
    display: block;
    font-size: 12px;
    color: #666;
}

.bfpi-steps .step.active .step-name,
.bfpi-steps .step.completed .step-name {
    color: #333;
    font-weight: bold;
}

/* Step 1 - Upload */
.upload-method-selection {
    display: flex;
    gap: 15px;
    margin: 15px 0;
}

.upload-method-option {
    flex: 1;
    padding: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-method-option:hover {
    border-color: #0073aa;
}

.upload-method-option input[type="radio"] {
    display: none;
}

.upload-method-option input[type="radio"]:checked + .method-icon ~ * {
    color: #0073aa;
}

.upload-method-option input[type="radio"]:checked {
    border-color: #0073aa;
}

.method-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 10px;
}

.method-title {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.method-desc {
    display: block;
    font-size: 12px;
    color: #666;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.file-upload-area.dragover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.upload-dropzone {
    padding: 40px 20px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #666;
}

.upload-primary {
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

.upload-secondary {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.upload-requirements {
    margin-top: 15px;
    font-size: 12px;
    color: #666;
}

.file-preview {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-name {
    font-weight: bold;
    color: #333;
}

.file-size {
    color: #666;
    font-size: 12px;
}

.remove-file {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

/* Advanced Options */
.toggle-advanced {
    cursor: pointer;
    margin: 20px 0 10px;
    color: #0073aa;
}

.toggle-advanced:hover {
    color: #005a87;
}

.advanced-options {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    background: #f9f9f9;
}

.advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.advanced-item label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

/* Step 2 - Field Mapping */
.mapping-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f7f7f7;
    border-radius: 6px;
}

.field-mapping-sections {
    border: 1px solid #ddd;
    border-radius: 6px;
}

.mapping-section {
    border-bottom: 1px solid #ddd;
}

.mapping-section:last-child {
    border-bottom: none;
}

.section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin: 0;
    background: #f7f7f7;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: bold;
}

.section-toggle:hover {
    background: #f0f0f0;
}

.mapped-count {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.section-fields {
    display: none;
    padding: 0;
}

.section-fields.active {
    display: block;
}

.field-mapping-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr;
    gap: 15px;
    align-items: start;
    padding: 15px 60px 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: white;
    position: relative;
}

.field-mapping-row:last-child {
    border-bottom: none;
}

.field-target {
    display: flex;
    flex-direction: column;
}

.field-label {
    font-weight: bold;
    margin-bottom: 5px;
}

.field-label.required {
    color: #d63638;
}

.required-asterisk {
    color: #d63638;
    margin-left: 3px;
}

.field-type {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.field-source-select,
.processing-mode-select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Textarea Mapping Fields - New UI */
.textarea-mapping-wrapper {
    position: relative;
    width: 100%;
}

.field-mapping-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #e2e4e7;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    background: #fff;
}

.field-mapping-textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
    outline: none;
}

.field-mapping-textarea-small {
    min-height: 36px;
    max-height: 80px;
}

.field-mapping-textarea-large {
    min-height: 80px;
    max-height: 200px;
}

/* Drag over state */
.field-mapping-textarea.drag-over {
    border-color: #0073aa;
    background: #f0f7ff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.25);
}

/* Textarea with content */
.field-mapping-textarea.has-content {
    background: #f8fff8;
    border-color: #46b450;
}

/* Live preview badge */
.textarea-mapping-wrapper .live-preview {
    margin-top: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    display: none;
}

.textarea-mapping-wrapper .live-preview.visible {
    display: block;
}

.textarea-mapping-wrapper .live-preview .preview-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 2px;
    display: block;
}

.textarea-mapping-wrapper .live-preview .preview-value {
    color: #0073aa;
    font-weight: 500;
    word-break: break-word;
}

.textarea-mapping-wrapper .live-preview .preview-error {
    color: #dc3232;
    font-style: italic;
}

/* Validation warning */
.textarea-mapping-wrapper .validation-warning {
    margin-top: 4px;
    padding: 4px 8px;
    background: #fff8e5;
    border: 1px solid #ffb900;
    border-radius: 4px;
    font-size: 11px;
    color: #826200;
    display: none;
}

.textarea-mapping-wrapper .validation-warning.visible {
    display: flex;
    align-items: center;
    gap: 5px;
}

.textarea-mapping-wrapper .validation-warning .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Autocomplete dropdown */
.field-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
}

.field-autocomplete-dropdown.visible {
    display: block;
}

.field-autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.field-autocomplete-item:last-child {
    border-bottom: none;
}

.field-autocomplete-item:hover,
.field-autocomplete-item.selected {
    background: #f0f7ff;
}

.field-autocomplete-item .field-name {
    font-weight: 500;
    color: #1e1e1e;
}

.field-autocomplete-item .field-type-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: #f0f0f0;
    border-radius: 3px;
    color: #666;
    text-transform: uppercase;
}

.field-autocomplete-item .field-sample {
    margin-left: auto;
    font-size: 11px;
    color: #999;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Draggable fields in sidebar */
.draggable-field {
    transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
    border-radius: 4px;
    margin: 1px 0;
    -webkit-user-select: none;
    user-select: none;
}

/* Expandable containers should not be draggable */
.expandable-content {
    -webkit-user-select: none;
    user-select: none;
}

.draggable-field:hover {
    background: #f0f7ff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.draggable-field.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    background: #e8f4fc;
}

.draggable-field:active {
    cursor: grabbing;
}

/* Shipping rule sortable placeholder */
.shipping-rule-sortable-placeholder {
    border: 2px dashed #0073aa;
    background: #f0f6fc;
    min-height: 60px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Nested draggable fields - inside expandable sections */
.nested-draggable {
    margin: 2px 0 !important;
}

.nested-draggable:hover {
    background: #e8f4fc !important;
}

/* Drag hint in sidebar */
.drag-hint {
    padding: 8px 12px;
    background: linear-gradient(135deg, #e8f4fc 0%, #f0f7ff 100%);
    border: 1px dashed #0073aa;
    border-radius: 6px;
    font-size: 11px;
    color: #0073aa;
    text-align: center;
    margin-bottom: 10px;
}

.processing-config {
    grid-column: 1 / -1;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
    display: none; /* Hidden by default, shown when mode != 'direct' */
}

.processing-config.hidden {
    display: none !important;
}

.config-panel {
    margin-bottom: 15px;
    display: none; /* Hidden by default, shown by JS based on mode */
}

.config-panel:last-child {
    margin-bottom: 0;
}

.config-panel label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.config-panel textarea,
.config-panel input {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.ai-provider-selection {
    margin-bottom: 10px;
}

.ai-provider-selection select {
    width: 200px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Update on Sync Checkbox */
.update-on-sync-wrapper {
    grid-column: 1 / -1;
    margin: 10px 0;
    padding: 10px 15px;
    background: #f9f9f9;
    border-left: 3px solid #2271b1;
    border-radius: 3px;
}

.update-on-sync-wrapper label {
    display: inline-flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

.update-on-sync-wrapper label input[type="checkbox"] {
    margin: 0 8px 0 0;
}

.update-on-sync-wrapper .description {
    margin: 5px 0 0 28px;
    font-size: 11px;
    color: #666;
}

.field-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: absolute;
    right: 20px;
    top: 15px;
}

.field-actions .button {
    padding: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-config {
    background: #0073aa;
    color: white;
    border: none;
}

.toggle-config:hover {
    background: #005a87;
}

/* Custom Fields */
.custom-fields-section .section-toggle {
    background: #e7f3ff;
}

.add-custom-field {
    margin-left: auto;
}

.custom-field-row {
    background: #fafafa;
    border-left: 4px solid #0073aa;
}

.custom-field-name,
.custom-field-type {
    margin-bottom: 5px;
}

.remove-custom-field {
    background: #dc3545;
    color: white;
    border: none;
}

.remove-custom-field:hover {
    background: #c82333;
}

/* File Structure Browser */
.structure-loader {
    text-align: center;
    padding: 20px;
}

.structure-tree {
    font-family: monospace;
    font-size: 12px;
}

.structure-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 20px;
}

.structure-tree li {
    margin: 2px 0;
    position: relative;
}

.structure-tree .field-path {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    display: inline-block;
}

.structure-tree .field-path:hover {
    background: #f0f0f0;
}

.structure-tree .field-sample {
    color: #666;
    margin-left: 10px;
    font-style: italic;
}

.structure-pagination {
    text-align: center;
    padding: 10px;
    border-top: 1px solid #ddd;
}

.pagination-info {
    margin: 0 10px;
    font-size: 12px;
    color: #666;
}

/* Sample Data Preview */
#sample-data-preview {
    max-height: 300px;
    overflow-y: auto;
}

.sample-product {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 10px;
    font-size: 12px;
}

.sample-product .field-name {
    font-weight: bold;
    color: #333;
}

.sample-product .field-value {
    color: #666;
    margin-left: 10px;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.actions-right {
    display: flex;
    gap: 10px;
}

.button-icon {
    margin-left: 5px;
}

/* Messages */
.upload-messages,
.mapping-messages {
    margin-top: 20px;
}

.notice {
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid #0073aa;
    background: #f7f7f7;
}

.notice.notice-success {
    border-left-color: #46b450;
}

.notice.notice-error {
    border-left-color: #dc3545;
}

.notice.notice-warning {
    border-left-color: #ff8c00;
}

/* Progress Bar */
.upload-progress {
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #46b450;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* URL Test Result */
.url-test-result {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

.url-test-result .success {
    color: #46b450;
}

.url-test-result .error {
    color: #dc3545;
}

/* Step 3 - Progress */
.import-progress-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 30px;
    text-align: center;
}

.import-status {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.import-status.processing {
    color: #0073aa;
}

.import-status.completed {
    color: #46b450;
}

.import-status.failed {
    color: #dc3545;
}

.progress-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#0073aa 0%, #f0f0f0 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    position: relative;
}

.progress-circle::before {
    content: '';
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: white;
    position: absolute;
}

.progress-percentage {
    font-size: 24px;
    font-weight: bold;
    z-index: 1;
}

.import-stats {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    padding: 20px;
    background: #f7f7f7;
    border-radius: 6px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    display: block;
    color: #333;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.import-logs {
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
}

.log-entry {
    margin-bottom: 5px;
    font-size: 12px;
    font-family: monospace;
}

.log-entry.info {
    color: #333;
}

.log-entry.error {
    color: #dc3545;
}

.log-entry.warning {
    color: #ff8c00;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .bfpi-sidebar {
        flex: 0 0 350px;
    }
}

@media (max-width: 1200px) {
    .bfpi-layout {
        flex-direction: column;
    }
    
    .bfpi-sidebar {
        flex: none;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .bfpi-steps {
        flex-direction: column;
    }
    
    .bfpi-steps::before {
        display: none;
    }
    
    .upload-method-selection {
        flex-direction: column;
    }
    
    .field-mapping-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .field-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .actions-right {
        width: 100%;
        justify-content: center;
    }
    
    .import-stats {
        flex-direction: column;
        gap: 15px;
    }
}

/* Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 87, 108, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 20px 5px rgba(245, 87, 108, 0.6); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 87, 108, 0); }
}

.spinner.is-active {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.success {
    color: #46b450 !important;
}

.error {
    color: #dc3545 !important;
}

/* AI Auto-Mapping Error Message */
.ai-mapping-error {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
    color: #fff !important;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 10px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(183, 28, 28, 0.3);
    font-weight: 500;
    line-height: 1.5;
    border-left: 4px solid #7f0000;
}

.ai-mapping-error .error-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.ai-mapping-error .error-text {
    flex: 1;
    word-break: break-word;
}

.ai-mapping-error .error-details {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 5px;
    font-family: monospace;
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.warning {
    color: #ff8c00 !important;
}

.info {
    color: #0073aa !important;
}

/* Boolean Field Radio Buttons (Yes/No/Map) */
.boolean-field-options {
    display: flex;
    gap: 8px;
    align-items: center;
}

.boolean-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.boolean-option input[type="radio"] {
    display: none;
}

.boolean-label {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s ease;
    border: 2px solid #ddd;
    background: #f9f9f9;
    color: #666;
}

.boolean-option input[type="radio"]:checked + .boolean-yes {
    background: #46b450;
    border-color: #46b450;
    color: white;
}

.boolean-option input[type="radio"]:checked + .boolean-no {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.boolean-option input[type="radio"]:checked + .boolean-map {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.boolean-label:hover {
    border-color: #999;
}

.boolean-map-field {
    margin-top: 8px;
}

/* Select with Map Options */
.select-with-map-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.select-map-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
}

.select-map-option input[type="radio"] {
    margin: 0;
    flex-shrink: 0;
}

.select-map-option select {
    flex: 1;
    max-width: 200px;
}

.select-map-field {
    margin-left: 24px;
    margin-top: 8px;
}

.select-map-field select {
    width: 100%;
}

/* Field type badge adjustments */
.field-mapping-row[data-field-type="boolean"] .field-type,
.field-mapping-row[data-field-type="status_select"] .field-type,
.field-mapping-row[data-field-type="tax_status_select"] .field-type,
.field-mapping-row[data-field-type="tax_class_select"] .field-type,
.field-mapping-row[data-field-type="stock_status_select"] .field-type,
.field-mapping-row[data-field-type="backorders_select"] .field-type {
    background: #e7f3ff;
    color: #0073aa;
}

/* Hide processing mode for special fields */
.field-mapping-row[data-field-type="boolean"] .processing-mode,
.field-mapping-row[data-field-type="status_select"] .processing-mode,
.field-mapping-row[data-field-type="tax_status_select"] .processing-mode,
.field-mapping-row[data-field-type="tax_class_select"] .processing-mode,
.field-mapping-row[data-field-type="stock_status_select"] .processing-mode,
.field-mapping-row[data-field-type="backorders_select"] .processing-mode,
.field-mapping-row[data-field-type="boolean"] .processing-config,
.field-mapping-row[data-field-type="status_select"] .processing-config,
.field-mapping-row[data-field-type="tax_status_select"] .processing-config,
.field-mapping-row[data-field-type="tax_class_select"] .processing-config,
.field-mapping-row[data-field-type="stock_status_select"] .processing-config,
.field-mapping-row[data-field-type="backorders_select"] .processing-config {
    display: none;
}

/* Adjust field-source width for special fields */
.field-mapping-row[data-field-type="boolean"] .field-source,
.field-mapping-row[data-field-type="status_select"] .field-source,
.field-mapping-row[data-field-type="tax_status_select"] .field-source,
.field-mapping-row[data-field-type="tax_class_select"] .field-source,
.field-mapping-row[data-field-type="stock_status_select"] .field-source,
.field-mapping-row[data-field-type="backorders_select"] .field-source {
    flex: 2;
}

/* Product Identifier Fields */
.identifier-field-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.primary-identifier-label {
    white-space: nowrap;
}

.primary-identifier-checkbox {
    margin: 0 !important;
}

.field-mapping-row.primary-identifier-selected {
    background: linear-gradient(to right, #e7f3ff, #fff) !important;
    border-left: 3px solid #0073aa;
}

.field-mapping-row.primary-identifier-selected .field-label {
    font-weight: 600;
    color: #0073aa;
}

/* ==========================================
   Delete Products Progress Modal
   ========================================== */
.bfpi-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bfpi-modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    overflow: hidden;
}

.bfpi-modal-content.delete-progress-modal .modal-header {
    background: linear-gradient(135deg, #dc3232 0%, #a00 100%);
    color: #fff;
    padding: 15px 20px;
}

.bfpi-modal-content.delete-progress-modal .modal-header h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bfpi-modal-content.delete-progress-modal .modal-header .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.bfpi-modal-content .modal-body {
    padding: 25px 20px;
}

.delete-progress-container {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.delete-spinner {
    flex-shrink: 0;
}

.delete-spinner .spinner {
    float: none;
    margin: 0;
}

.delete-progress-info {
    flex: 1;
}

.delete-progress-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
}

.delete-progress-bar-container {
    background: #e0e0e0;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 10px;
}

.delete-progress-bar {
    background: linear-gradient(90deg, #dc3232 0%, #ff6b6b 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.delete-progress-stats {
    font-size: 13px;
    color: #666;
}

.delete-progress-stats .deleted-count {
    font-weight: 600;
    color: #dc3232;
}

.delete-complete-message {
    text-align: center;
    padding: 20px 0;
}

.delete-complete-message .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #46b450;
    display: block;
    margin: 0 auto 15px;
}

.delete-complete-message .complete-text {
    font-size: 15px;
    color: #333;
}

.bfpi-modal-content .modal-footer {
    padding: 15px 20px;
    background: #f7f7f7;
    border-top: 1px solid #ddd;
    text-align: right;
}

.bfpi-modal-content .modal-footer .button {
    margin-left: 10px;
}

/* Delete products button styling */
.delete-products-ajax {
    cursor: pointer;
}

/* ==========================================
   NEW: Product Type Mode Selection UI
   ========================================== */

/* Mode cards - 3 card layout */
.mode-card {
    transition: all 0.3s ease;
    position: relative;
}

.mode-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
}

.mode-card input[type="radio"] {
    display: none;
}

/* Mode panels */
.mode-panel {
    animation: fadeIn 0.3s ease;
}

/* Attribute rows */
.attr-row {
    transition: all 0.2s ease;
}

.attr-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Meta rows */
.meta-row {
    transition: all 0.2s ease;
}

.meta-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Product type cards - legacy support */
.product-type-card {
    transition: all 0.2s ease;
    position: relative;
}

.product-type-card:hover {
    background: rgba(255,255,255,0.3) !important;
    transform: translateY(-2px);
}

.product-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.product-type-card input[type="radio"]:checked + strong::before {
    content: "✓ ";
}

.product-type-card.selected {
    background: rgba(255,255,255,0.25) !important;
    border-color: rgba(255,255,255,0.7) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Variable mode cards */
.variable-mode-card {
    transition: all 0.2s ease;
    position: relative;
}

.variable-mode-card:hover {
    background: rgba(255,255,255,0.25) !important;
    transform: translateY(-1px);
}

.variable-mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.variable-mode-card.selected {
    background: rgba(255,255,255,0.25) !important;
    border-color: rgba(255,255,255,0.7) !important;
}

/* Variable config panels */
.variable-config-panel {
    animation: fadeIn 0.3s ease;
}

/* Product type panels */
.product-type-panel {
    animation: fadeIn 0.3s ease;
}

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

/* CSV attribute checkboxes */
#csv-attribute-checkboxes label {
    transition: all 0.15s ease;
}

#csv-attribute-checkboxes label:hover {
    background: #e3f2fd !important;
    border-color: #90caf9 !important;
}

#csv-attribute-checkboxes input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #1565c0;
}

/* Manual attribute rows */
.manual-attribute-row {
    transition: all 0.2s ease;
}

.manual-attribute-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Spinning animation for loading */
.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mapping grid */
.mapping-grid label {
    font-weight: 600;
    color: #444;
}

.mapping-grid select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.mapping-grid select:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

/* Variation attribute rows */
.variation-attribute-row,
.display-attribute-row {
    transition: all 0.2s ease;
}

.variation-attribute-row:hover,
.display-attribute-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Variation preview */
#variation-count-preview {
    color: #0073aa;
}

/* Remove buttons */
.remove-variation-attribute,
.remove-display-attribute,
.remove-manual-attribute {
    border: none !important;
    background: none !important;
    font-size: 18px;
    line-height: 1;
}

.remove-variation-attribute:hover,
.remove-display-attribute:hover,
.remove-manual-attribute:hover {
    color: #a00 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* PRICING ENGINE STYLES                                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */

.pricing-engine-container {
    animation: fadeIn 0.3s ease;
}

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

#pricing-engine-settings {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 2000px; }
}

/* Pricing Engine input focus states */
.pricing-engine-container input[type="number"]:focus,
.pricing-engine-container select:focus {
    border-color: #ff9800;
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
    outline: none;
}

/* Live Preview animation */
#pricing_engine_test_output {
    transition: all 0.2s ease;
}

#pricing_engine_test_output.updated {
    transform: scale(1.05);
    background: #c8e6c9 !important;
}

/* Pricing Engine Toggle Checkbox */
#pricing_engine_enabled {
    cursor: pointer;
}

#pricing_engine_enabled:checked + span strong {
    color: #e65100;
}

/* Formula display */
#pricing_engine_formula {
    font-family: 'Consolas', 'Monaco', monospace;
    transition: all 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* PRICING ENGINE - Multiple Rules Styles                                      */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Pricing Rules List */
#pricing-rules-list {
    margin-bottom: 20px;
}

/* Conditional Rule Row */
.pricing-rule-conditional {
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pricing-rule-conditional:hover {
    border-color: #ff9800 !important;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.15);
}

/* Rule Drag Handle */
.rule-drag-handle {
    user-select: none;
}

.rule-drag-handle:hover {
    color: #ff9800 !important;
}

/* Rule Number Badge */
.rule-number {
    transition: all 0.2s ease;
}

/* Condition Row */
.condition-row {
    animation: fadeIn 0.2s ease;
}

/* Condition Type Select */
.condition-type {
    background: #fff;
    border: 1px solid #ddd;
    font-weight: 500;
}

.condition-type:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Condition Fields */
.condition-fields input,
.condition-fields select {
    transition: all 0.2s ease;
}

.condition-fields input:focus,
.condition-fields select:focus {
    border-color: #2196f3 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Remove Condition Button */
.remove-condition {
    opacity: 0.5;
    transition: all 0.2s ease;
}

.remove-condition:hover {
    opacity: 1;
    color: #d63638 !important;
}

/* Add Condition Button */
.add-condition {
    opacity: 0.8;
}

.add-condition:hover {
    opacity: 1;
    background: #e3f2fd;
}

/* Remove Pricing Rule Button */
.remove-pricing-rule {
    opacity: 0.6;
    transition: all 0.2s ease;
}

.remove-pricing-rule:hover {
    opacity: 1;
}

/* Default Rule Styling */
.pricing-rule-default {
    position: relative;
}

.pricing-rule-default::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #4caf50;
    border-radius: 8px 0 0 8px;
}

/* Rule Template Hidden */
#pricing-rule-template {
    display: none;
}

/* Matched Rule Indicator */
#pricing_engine_matched_rule {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
    margin-bottom: 4px;
}

/* ===== Language Switcher ===== */
.bootflow-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.bootflow-header-row h1 {
    margin: 0;
    padding: 0;
    flex: 1;
}

.bootflow-lang-switcher {
    position: relative;
    z-index: 100;
}

.bootflow-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    color: #1d2327;
    transition: all 0.15s ease;
}

.bootflow-lang-btn:hover {
    background: #f6f7f7;
    border-color: #8c8f94;
    color: #1d2327;
}

.bootflow-lang-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
    transition: transform 0.2s;
}

.bootflow-lang-btn.open .dashicons {
    transform: rotate(180deg);
}

.bootflow-lang-flag {
    font-size: 16px;
    line-height: 1;
}

.bootflow-lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    min-width: 200px;
    max-height: 380px;
    overflow-y: auto;
}

.bootflow-lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    text-decoration: none;
    color: #1d2327;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f1;
    transition: background 0.1s;
}

.bootflow-lang-option:last-child {
    border-bottom: none;
}

.bootflow-lang-option:hover {
    background: #f0f6fc;
    color: #1d2327;
}

.bootflow-lang-option.active {
    background: #f0f6fc;
    font-weight: 600;
    color: #2271b1;
}

.bootflow-lang-option.active::after {
    content: '✓';
    margin-left: auto;
    color: #2271b1;
}

/* ═══════════════════════════════════════════════════ */
/* TAXONOMY MAPPING UI                                  */
/* ═══════════════════════════════════════════════════ */

.taxonomy-mapping-container {
    padding: 20px;
}

.taxonomy-block {
    transition: box-shadow 0.2s;
}

.taxonomy-block:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Mapping table */
.taxonomy-mapping-table {
    border-collapse: collapse;
    width: 100%;
}

.taxonomy-mapping-table th {
    background: #f5f5f5;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid #ddd;
}

.taxonomy-mapping-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.taxonomy-mapping-table tr:hover td {
    background: #fafafa;
}

.taxonomy-mapping-table input[type="text"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.taxonomy-mapping-table select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    max-width: 100%;
}

.taxonomy-mapping-table .btn-remove-mapping-row {
    background: none;
    border: none;
    color: #cc1818;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 4px;
    transition: background 0.2s;
}

.taxonomy-mapping-table .btn-remove-mapping-row:hover {
    background: #fce4ec;
}

/* Mode options styling */
.taxonomy-mode-option {
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.taxonomy-mode-option:hover {
    background: #f0f0f0;
}

.taxonomy-mode-option input[type="radio"]:checked ~ span strong {
    color: #2271b1;
}
}

/* ── Settings page tabs ── */
.bfpi-settings-wrap .tab-content { display: none; }
.bfpi-settings-wrap .tab-content.active { display: block; }

/* Toggle-password button */
.bfpi-settings-wrap .toggle-password {
    cursor: pointer;
    margin-left: 6px;
    color: #2271b1;
    user-select: none;
}