/**
 * WPKoda — Cart Toast & Button Styles
 */

/* ============================================
   Toast Container
   ============================================ */
#wpkoda-toast-container {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;  /* يمين على الشاشات الكبيرة */
    left: auto !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    pointer-events: none !important;
    font-family: 'Cairo', sans-serif !important;
    direction: rtl !important;
    max-width: 380px !important;
}

/* ============================================
   Toast Card
   ============================================ */
.wpkoda-toast {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    background: #fff !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.08) !important;
    border: 1px solid rgba(0,0,0,0.04) !important;
    pointer-events: auto !important;
    opacity: 0 !important;
    transform: translateX(40px) !important; /* يأتي من اليمين */
    transition: opacity 0.3s ease, transform 0.3s ease !important;
    direction: rtl !important;
    font-family: 'Cairo', sans-serif !important;
    min-width: 280px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.wpkoda-toast.wpkoda-toast-show {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.wpkoda-toast.wpkoda-toast-hide {
    opacity: 0 !important;
    transform: translateX(40px) !important; /* يخرج لليمين */
}

/* ============================================
   Toast Types
   ============================================ */
.wpkoda-toast-success {
    border-right: 4px solid #10b981 !important;
}
.wpkoda-toast-error {
    border-right: 4px solid #ef4444 !important;
}

/* ============================================
   Toast Icon
   ============================================ */
.wpkoda-toast-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 50% !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
}

.wpkoda-toast-success .wpkoda-toast-icon {
    background: #10b981 !important;
    color: #fff !important;
}
.wpkoda-toast-error .wpkoda-toast-icon {
    background: #ef4444 !important;
    color: #fff !important;
}

/* ============================================
   Toast Text
   ============================================ */
.wpkoda-toast-text {
    flex: 1 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    line-height: 1.4 !important;
}

/* ============================================
   Toast Action (View Cart)
   ============================================ */
.wpkoda-toast-action {
    background: #3b82f6 !important;
    color: #fff !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    transition: background 0.15s !important;
    line-height: 1.4 !important;
    flex-shrink: 0 !important;
    border: none !important;
    cursor: pointer !important;
    font-family: 'Cairo', sans-serif !important;
}
.wpkoda-toast-action:hover {
    background: #2563eb !important;
    color: #fff !important;
}

/* ============================================
   Toast Close
   ============================================ */
.wpkoda-toast-close {
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: 24px !important;
    height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    border-radius: 4px !important;
    transition: all 0.15s !important;
    flex-shrink: 0 !important;
}
.wpkoda-toast-close:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}

/* ============================================
   Button States (للأزرار العادية، ليس wpk-add-to-cart)
   ============================================ */
.wpkoda-loading {
    opacity: 0.85 !important;
    cursor: wait !important;
    pointer-events: none !important;
}

.wpkoda-added {
    background: #10b981 !important;
    color: #fff !important;
    border-color: #10b981 !important;
}

.wpkoda-btn-check {
    display: inline-block !important;
    margin-left: 4px !important;
    font-weight: 900 !important;
}

.wpkoda-btn-spinner {
    display: inline-block !important;
    width: 12px !important;
    height: 12px !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    border-top-color: #fff !important;
    border-radius: 50% !important;
    animation: wpkodaSpin 0.7s linear infinite !important;
    vertical-align: middle !important;
    margin-left: 6px !important;
}

@keyframes wpkodaSpin {
    to { transform: rotate(360deg); }
}

/* ============================================
   إخفاء رسائل WooCommerce الافتراضية التي قد تظهر
   ============================================ */
.woocommerce-message,
.woocommerce .woocommerce-message,
.woocommerce-notices-wrapper:empty {
    /* نُخفي فقط رسائل الإضافة للسلة — ليس رسائل الأخطاء المهمة */
}

/* إخفاء زر "عرض السلة" الذي يظهر مكان أضف للسلة (احتياط) */
.added_to_cart.wc-forward {
    display: none !important;
}

/* ============================================
   Responsive — Mobile
   ============================================ */
@media (max-width: 480px) {
    #wpkoda-toast-container {
        bottom: 16px !important;
        left: 16px !important;
        right: 16px !important;
        max-width: none !important;
    }
    .wpkoda-toast {
        min-width: 0 !important;
        padding: 12px 14px !important;
        font-size: 13px !important;
    }
    .wpkoda-toast-text {
        font-size: 13px !important;
    }
    .wpkoda-toast-action {
        padding: 5px 12px !important;
        font-size: 11px !important;
    }
}
