/* ==========================================
   MODAL DÉTAILS COMMANDES
   ========================================== */

   .order-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.order-modal {
    background: var(--tg-bg-main);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    border-radius: 12px 12px 0 0;
    animation: slideUp 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.order-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    background: var(--tg-bg-main);
    z-index: 10;
    min-height: 56px;
}

.order-modal .modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--tg-text-primary);
    line-height: 1.2;
}

.order-modal .modal-close {
    background: none;
    border: none;
    color: var(--tg-text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.order-modal .modal-close:hover,
.order-modal .modal-close:active {
    background: rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
}

.order-modal .modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.order-modal .modal-status {
    text-align: center;
    padding: 16px 20px 8px;
    margin-bottom: 0;
}

.order-modal .modal-section {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: -1px;
}

.order-modal .modal-section:last-child {
    border-bottom: none;
    padding-bottom: 20px;
}

.order-modal .modal-section h4 {
    color: var(--tg-text-secondary);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.2;
}

.order-modal .modal-section p {
    color: var(--tg-text-primary);
    font-size: 14px;
    margin: 4px 0;
    line-height: 1.35;
}

.order-modal .modal-items-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.order-modal .modal-items-list li {
    color: var(--tg-text-primary);
    font-size: 14px;
    padding: 4px 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.order-modal .modal-amount {
    font-size: 22px;
    font-weight: 700;
    color: var(--tg-primary);
    margin: 4px 0;
}

.order-modal .modal-actions {
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 0;
    background: var(--tg-bg-main);
}

.order-modal .modal-actions button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.order-modal .btn-primary {
    background: var(--tg-primary);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.order-modal .btn-primary:hover,
.order-modal .btn-primary:active {
    background: var(--tg-primary);
    opacity: 0.9;
    transform: scale(0.98);
}

.order-modal .modal-info {
    background: rgba(0, 0, 0, 0.02);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--tg-text-primary);
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    margin-top: 8px;
}

/* Styles pour les informations client structurées */
.client-info {
    margin-top: 8px;
}

.client-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-text-primary);
    margin-bottom: 12px;
}

.client-address {
    background: rgba(0, 0, 0, 0.02);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 3px solid var(--tg-primary);
}

.address-line {
    font-size: 15px;
    color: var(--tg-text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.address-complement {
    font-size: 14px;
    color: var(--tg-text-secondary);
    margin-bottom: 4px;
    font-style: italic;
}

.address-city {
    font-size: 15px;
    color: var(--tg-text-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.address-region {
    font-size: 13px;
    color: var(--tg-text-hint);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.client-contact {
    font-size: 14px;
    color: var(--tg-text-secondary);
    background: rgba(var(--tg-primary-rgb), 0.05);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(var(--tg-primary-rgb), 0.1);
}

/* Nouveaux styles compacts */
.order-modal .modal-items-list .product-name {
    font-weight: 500;
    color: var(--tg-text-primary);
}

.order-modal .modal-items-list .product-quantity {
    font-size: 13px;
    color: var(--tg-text-secondary);
    font-weight: 400;
}

.order-modal .modal-items-list .product-price {
    font-weight: 600;
    color: var(--tg-primary);
    margin-left: auto;
}

/* Section résumé consolidée */
.order-modal .modal-summary {
    background: rgba(0, 0, 0, 0.015);
    border-radius: 6px;
    margin: 4px 0;
}

.order-modal .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.order-modal .summary-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--tg-text-secondary);
}

.order-modal .summary-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--tg-primary);
    margin-left: 2px;
}

.order-modal .summary-date {
    font-size: 13px;
    color: var(--tg-text-secondary);
    margin-left: 2px;
}

/* Informations client compactes */
.order-modal .client-info-compact .client-header {
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-text-primary);
    margin-bottom: 6px;
}

.order-modal .client-address-compact {
    font-size: 13px;
    color: var(--tg-text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
    border-left: 2px solid var(--tg-primary);
}

.order-modal .client-contact-compact {
    font-size: 12px;
    color: var(--tg-text-hint);
    padding: 4px 8px;
    background: rgba(var(--tg-primary-rgb), 0.05);
    border-radius: 4px;
    display: inline-block;
}

.order-modal .buyer-order-info-compact {
    font-size: 14px;
    line-height: 1.4;
}

.order-modal .buyer-order-info-compact p {
    margin: 4px 0;
}

/* Bouton Charger plus pour pagination */
.load-more-container {
    padding: 20px;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 8px;
}

.btn-load-more {
    background: var(--tg-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 auto;
    -webkit-tap-highlight-color: transparent;
}

.btn-load-more:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-load-more:active {
    transform: translateY(0);
    opacity: 0.8;
}

.remaining-count {
    font-size: 13px;
    opacity: 0.8;
    font-weight: 400;
}

/* Responsive pour très petits écrans */
@media (max-width: 360px) {
    .order-modal {
        max-height: 95vh;
    }
    
    .order-modal .modal-header {
        padding: 12px 16px;
        min-height: 48px;
    }
    
    .order-modal .modal-section {
        padding: 10px 16px;
    }
    
    .order-modal .modal-actions {
        padding: 12px 16px 16px;
    }
    
    .order-modal .summary-row {
        gap: 12px;
    }
    
    .load-more-container {
        padding: 16px;
    }
    
    .btn-load-more {
        padding: 10px 20px;
        font-size: 14px;
    }
}