/**
 * Myragen Dashboard - Components CSS
 * 
 * @package Myragen_Dashboard
 * @since 2.0.0
 */

/* ============================================
   Buttons
============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
    border-color: #16a34a;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: #000;
    border-color: var(--warning);
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    border-color: #d97706;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger:hover:not(:disabled) {
    background: var(--danger);
    color: white;
}

/* ============================================
   Forms
============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--bg-darker);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

select.form-control[multiple] {
    background-image: none;
    padding-right: 0.875rem;
    min-height: 120px;
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.invalid-feedback {
    display: none;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--danger);
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Checkbox & Radio */
.form-group label input[type="checkbox"],
.form-group label input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: var(--primary);
}

/* Form Row */
.form-row {
    display: flex;
    gap: 1rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.form-row .form-group {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.form-row .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.form-row .col-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.form-row .col-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

/* Form Actions */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Form Tabs */
.form-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.form-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.form-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.form-tab.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.form-tab-content {
    display: none;
}

.form-tab-content.active {
    display: block;
}

/* ============================================
   Modals
============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    opacity: 0;
    transition: opacity var(--transition);
}

.modal.open {
    display: flex;
    opacity: 1;
}

.modal-dialog {
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(-20px);
    transition: transform var(--transition);
}

.modal.open .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-dialog.modal-sm {
    max-width: 400px;
}

.modal-dialog.modal-lg {
    max-width: 700px;
}

.modal-dialog.modal-xl {
    max-width: 900px;
}

.modal-content {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: inherit;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Settings Tabs
============================================ */
.settings-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.settings-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-darker);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.tab-btn.active {
    color: var(--primary);
    background: var(--bg-card);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.settings-tab-content {
    display: none;
    padding: 1.5rem;
}

.settings-tab-content.active {
    display: block;
}

.settings-form {
    max-width: 600px;
}

/* ============================================
   Upload Zone
============================================ */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-zone i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-zone p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

.upload-zone input[type="file"] {
    display: none;
}

/* Upload Progress */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-darker);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    width: 0%;
    transition: width var(--transition-fast);
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-width: 40px;
}

/* Upload List */
.upload-list {
    margin-top: 1rem;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-darker);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.upload-item .file-icon {
    font-size: 1.25rem;
    color: var(--text-muted);
}

.upload-item .file-info {
    flex: 1;
}

.upload-item .file-name {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.upload-item .file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.upload-item .file-status {
    font-size: 1rem;
}

.upload-item .file-status.success {
    color: var(--success);
}

.upload-item .file-status.error {
    color: var(--danger);
}

/* ============================================
   Image Upload Box
============================================ */
.image-upload-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.image-preview {
    width: 200px;
    height: 200px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block !important;
}

.image-preview img.visible {
    display: block !important;
}

/* Garantir que imagem apareça quando tem arquivo */
.image-preview.has-image img,
#editProductImagePreview img {
    display: block !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview::before {
    content: '\f03e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    font-size: 2rem;
    color: var(--text-muted);
}

.image-preview:has(img.visible)::before,
.image-preview.has-image::before,
.image-preview:has(img)::before {
    display: none;
}

/* Gallery Upload */
.gallery-upload-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gallery-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gallery-image-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.gallery-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-image-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.gallery-image-item:hover .remove-btn {
    opacity: 1;
}

/* ============================================
   Media Selector Modal
============================================ */
.media-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.media-selector-item {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-darker);
    border: 2px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.media-selector-item:hover {
    border-color: var(--border-light);
}

.media-selector-item.selected {
    border-color: var(--primary);
}

.media-selector-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-selector-item .check-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
}

.media-selector-item.selected .check-icon {
    display: flex;
}

/* ============================================
   Order Details
============================================ */
.order-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.order-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.order-col h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.order-col p {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.order-items h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.order-items .data-table {
    font-size: 0.875rem;
}

.order-items .data-table tfoot tr:first-child td {
    border-top: 2px solid var(--border-color);
    padding-top: 0.75rem;
}

.order-items .data-table tfoot td {
    font-weight: 600;
}

.order-status-update h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* ============================================
   Orders Stats
============================================ */
.orders-stats {
    display: flex;
    gap: 0.75rem;
}

.orders-stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.8125rem;
}

.orders-stat-item .value {
    font-weight: 600;
    color: var(--text-primary);
}

.orders-stat-item .label {
    color: var(--text-secondary);
}

