/**
 * AI Smart Coupons - Frontend Styles
 * Version: 3.0.0
 */

/* ============================
   شارات المنتجات
============================ */

.aisc-product-badge-wrapper {
    position: relative;
    display: inline-flex;
    margin: 12px 0;
    z-index: 10;
}

.aisc-product-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    min-width: 140px;
    border-radius: 50px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInScale 0.5s ease-out;
    overflow: hidden;
}

/* تأثير اللمعان */
.aisc-product-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shine 3s infinite;
}

/* Hover Effect */
.aisc-product-badge:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 3px 10px rgba(0, 0, 0, 0.15);
}

/* شارة "جديد" */
.aisc-new-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
    animation: pulse 2s infinite;
    z-index: 2;
}

/* الأيقونة */
.aisc-badge-icon {
    font-size: 22px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: bounce 2s infinite;
}

/* النص */
.aisc-badge-text {
    font-family: 'Tajawal', 'Cairo', Arial, sans-serif;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ============================
   أنواع الشارات
============================ */

/* كوبون خصم */
.aisc-badge-coupon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* خصم الكمية */
.aisc-badge-quantity_discount {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* اشتري واحصل */
.aisc-badge-buy_x_get_y {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* فلاش سيل */
.aisc-badge-flash_sale {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* عرض موسمي */
.aisc-badge-seasonal {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

/* عرض حزمة */
.aisc-badge-bundle_deal {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.aisc-badge-bundle_deal .aisc-badge-text {
    text-shadow: none;
}

/* شحن مجاني */
.aisc-badge-free_shipping {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* ============================
   مواقع العرض
============================ */

/* صفحة المنتج المفرد */
.single-product .aisc-product-badge-wrapper {
    margin: 16px 0 24px;
}

.single-product .aisc-product-badge {
    font-size: 16px;
    padding: 12px 24px;
    min-width: 160px;
}

.single-product .aisc-badge-icon {
    font-size: 26px;
}

/* صفحة المتجر والأرشيف */
.woocommerce-loop-product__link .aisc-product-badge-wrapper {
    position: absolute;
    top: 12px;
    left: 12px;
    right: auto;
    margin: 0;
    z-index: 20;
}

body.rtl .woocommerce-loop-product__link .aisc-product-badge-wrapper {
    left: auto;
    right: 12px;
}

/* ============================
   إشعار السلة
============================ */

.aisc-cart-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.aisc-cart-notice h3 {
    margin: 0 0 15px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.aisc-offers-list {
    list-style: none;
    margin: 0 0 15px;
    padding: 0;
}

.aisc-offers-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.aisc-offers-list li:last-child {
    border-bottom: none;
}

.aisc-offers-list .offer-icon {
    font-size: 20px;
    margin-left: 10px;
}

body.rtl .aisc-offers-list .offer-icon {
    margin-left: 0;
    margin-right: 10px;
}

.aisc-offers-list .offer-text {
    flex: 1;
    font-weight: 500;
}

.aisc-offers-list .offer-amount {
    font-weight: 700;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

.aisc-total-saved {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
}

.aisc-total-saved .amount {
    font-size: 24px;
    font-weight: 700;
    color: #fee140;
}

/* ============================
   Animations
============================ */

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shine {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* ============================
   Responsive Design
============================ */

@media (max-width: 768px) {
    .aisc-product-badge {
        padding: 8px 16px;
        min-width: 120px;
        font-size: 13px;
    }

    .aisc-badge-icon {
        font-size: 18px;
    }

    .aisc-new-badge {
        font-size: 10px;
        padding: 3px 8px;
        top: -6px;
        right: -6px;
    }

    .single-product .aisc-product-badge {
        font-size: 14px;
        padding: 10px 20px;
        min-width: 140px;
    }

    .single-product .aisc-badge-icon {
        font-size: 22px;
    }

    .aisc-cart-notice h3 {
        font-size: 18px;
    }

    .aisc-total-saved .amount {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .woocommerce-loop-product__link .aisc-product-badge-wrapper {
        top: 8px;
        left: 8px;
    }

    body.rtl .woocommerce-loop-product__link .aisc-product-badge-wrapper {
        right: 8px;
    }

    .aisc-product-badge {
        padding: 6px 12px;
        min-width: 100px;
        font-size: 12px;
        gap: 6px;
    }

    .aisc-badge-icon {
        font-size: 16px;
    }
}

/* ============================
   RTL Support
============================ */

body.rtl .aisc-product-badge {
    direction: rtl;
}

body.rtl .aisc-cart-notice {
    direction: rtl;
    text-align: right;
}

body.rtl .aisc-offers-list li {
    flex-direction: row-reverse;
}




/* تنسيق الخصم في السلة */
.aisc-saved {
    display: inline-block;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 5px;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.4);
    letter-spacing: 0.3px;
}

.aisc-offer-applied {
    color: #2271b1;
    font-weight: 600;
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(34, 113, 177, 0.1);
    border-radius: 6px;
}

.woocommerce-cart-form .cart_item del {
    opacity: 0.5;
    color: #999;
}

.woocommerce-cart-form .cart_item ins {
    text-decoration: none;
    color: #d63638;
    font-weight: 700;
    font-size: 1.1em;
}

/* رسالة نجاح الخصم */
.woocommerce-message {
    border-top-color: #4caf50 !important;
}

.woocommerce-message::before {
    color: #4caf50 !important;
}
