/* Ecommerce Panel Styles */
.ecommerce-sidebar-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-panel);
    /* Reuse workbench vars */
}

.eco-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.eco-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
}

/* Control Groups */
/* Control Groups - Compact */
.control-group {
    margin-bottom: 16px;
    /* Reduced from 24px */
}

/* Row Layout */
.eco-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.eco-row .control-group {
    flex: 1;
    margin-bottom: 0;
}

.group-label {
    display: block;
    font-size: 13px;
    /* Slightly smaller */
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.required {
    color: #ff4d4f;
    margin-left: 4px;
}

/* Upload Zone */
/* Upload Zone - Compact */
.eco-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    height: 120px;
    /* Reduced from 160px */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--bg-input);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.eco-upload-zone:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

/* Framed Input (Matches workbench.css .input-container-framed) */
.eco-input-framed {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #f9fafb;
    transition: all 0.2s;
}

.eco-input-framed:focus-within {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Textarea inside frame */
.eco-prompt-input {
    width: 100%;
    min-height: 80px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: none;
    box-shadow: none;
}

.eco-prompt-input:focus {
    outline: none;
    box-shadow: none;
    border: none;
}

.eco-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    pointer-events: none;
}

.eco-placeholder .icon {
    font-size: 24px;
}

.eco-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Size & Quality Options */
.eco-size-options,
.eco-qty-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Unified Pill Button */
.eco-option-btn {
    padding: 8px 16px;
    border-radius: 9999px;
    /* Pill shape */
    border: 1px solid #e5e7eb;
    /* Light gray */
    background: #ffffff;
    color: #1f2937;
    /* Dark gray text */
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.eco-option-btn:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

/* Active State: Black Background */
.eco-option-btn.active {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.eco-option-btn .icon {
    font-size: 14px;
}

/* Style Grid -> Flex Container */
.eco-style-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}


/* Textarea */
.eco-textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    resize: none;
    font-size: 14px;
}

.eco-textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Qty Options */
.eco-qty-options {
    display: flex;
    gap: 8px;
}

/* Footer Button */
.eco-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: filter 0.2s;
}

.eco-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
}

.eco-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-disabled);
    color: var(--text-disabled);
}

/* Textarea Input - Enhanced Visibility */
.eco-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    /* Clearer border */
    background-color: #ffffff;
    /* Lighter background */
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: all 0.2s;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    /* Subtle inner shadow */
}

.eco-textarea:focus {
    outline: none;
    border-color: #6366f1;
    /* Primary color focus */
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .eco-textarea {
        background-color: #1e293b;
        border-color: #475569;
        color: #f1f5f9;
    }

    .eco-textarea:focus {
        background-color: #0f172a;
        border-color: #818cf8;
    }
}

/* Upload Grid Layout */
.eco-upload-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eco-upload-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.eco-ref-count {
    background: #6366f1;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.eco-upload-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 100px;
    /* Ensure drop area size */
    padding: 12px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    transition: all 0.2s;
}

.eco-upload-grid.drag-over {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

/* Initial Placeholder (Big) */
.eco-upload-placeholder {
    width: 100%;
    height: 100%;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    cursor: pointer;
    gap: 8px;
}

.eco-upload-placeholder:hover {
    color: #6366f1;
}

/* Thumbnail Item */
.eco-ref-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #000;
}

.eco-ref-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eco-ref-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.eco-ref-remove:hover {
    background: rgba(239, 68, 68, 0.9);
    /* Red */
}

/* Add Button (Small) */
.eco-add-image-btn {
    width: 80px;
    height: 80px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.eco-add-image-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}