/* ============================================
   Product Thumbnail
============================================ */
.product-thumbnail {
    width: 50px;
    height: 50px;
    background: var(--bg-darker);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumbnail i {
    font-size: 1.25rem;
    color: var(--text-muted);
}

/* ============================================
   Responsive Forms
============================================ */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .form-row .col-6,
    .form-row .col-4,
    .form-row .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .modal-dialog {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    .order-row {
        grid-template-columns: 1fr;
    }
    
    .settings-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        justify-content: flex-start;
    }
    
    .tab-btn.active::after {
        top: 0;
        bottom: 0;
        left: 0;
        right: auto;
        width: 3px;
        height: 100%;
    }
}

/* ============================================
   Product Editor - Full Page
============================================ */
.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.editor-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.editor-header-left h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.editor-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.editor-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
    align-items: start;
}

.editor-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1rem;
}

.editor-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.editor-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.editor-card-header h3 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-card-header h3 i {
    color: var(--primary);
    font-size: 0.875rem;
}

.editor-card-body {
    padding: 1.25rem;
}

/* Form Controls aprimorados */
.form-control-lg {
    padding: 0.875rem 1rem;
    font-size: 1.125rem;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Product Image Upload */
.product-image-upload {
    text-align: center;
}

.image-preview {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-darker);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.image-preview:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.image-preview i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.image-preview span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.image-preview.has-image {
    border-style: solid;
    border-color: var(--border-color);
}

.image-preview.has-image i,
.image-preview.has-image span {
    display: none;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block !important;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    background: var(--bg-darker);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .gallery-item-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.gallery-item:hover .gallery-item-remove {
    opacity: 1;
}

/* Categories List */
.categories-list {
    max-height: 200px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
}

.category-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.category-item label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.category-item.child {
    padding-left: 1.25rem;
}

/* Tags suggestions */
.tags-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.tag-suggestion {
    padding: 0.25rem 0.625rem;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tag-suggestion:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Attributes List */
.attributes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attribute-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-darker);
    border-radius: var(--radius);
}

.attribute-item .form-control {
    flex: 1;
}

.attribute-item .btn-danger {
    flex-shrink: 0;
}

/* Btn Block */
.btn-block {
    width: 100%;
}

/* Responsive Editor */
@media (max-width: 1200px) {
    .editor-content {
        grid-template-columns: 1fr;
    }
    
    .editor-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .editor-header-left,
    .editor-header-right {
        justify-content: space-between;
    }
    
    .editor-sidebar {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .col-4,
    .form-row .col-6,
    .form-row .col-8 {
        flex: none;
        max-width: 100%;
    }
}
/* ============================================
   Light Mode - Modal Override
============================================ */
.myragen-dashboard-wrapper.light-mode .modal-content {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

.myragen-dashboard-wrapper.light-mode .modal-header {
    background: rgba(248, 250, 252, 0.9) !important;
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

.myragen-dashboard-wrapper.light-mode .modal-title {
    color: #1e293b !important;
}

.myragen-dashboard-wrapper.light-mode .modal-body {
    background: #ffffff !important;
}

.myragen-dashboard-wrapper.light-mode .modal-footer {
    background: rgba(248, 250, 252, 0.9) !important;
    border-top-color: rgba(0, 0, 0, 0.08) !important;
}

/* ============================================
   Sticky Action Bar (Editor Footer)
============================================ */
.editor-sticky-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 70px;
    background: rgba(10, 10, 24, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.editor-sticky-footer.visible {
    transform: translateY(0);
}

.editor-sticky-footer .footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.editor-sticky-footer .footer-left .product-name {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-sticky-footer .footer-left .unsaved-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--warning);
    font-size: 0.8125rem;
}

.editor-sticky-footer .footer-left .unsaved-indicator i {
    animation: pulse 2s infinite;
}

.editor-sticky-footer .footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.editor-sticky-footer .btn {
    padding: 0.625rem 1.25rem;
}

/* Light Mode */
.myragen-dashboard-wrapper.light-mode .editor-sticky-footer {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: rgba(0, 0, 0, 0.1);
}

/* Adiciona padding no conteúdo quando footer está visível */
#sectionProductEditor.has-sticky-footer .editor-content {
    padding-bottom: 90px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Mobile */
@media (max-width: 768px) {
    .editor-sticky-footer {
        left: 0;
        padding: 0 1rem;
    }
    
    .editor-sticky-footer .footer-left .product-name {
        display: none;
    }
}

/* ============================================
   Payment Methods Section
============================================ */
.section-header .section-title-area {
    flex: 1;
}

.section-header .section-subtitle {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.section-header .section-actions {
    display: flex;
    gap: 0.75rem;
}

/* Payment Stats Grid */
.payment-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.payment-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.payment-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.payment-stat-card.success {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.05);
}

.payment-stat-card.info {
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.05);
}

.payment-stat-card.warning {
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.05);
}

.payment-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 1.25rem;
}

.payment-stat-card.success .stat-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.payment-stat-card.info .stat-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.payment-stat-card.warning .stat-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.payment-stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.payment-stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.payment-stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Gateways Section */
.gateways-section {
    margin-bottom: 2rem;
}

.subsection-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.subsection-title i {
    color: var(--primary);
}

.gateways-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* Gateway Card */
.gateway-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.gateway-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity var(--transition);
}

