/**
 * Styles de la modale de commande des favoris
 * PhotoClass Pro
 */

/* ========================================
   MODALE PRINCIPALE
   ======================================== */

.pcp-order-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcp-order-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.pcp-order-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: pcp-modal-appear 0.3s ease;
}

@keyframes pcp-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

body.pcp-order-modal-open {
    overflow: hidden;
}

/* ========================================
   HEADER
   ======================================== */

.pcp-order-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    background: #2271b1;
    border-radius: 12px 12px 0 0;
}

.pcp-order-modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcp-order-modal-header h2 svg {
    width: 24px;
    height: 24px;
}

.pcp-order-count {
    font-weight: 400;
    opacity: 0.9;
}

.pcp-order-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: #fff;
}

.pcp-order-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pcp-order-modal-close svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   BODY / LISTE DES ITEMS
   ======================================== */

.pcp-order-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 200px;
    max-height: 50vh;
}

.pcp-order-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

.pcp-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e5e5;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: pcp-spin 0.8s linear infinite;
    margin-bottom: 15px;
}

@keyframes pcp-spin {
    to { transform: rotate(360deg); }
}

.pcp-order-empty,
.pcp-order-error {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.pcp-order-error {
    color: #d63638;
}

/* ========================================
   ITEM DE COMMANDE
   ======================================== */

.pcp-order-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #e5e5e5;
    transition: box-shadow 0.2s;
}

.pcp-order-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pcp-order-item:last-child {
    margin-bottom: 0;
}

.pcp-order-item-photo {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
}

.pcp-order-item-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pcp-order-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pcp-order-item-gallery {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* ========================================
   SÉLECTEUR DE PRODUIT
   ======================================== */

.pcp-order-item-product label,
.pcp-order-item-quantity label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 4px;
    font-weight: 500;
}

.pcp-order-product-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pcp-order-product-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.pcp-order-product-select option:disabled {
    color: #999;
    font-style: italic;
}

.pcp-order-product-select optgroup {
    font-weight: 600;
    color: #333;
    padding: 5px 0;
}

/* ========================================
   QUANTITÉ
   ======================================== */

.pcp-order-item-quantity {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.pcp-order-item-quantity label {
    margin-bottom: 0;
}

.pcp-order-quantity-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.pcp-order-qty-minus,
.pcp-order-qty-plus {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcp-order-qty-minus:hover,
.pcp-order-qty-plus:hover {
    background: #2271b1;
    color: #fff;
}

.pcp-order-qty-value {
    width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

/* ========================================
   SOUS-TOTAL
   ======================================== */

.pcp-order-item-subtotal {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px dashed #ddd;
    margin-top: auto;
}

.pcp-order-subtotal-label {
    font-size: 0.85rem;
    color: #666;
}

.pcp-order-subtotal-amount {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

/* ========================================
   FOOTER
   ======================================== */

.pcp-order-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.pcp-order-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #856404;
    font-size: 0.9rem;
}

.pcp-order-warning svg {
    flex-shrink: 0;
    color: #ffc107;
}

.pcp-order-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.pcp-order-total-label {
    font-size: 1rem;
    color: #666;
}

.pcp-order-total-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.pcp-order-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.pcp-order-actions button {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcp-order-cancel {
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
}

.pcp-order-cancel:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

#pcp-order-add-to-cart {
    background: #2271b1;
    border: none;
    color: #fff;
}

#pcp-order-add-to-cart:hover:not(:disabled) {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 113, 177, 0.4);
}

#pcp-order-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#pcp-order-add-to-cart svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 600px) {
    .pcp-order-modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 10px;
    }
    
    .pcp-order-modal-header {
        padding: 15px 18px;
    }
    
    .pcp-order-modal-header h2 {
        font-size: 1.1rem;
    }
    
    .pcp-order-modal-body {
        padding: 15px;
    }
    
    .pcp-order-item {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .pcp-order-item-photo {
        width: 100%;
        height: 150px;
    }
    
    .pcp-order-modal-footer {
        padding: 15px 18px;
    }
    
    .pcp-order-actions {
        flex-direction: column;
    }
    
    .pcp-order-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   STATUT PACK DANS LA MODALE PRINCIPALE
   ======================================== */

.pcp-order-item-pack-status {
    margin-top: 10px;
    padding: 10px 15px;
    background: #f0f7ff;
    border: 1px solid #2271b1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pcp-order-item-pack-status.pcp-pack-status-warning {
    background: #fff3cd;
    border-color: #ffc107;
}

.pcp-pack-status-icon {
    font-size: 20px;
}

.pcp-pack-status-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.pcp-pack-status-text strong {
    color: #856404;
}

.pcp-pack-configure-btn {
    padding: 6px 14px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.pcp-pack-configure-btn:hover {
    background: #135e96;
}

/* ========================================
   MODALE SELECTEUR DE PACK
   ======================================== */

.pcp-pack-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcp-pack-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.pcp-pack-selector-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: pcp-modal-appear 0.3s ease;
}

.pcp-pack-selector-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    background: #2271b1;
    color: #fff;
    border-radius: 12px 12px 0 0;
    gap: 15px;
}

.pcp-pack-selector-title {
    flex: 1;
}

.pcp-pack-selector-title h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.pcp-pack-selector-title p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
	color: #fff;
}

#pcp-pack-step-indicator {
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.pcp-pack-counter {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.pcp-pack-counter.complete {
    background: #28a745;
}

.pcp-pack-selector-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pcp-pack-selector-close:hover {
    background: rgba(255,255,255,0.3);
}

.pcp-pack-selector-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: 50vh;
}

.pcp-pack-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.pcp-pack-photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    aspect-ratio: 1;
}

.pcp-pack-photo-item:hover {
    border-color: #2271b1;
    transform: scale(1.02);
}

.pcp-pack-photo-item.selected {
    border-color: #2271b1;
}

.pcp-pack-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pcp-pack-photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(34, 113, 177, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32px;
    opacity: 0;
    transition: opacity 0.2s;
}

.pcp-pack-photo-item.selected .pcp-pack-photo-overlay {
    opacity: 1;
}

.pcp-pack-photo-number {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #2271b1;
    color: #fff;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    padding: 0 6px;
}

.pcp-pack-selector-footer {
    padding: 15px 24px;
    background: #f5f5f5;
    border-top: 1px solid #e5e5e5;
    border-radius: 0 0 12px 12px;
}

.pcp-pack-selector-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

.pcp-pack-selector-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.pcp-pack-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.pcp-pack-btn-cancel {
    background: #f0f0f0;
    color: #333;
}

.pcp-pack-btn-cancel:hover {
    background: #e0e0e0;
}

.pcp-pack-btn-prev {
    background: #6c757d;
    color: #fff;
}

.pcp-pack-btn-prev:hover {
    background: #5a6268;
}

.pcp-pack-btn-next,
.pcp-pack-btn-validate {
    background: #2271b1;
    color: #fff;
}

.pcp-pack-btn-next:hover:not(:disabled),
.pcp-pack-btn-validate:hover:not(:disabled) {
    background: #135e96;
}

.pcp-pack-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   RESPONSIVE PACK SELECTOR
   ======================================== */

@media (max-width: 600px) {
    .pcp-pack-selector-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .pcp-pack-selector-header {
        flex-wrap: wrap;
        padding: 15px;
    }
    
    .pcp-pack-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }
    
    .pcp-pack-selector-actions {
        flex-wrap: wrap;
    }
    
    .pcp-pack-btn {
        flex: 1;
        min-width: 100px;
        text-align: center;
    }
}
