/* ====================================
   EC Orders Styles
   Estilos para a seção de pedidos do usuário
   ==================================== */

/* Orders Section Container */
.ec-orders-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    padding: 30px;
    margin-bottom: 30px;
}

/* Order Statistics */
.ec-orders-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e1e5e9;
}

.ec-stat-card {
    background: linear-gradient(135deg, var(--ec-primary) 0%, var(--ec-secondary) 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.ec-stat-card:hover {
    transform: translateY(-5px);
}

.ec-stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 8px;
}

.ec-stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Orders List */
.ec-orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Individual Order Card */
.ec-order-card {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.ec-order-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--ec-primary, #f08000);
}

/* Order Header */
.ec-order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.ec-order-info h3.ec-order-number {
    margin: 0 0 8px 0;
    color: #1e293b;
    font-size: 1.3em;
    font-weight: 600;
}

.ec-order-date {
    color: #64748b;
    font-size: 0.9em;
}

/* Order Status */
.ec-order-status .ec-status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ec-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.ec-status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.ec-status-on-hold {
    background: #fde68a;
    color: #d97706;
}

.ec-status-completed {
    background: #d1fae5;
    color: #065f46;
}

.ec-status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.ec-status-refunded {
    background: #f3e8ff;
    color: #7c3aed;
}

.ec-status-failed {
    background: #fecaca;
    color: #b91c1c;
}

/* Order Summary */
.ec-order-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.ec-order-items {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ec-items-count {
    color: #64748b;
    font-size: 0.9em;
}

.ec-order-total {
    font-size: 1.2em;
    font-weight: bold;
    color: #1e293b;
}

/* Order Actions */
.ec-order-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ec-order-btn {
    background: var(--ec-primary, #f08000);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ec-order-btn:hover {
    background: var(--ec-primary-hover, #e67300);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.ec-order-btn.ec-reorder {
    background: #10b981;
}

.ec-order-btn.ec-reorder:hover {
    background: #059669;
}

.ec-order-btn.ec-pay-order {
    background: #f59e0b;
}

.ec-order-btn.ec-pay-order:hover {
    background: #d97706;
}

.ec-order-btn.ec-cancel-order {
    background: #ef4444;
}

.ec-order-btn.ec-cancel-order:hover {
    background: #dc2626;
}

/* Order Details (Expandable) */
.ec-order-details {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e1e5e9;
    animation: fadeIn 0.3s ease;
}

.ec-order-details-content {
    display: grid;
    gap: 25px;
}

.ec-detail-section h4 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Order Items List */
.ec-order-items-list {
    display: grid;
    gap: 15px;
}

.ec-order-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ec-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.ec-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ec-no-image {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: #64748b;
}

.ec-item-details h5 {
    margin: 0 0 8px 0;
    color: #1e293b;
    font-size: 1em;
    font-weight: 500;
}

.ec-item-meta {
    color: #64748b;
    font-size: 0.9em;
}

/* Order Totals */
.ec-order-totals {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ec-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.95em;
}

.ec-total-line:last-child {
    margin-bottom: 0;
}

.ec-total-line.ec-total-final {
    font-size: 1.1em;
    padding-top: 12px;
    border-top: 2px solid #e2e8f0;
    margin-top: 12px;
}

/* Addresses Section */
.ec-addresses-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.ec-address-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ec-address-card h4 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 1em;
    font-weight: 600;
}

.ec-address {
    color: #64748b;
    line-height: 1.5;
}

/* Payment Method */
.ec-payment-method {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-weight: 500;
}

/* Empty State */
.ec-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.ec-empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.ec-empty-state h3 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 1.5em;
}

.ec-empty-state p {
    margin: 0 0 25px 0;
    font-size: 1.1em;
    line-height: 1.6;
}

/* Error Message */
.ec-error-message {
    text-align: center;
    padding: 40px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
}

.ec-error-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.ec-error-message h3 {
    margin: 0 0 10px 0;
    color: #dc2626;
}

/* Loading State */
.ec-loading {
    text-align: center;
    padding: 20px;
    color: #64748b;
    font-style: italic;
}

/* Primary Button */
.ec-btn {
    background: var(--ec-primary, #f08000);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ec-btn:hover {
    background: var(--ec-primary-hover, #e67300);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.ec-btn-primary {
    background: var(--ec-primary, #f08000);
}

.ec-btn-primary:hover {
    background: var(--ec-primary-hover, #e67300);
}

/* Responsive Design */
@media (max-width: 768px) {
    .ec-orders-section {
        padding: 20px;
    }
    
    .ec-orders-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .ec-stat-card {
        padding: 20px;
    }
    
    .ec-stat-number {
        font-size: 2em;
    }
    
    .ec-order-card {
        padding: 20px;
    }
    
    .ec-order-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .ec-order-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .ec-order-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .ec-order-btn {
        flex: 1;
        justify-content: center;
    }
    
    .ec-addresses-section {
        grid-template-columns: 1fr;
    }
    
    .ec-order-item {
        flex-direction: column;
        text-align: center;
    }
    
    .ec-item-image {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .ec-orders-stats {
        grid-template-columns: 1fr;
    }
    
    .ec-order-actions {
        flex-direction: column;
    }
    
    .ec-stat-number {
        font-size: 1.8em;
    }
}

/* Modal Open State */
body.modal-open {
    overflow: hidden;
}

/* Order Details Modal */
.ec-order-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.ec-order-modal.active {
    display: flex;
}

.ec-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

.ec-modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--ec-primary) 0%, var(--ec-secondary) 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.ec-modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.ec-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.ec-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ec-modal-body {
    padding: 30px;
}

.ec-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    background: #f8fafc;
    border-radius: 0 0 16px 16px;
}

/* Modal Order Details */
.ec-modal-order-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.ec-modal-info-item {
    text-align: center;
}

.ec-modal-info-label {
    display: block;
    font-size: 0.85em;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ec-modal-info-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #1e293b;
}

.ec-modal-info-value.status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

/* Modal Sections */
.ec-modal-section {
    margin-bottom: 30px;
}

.ec-modal-section:last-child {
    margin-bottom: 0;
}

.ec-modal-section-title {
    margin: 0 0 20px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

/* Modal Order Items */
.ec-modal-items-list {
    display: grid;
    gap: 15px;
}

.ec-modal-order-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: box-shadow 0.3s ease;
}

.ec-modal-order-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ec-modal-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ec-modal-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ec-modal-item-details {
    flex: 1;
}

.ec-modal-item-details h4 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #1e293b;
}

.ec-modal-item-meta {
    color: #64748b;
    font-size: 0.95em;
    margin-bottom: 10px;
}

.ec-modal-item-price {
    font-size: 1.1em;
    font-weight: 600;
    color: #059669;
}

/* Modal Order Totals */
.ec-modal-totals {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.ec-modal-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.ec-modal-total-row:last-child {
    border-bottom: none;
    background: #f8fafc;
    font-weight: 600;
    font-size: 1.1em;
}

/* Modal Addresses */
.ec-modal-addresses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.ec-modal-address-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

.ec-modal-address-title {
    margin: 0 0 15px 0;
    font-size: 1em;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ec-modal-address-content {
    color: #64748b;
    line-height: 1.6;
}

/* Modal Payment Info */
.ec-modal-payment {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.ec-modal-payment-method {
    font-size: 1.1em;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
}

.ec-modal-payment-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

/* Modal Notes */
.ec-modal-notes {
    display: grid;
    gap: 15px;
}

.ec-modal-note {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
}

.ec-note-date {
    font-size: 0.85em;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.ec-note-content {
    color: #1e293b;
    line-height: 1.6;
    margin: 0;
}

/* Modal Actions */
.ec-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ec-modal-btn {
    background: var(--ec-primary, #f08000);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ec-modal-btn:hover {
    background: var(--ec-primary-hover, #e67300);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.ec-modal-btn.secondary {
    background: #64748b;
}

.ec-modal-btn.secondary:hover {
    background: #475569;
}

.ec-modal-btn.success {
    background: #10b981;
}

.ec-modal-btn.success:hover {
    background: #059669;
}

.ec-modal-btn.warning {
    background: #f59e0b;
}

.ec-modal-btn.warning:hover {
    background: #d97706;
}

.ec-modal-btn.danger {
    background: #ef4444;
}

.ec-modal-btn.danger:hover {
    background: #dc2626;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .ec-order-modal {
        padding: 10px;
    }
    
    .ec-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .ec-modal-header {
        padding: 20px;
        border-radius: 12px 12px 0 0;
    }
    
    .ec-modal-header h2 {
        font-size: 1.3em;
    }
    
    .ec-modal-body {
        padding: 20px;
    }
    
    .ec-modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .ec-modal-order-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
    
    .ec-modal-order-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .ec-modal-item-image {
        align-self: center;
    }
    
    .ec-modal-addresses {
        grid-template-columns: 1fr;
    }
    
    .ec-modal-actions {
        justify-content: stretch;
    }
    
    .ec-modal-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
} 