/**
 * تنسيقات الواجهة الأمامية للعروض
 */

.dz-product-offers {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dz-product-offers h3 {
    color: #333;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
    text-align: center;
}

/* قائمة العروض */
.dz-offers-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dz-offer-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dz-offer-item:hover {
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0,115,170,0.15);
    transform: translateY(-2px);
}

.dz-offer-item.dz-default-offer {
    background: linear-gradient(135deg, #e8f4fd 0%, #f0f8ff 100%);
    border-color: #0073aa;
    box-shadow: 0 4px 12px rgba(0,115,170,0.2);
}

.dz-offer-item.dz-selected {
    background: linear-gradient(135deg, #d4edda 0%, #e8f5e8 100%);
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40,167,69,0.2);
}

.dz-offer-item.dz-selected::before {
    content: '✓';
    position: absolute;
    top: 15px;
    right: 15px;
    background: #28a745;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

/* محتوى العرض */
.dz-offer-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.dz-offer-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dz-offer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dz-offer-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 24px;
}

.dz-offer-details {
    flex: 1;
}

.dz-offer-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.dz-offer-tag {
    background: #0073aa;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.dz-offer-pricing {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dz-offer-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.dz-price-amount {
    font-size: 24px;
    font-weight: 700;
    color: #0073aa;
}

.dz-currency {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.dz-original-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}

.dz-savings {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.dz-savings-amount {
    background: #28a745;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.dz-savings-percentage {
    background: #ffc107;
    color: #333;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.dz-offer-actions {
    flex-shrink: 0;
}

.dz-select-offer-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.dz-select-offer-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.dz-offer-item.dz-selected .dz-select-offer-btn {
    background: #28a745;
}

.dz-offer-item.dz-selected .dz-select-offer-btn:hover {
    background: #218838;
}

/* ملخص الطلب */
.dz-offer-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.dz-offer-summary h4 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    text-align: center;
}

.dz-summary-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dz-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.dz-summary-row:last-child {
    border-bottom: none;
}

.dz-summary-row.dz-total {
    font-weight: 700;
    font-size: 18px;
    color: #0073aa;
    border-top: 2px solid #0073aa;
    padding-top: 15px;
    margin-top: 10px;
}

/* تأثيرات بصرية */
.dz-offer-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.dz-offer-item:hover::before {
    left: 100%;
}

/* التجاوب */
@media (max-width: 768px) {
    .dz-product-offers {
        padding: 20px;
        margin: 20px 0;
    }
    
    .dz-offer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .dz-offer-image {
        width: 60px;
        height: 60px;
    }
    
    .dz-offer-title {
        font-size: 16px;
    }
    
    .dz-price-amount {
        font-size: 20px;
    }
    
    .dz-select-offer-btn {
        width: 100%;
        padding: 15px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .dz-product-offers {
        padding: 15px;
        margin: 15px 0;
    }
    
    .dz-offer-item {
        padding: 15px;
    }
    
    .dz-offer-image {
        width: 50px;
        height: 50px;
    }
    
    .dz-offer-title {
        font-size: 14px;
    }
    
    .dz-price-amount {
        font-size: 18px;
    }
}

/* تحسينات إضافية */
.dz-offer-item.dz-loading {
    opacity: 0.6;
    pointer-events: none;
}

.dz-offer-item.dz-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: dz-spin 1s linear infinite;
}

@keyframes dz-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* رسائل الحالة */
.dz-offer-message {
    padding: 10px 15px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
    text-align: center;
}

.dz-offer-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.dz-offer-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.dz-offer-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* تحسينات الوصولية */
.dz-offer-item:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.dz-select-offer-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* دعم RTL */
[dir="rtl"] .dz-offer-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .dz-offer-item.dz-selected::before {
    right: auto;
    left: 15px;
}

[dir="rtl"] .dz-savings {
    flex-direction: row-reverse;
}
