/* تنسيقات قسم العروض الخاصة */
.upsell-offers {
    margin: 0 0 2rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* العنوان الرئيسي */
.upsell-offers-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
}

.upsell-offers-title i {
    color: #2563eb;
}

/* نمط البطاقات المربعة */
.upsell-offers.square-style .upsell-offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.upsell-offers.square-style .upsell-offer {
    flex-direction: column;
    min-height: 180px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.3s ease;
    padding: 0.75rem;
}

.upsell-offers.square-style .upsell-offer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.upsell-offers.square-style .upsell-offer-header {
    text-align: center;
    flex-direction: column;
    gap: 0.5rem;
}

.upsell-offers.square-style .upsell-offer-icon {
    margin: 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--offer-color, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.upsell-offers.square-style .upsell-offer-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0.5rem 0;
}

.upsell-offers.square-style .upsell-offer-description {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* نمط البطاقات الطولية */
.upsell-offers.horizontal-style .upsell-offers-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 600px;
    margin: 0 auto;
}

.upsell-offers.horizontal-style .upsell-offer {
    position: relative;
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.upsell-offers.horizontal-style .upsell-offer:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--offer-color, #2563eb);
}

.upsell-offers.horizontal-style .upsell-offer.selected {
    background: #f8fafc;
    border-color: var(--offer-color, #2563eb);
    border-width: 2px;
}

.upsell-offers.horizontal-style .upsell-offer-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--offer-color, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.upsell-offers.horizontal-style .upsell-offer-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.upsell-offers.horizontal-style .upsell-offer-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.upsell-offers.horizontal-style .upsell-offer-description {
    margin: 0;
    color: #6b7280;
    font-size: 0.85rem;
}

.upsell-offers.horizontal-style .upsell-offer-quantity {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    color: #4b5563;
    font-size: 0.85rem;
}

.upsell-offers.horizontal-style .upsell-offer-quantity i {
    color: var(--offer-color, #2563eb);
    opacity: 0.8;
}

.upsell-offers.horizontal-style .upsell-offer-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.upsell-offers.horizontal-style .upsell-offer-price {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
}

.upsell-offers.horizontal-style .upsell-offer-unit {
    font-size: 0.8rem;
    font-weight: normal;
    color: #6b7280;
}

.upsell-offers.horizontal-style .upsell-offer-savings {
    padding: 0.35rem 0.5rem;
    background: #f0fdf4;
    border-radius: 6px;
    color: #059669;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.upsell-offers.horizontal-style .upsell-offer-savings i {
    font-size: 0.8em;
}

/* تأثير الريبل عند النقر */
.upsell-offer {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    pointer-events: none;
}

/* تأثير التحديد */
.upsell-offer-selection {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.upsell-offer.selected .upsell-offer-selection {
    border-color: var(--offer-color, #2563eb);
    background: var(--offer-color, #2563eb);
}

.upsell-offer.selected .upsell-offer-selection::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

/* تنسيقات ملخص الطلب */
.order-summary {
    margin-top: 2rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.order-summary h3 {
    margin: 0;
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.order-summary h3:hover {
    background: #f1f5f9;
}

.order-summary h3 i {
    color: #64748b;
    transition: transform 0.3s ease;
    font-size: 0.9em;
}

.order-summary.expanded h3 i {
    transform: rotate(180deg);
}

#summaryContent {
    padding: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item span:first-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4b5563;
    font-size: 0.9rem;
}

.summary-item span:last-child {
    color: #1f2937;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    text-align: left;
    direction: ltr;
}

.summary-item i {
    color: #64748b;
    width: 16px;
    text-align: center;
}

/* عناصر خاصة في الملخص */
.summary-item.total {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 2px solid #f1f5f9;
}

.summary-item.total span:first-child {
    color: #1f2937;
    font-weight: 600;
}

.summary-item.total span:last-child {
    color: #2563eb;
    font-weight: 700;
    font-size: 1.1rem;
}

.summary-item.total-savings {
    background: #f0fdf4;
    color: #059669;
    margin: 0.5rem;
    border-radius: 8px;
}

.summary-item.total-savings i {
    color: #059669;
}

.summary-item.total-savings span:last-child {
    color: #059669;
    font-weight: 500;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 640px) {
    .upsell-offers.horizontal-style .upsell-offer {
        grid-template-columns: 40px 1fr auto;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .upsell-offers.horizontal-style .upsell-offer-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .upsell-offers.horizontal-style .upsell-offer-title {
        font-size: 0.9rem;
    }

    .upsell-offers.horizontal-style .upsell-offer-description {
        font-size: 0.8rem;
    }

    .upsell-offers.horizontal-style .upsell-offer-price {
        font-size: 0.9rem;
    }

    .upsell-offers.square-style .upsell-offers-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .upsell-offers.square-style .upsell-offer {
        min-height: 160px;
    }
}