.gateway-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-accent);
}

.gateway-card:hover::before {
    opacity: 1;
}

.gateway-card.coming-soon {
    opacity: 0.7;
}

.gateway-card.coming-soon:hover {
    opacity: 1;
}

.gateway-card .ribbon {
    position: absolute;
    top: 15px;
    right: -35px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    padding: 0.25rem 2.5rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.gateway-card .gateway-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.gateway-card .gateway-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 1.5rem;
}

.gateway-card .gateway-logo.mercadopago {
    background: linear-gradient(135deg, #00b1ea, #0080c7);
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
}

.gateway-card .gateway-logo.paypal {
    background: linear-gradient(135deg, #0070ba, #00457c);
    color: white;
}

.gateway-card .gateway-logo .badge-oficial {
    position: absolute;
    top: -4px;
    right: -8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.5rem;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

.gateway-card .gateway-info {
    flex: 1;
}

.gateway-card .gateway-info h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.gateway-card .gateway-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.gateway-card .gateway-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.gateway-card .gateway-badge.certified {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.gateway-card .gateway-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.gateway-card .gateway-description strong {
    color: var(--primary-light);
}

/* Payment Methods Tags */
.payment-methods-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.method-tag {
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
}

.method-tag.pix {
    background: rgba(0, 180, 216, 0.15);
    color: #00b4d8;
}

.method-tag.card {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.method-tag.boleto {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.method-tag.cash {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.method-tag.disabled {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* Gateway Features */
.gateway-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem;
}

.gateway-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.gateway-features li i {
    color: #10b981;
    font-size: 0.625rem;
}

/* Gateway Status Box */
.gateway-status-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.875rem;
    margin-bottom: 1rem;
}

.gateway-status-box .status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.gateway-status-box .status-header > span:first-child {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.gateway-status-box .status-indicator {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.gateway-status-box .status-indicator.connected {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.gateway-status-box .status-progress .progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.gateway-status-box .status-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.gateway-status-box .status-progress .progress-fill.connected {
    background: linear-gradient(90deg, #10b981, #059669);
}

.gateway-status-box .status-description {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Gateway Actions */
.gateway-card .gateway-actions {
    display: flex;
    gap: 0.5rem;
}

.gateway-card .btn-mercadopago {
    flex: 1;
    background: linear-gradient(135deg, #00b4d8, #0096c7);
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 150, 199, 0.4);
}

.gateway-card .btn-mercadopago:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 150, 199, 0.5);
}

.gateway-card .btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.gateway-card .btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.gateway-card .btn-disabled {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #64748b;
    width: 100%;
}

.gateway-card .btn-outline {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #6366f1;
}

.gateway-card .btn-outline:hover {
    background: rgba(99, 102, 241, 0.15);
}

/* Gateway Footer */
.gateway-card .gateway-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.65rem;
    color: #64748b;
}

.gateway-card .gateway-footer i {
    color: #10b981;
}

/* Add More Card */
.gateway-card.add-more {
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    text-align: center;
}

.gateway-card.add-more:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.gateway-card.add-more::before {
    display: none;
}

.gateway-card.add-more .add-more-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.gateway-card.add-more .add-icon {
    width: 64px;
    height: 64px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.gateway-card.add-more h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.gateway-card.add-more p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    max-width: 280px;
}

.gateway-card.add-more .upcoming-gateways {
    margin-top: 0.5rem;
}

.gateway-card.add-more .upcoming-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.gateway-card.add-more .upcoming-tags {
    display: flex;
    gap: 0.5rem;
}

.gateway-card.add-more .upcoming-tags span {
    padding: 0.375rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Global Settings Section */
.global-settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
}

.settings-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.settings-card {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.settings-card h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.setting-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.setting-description {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Payments */
@media (max-width: 768px) {
    .payment-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .gateways-grid {
        grid-template-columns: 1fr;
    }
    
    .gateway-features {
        grid-template-columns: 1fr;
    }
    
    .settings-cards-grid {
        grid-template-columns: 1fr;
    }
}