/**
 * Product Addons Admin CSS
 */

/* Tab icon via ::before */
#woocommerce-product-data ul.wc-tabs li.SWIFT_COMMERCE_addons_tab a::before {
    content: "\f502";
}

/* Wrapper */
.swift-commerce-addons-wrapper {
    padding: 20px;
}

/* Branded panel header */
.swift-commerce-addons-wrapper .swift-commerce-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: #f8f9fa;
    color: #1e1e1e;
    margin: -20px -20px 20px -20px;
    border-bottom: 1px solid #e0e0e0;
}

.swift-commerce-addons-wrapper .swift-commerce-panel-header span {
    font-size: 14px;
    font-weight: 600;
    color: #1e1e1e;
}

.swift-commerce-addons-header {
    margin-bottom: 20px;
}

.swift-commerce-addons-header .description {
    color: #666;
    margin: 0;
}

/* Addon List */
.swift-commerce-addons-list {
    margin-bottom: 0;
}

.swift-commerce-addons-list:not(:empty) {
    margin-bottom: 5px;
}

/* Addon Item */
.swift-commerce-addon-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 10px;
}

.swift-commerce-addon-item:last-child {
    margin-bottom: 0;
}

/* Addon Header */
.swift-commerce-addon-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
}

.swift-commerce-addon-item:not(.is-expanded) .swift-commerce-addon-header {
    border-bottom: none;
    border-radius: 6px;
}

.swift-commerce-addon-drag-handle {
    cursor: grab;
    color: #999;
}

.swift-commerce-addon-drag-handle:hover {
    color: #333;
}

.swift-commerce-addon-type-badge {
    background: #0073aa;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.swift-commerce-addon-title {
    flex: 1;
    font-weight: 500;
}

.swift-commerce-addon-toggle {
    color: #666;
    transition: transform 0.2s;
}

.swift-commerce-addon-item.is-expanded .swift-commerce-addon-toggle {
    transform: rotate(180deg);
}

.swift-commerce-addon-remove {
    color: #a00;
    cursor: pointer;
}

.swift-commerce-addon-remove:hover {
    color: #dc3232;
}

/* Addon Content */
.swift-commerce-addon-content {
    padding: 15px;
}

.swift-commerce-addon-fields .form-field {
    margin-bottom: 15px;
}

.swift-commerce-addon-fields .form-field:last-child {
    margin-bottom: 0;
}

.swift-commerce-addon-fields label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.swift-commerce-addon-fields input[type="text"],
.swift-commerce-addon-fields input[type="number"],
.swift-commerce-addon-fields textarea,
.swift-commerce-addon-fields select {
    width: 100%;
    max-width: 400px;
}

.swift-commerce-addon-fields textarea {
    min-height: 80px;
}

.swift-commerce-addon-fields input[type="checkbox"] {
    margin-right: 8px;
}

/* Options Wrapper */
.swift-commerce-addon-options-wrapper {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.swift-commerce-addon-options-wrapper > label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Option Row */
.swift-commerce-addon-options {
    margin-bottom: 10px;
}

.swift-commerce-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
}

.swift-commerce-option-drag {
    cursor: grab;
    color: #999;
    font-size: 14px;
}

.swift-commerce-option-row input[type="text"] {
    flex: 1;
    min-width: 120px;
}

.swift-commerce-option-row .swift-commerce-option-price {
    width: 80px;
}

.swift-commerce-option-row .swift-commerce-option-pricing {
    width: 70px;
}

.swift-commerce-remove-option {
    background: none;
    border: none;
    color: #a00;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
}

.swift-commerce-remove-option:hover {
    color: #dc3232;
}

/* Add Option Button */
.swift-commerce-add-option {
    margin-top: 5px;
}

/* Actions */
.swift-commerce-addons-actions {
    padding-top: 20px;
    margin-top: 15px;
    border-top: 1px solid #eee;
}

.swift-commerce-addons-actions select {
    min-width: 200px;
}

/* Sortable Placeholder */
.swift-commerce-addon-item.ui-sortable-placeholder {
    background: #f0f6fc;
    border: 2px dashed #0073aa;
    visibility: visible !important;
    height: 50px;
}

.swift-commerce-option-row.ui-sortable-placeholder {
    background: #f0f6fc;
    border: 2px dashed #0073aa;
    visibility: visible !important;
}

/* Image Upload */
.swift-commerce-option-image-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.swift-commerce-option-image-preview {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #ddd;
}

.swift-commerce-upload-image {
    font-size: 11px;
}

/* Display Style Select */
.swift-commerce-display-style {
    margin-top: 10px;
}

.swift-commerce-display-style label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .swift-commerce-option-row {
        flex-wrap: wrap;
    }
    
    .swift-commerce-option-row input[type="text"] {
        width: calc(100% - 30px);
    }
    
    .swift-commerce-option-row .swift-commerce-option-price,
    .swift-commerce-option-row .swift-commerce-option-pricing {
        width: calc(50% - 20px);
    }
}

