/* ============================================
   کانتینر اصلی پیام‌ها
   ============================================ */
.woocommerce-notices-wrapper {
    position: fixed;
    z-index: 9999;
    width: auto;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* دسکتاپ: بالا سمت راست */
@media (min-width: 769px) {
    .woocommerce-notices-wrapper {
        top: 20px;
        right: 20px;
        max-width: 500px;
    }
}

/* موبایل: پایین صفحه */
@media (max-width: 768px) {
    .woocommerce-notices-wrapper {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 95%;
        max-width: 95%;
    }
}

/* ============================================
   استایل پیام‌ها
   ============================================ */
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-info {
    background-color: #00606c !important;
    color: #fff !important;
    padding: 10px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
    animation: slideInRightFade 0.4s ease-out !important;
    border: none !important;
    line-height: 1.6 !important;
    font-family: "ایران سنس", Sans-serif !important;
    margin: 0 !important;
    width: 100% !important;
    
    /* حذف تمام استروک‌ها و فوکوس‌ها */
    outline: none !important;
    outline-offset: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* حذف استروک در حالت فوکوس برای همه مرورگرها */
.woocommerce-notices-wrapper .woocommerce-message:focus,
.woocommerce-notices-wrapper .woocommerce-error:focus,
.woocommerce-notices-wrapper .woocommerce-info:focus,
.woocommerce-notices-wrapper .woocommerce-message:focus-visible,
.woocommerce-notices-wrapper .woocommerce-error:focus-visible,
.woocommerce-notices-wrapper .woocommerce-info:focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
}

/* موبایل */
@media (max-width: 768px) {
    .woocommerce-notices-wrapper .woocommerce-message,
    .woocommerce-notices-wrapper .woocommerce-error,
    .woocommerce-notices-wrapper .woocommerce-info {
        animation: slideUpFade 0.4s ease-out !important;
        border-radius: 12px !important;
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
}

/* ============================================
   ساختار جدید پیام
   ============================================ */
.wc-notice-structure {
    display: flex !important;
    align-items: stretch !important;
    gap: 5px !important; /* فاصله 5px بین دکمه بستن و محتوا */
    width: 100% !important;
    min-height: 50px !important;
}

/* ============================================
   بخش چپ: دکمه بستن
   ============================================ */
.wc-notice-left {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    padding-right: 0px !important;
    min-height: 100% !important;
}

/* دکمه بستن */
.wc-custom-close-btn {
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    font-size: 20px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    font-weight: 300 !important;
    flex-shrink: 0 !important;
    
    /* حذف استروک و فوکوس */
    outline: none !important;
    outline-offset: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
    box-shadow: none !important;
}

/* حذف استروک در حالت فوکوس برای دکمه */
.wc-custom-close-btn:focus,
.wc-custom-close-btn:focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
}

.wc-custom-close-btn:hover {
    background: rgba(229, 57, 53, 0.9) !important;
    color: #ffffff !important;
    transform: rotate(90deg) scale(1.1) !important;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3) !important;
}

.wc-custom-close-btn:active {
    transform: scale(0.85) !important;
}

/* موبایل: دکمه کوچکتر */
@media (max-width: 768px) {
    .wc-custom-close-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 18px !important;
    }
    
    .wc-notice-left {
        padding-right: 0px !important;
        flex: 0 0 32px !important;
    }
}

/* ============================================
   بخش راست: محتوا
   ============================================ */
.wc-notice-right {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    min-width: 0 !important;
    padding: 2px 0 !important;
}

/* متن پیام */
.wc-notice-text {
    flex: 0 0 auto !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    padding-right: 4px !important;
}

/* بخش دکمه‌های عملیاتی */
.wc-notice-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 2px !important;
}

/* ============================================
   دکمه‌های عملیاتی ووکامرس
   ============================================ */
.wc-notice-actions a.button,
.wc-notice-actions .wc-forward,
.woocommerce-message a.button,
.woocommerce-info a.button,
.woocommerce-error a.button {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    padding: 6px 16px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    white-space: nowrap !important;
    font-family: "ایران سنس", sans-serif !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: normal !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    
    /* حذف استروک و فوکوس */
    outline: none !important;
    outline-offset: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
    box-shadow: none !important;
}

.wc-notice-actions a.button:hover,
.wc-notice-actions .wc-forward:hover {
    background: #F68B1F !important;
    color: #fff !important;
    border-color: #F68B1F !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(246, 139, 31, 0.3) !important;
}

.wc-notice-actions a.button:focus,
.wc-notice-actions .wc-forward:focus,
.wc-notice-actions a.button:focus-visible,
.wc-notice-actions .wc-forward:focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
}

/* دکمه خروج */
.woocommerce-message a[href*="action=logout"],
.wc-notice-actions a[href*="action=logout"] {
    background: rgba(229, 57, 53, 0.8) !important;
    color: #fff !important;
    border-color: rgba(229, 57, 53, 0.8) !important;
}

.woocommerce-message a[href*="action=logout"]:hover,
.wc-notice-actions a[href*="action=logout"]:hover {
    background: #e53935 !important;
    border-color: #e53935 !important;
}

/* ============================================
   موبایل: تغییرات خاص
   ============================================ */
@media (max-width: 768px) {
    /* دکمه‌های عملیاتی به سمت چپ */
    .wc-notice-actions {
        justify-content: flex-start !important;
    }
    
    /* فاصله بین دکمه بستن و محتوا */
    .wc-notice-structure {
        gap: 5px !important;
    }
    
    /* کاهش فاصله داخلی */
    .wc-notice-right {
        gap: 4px !important;
        padding: 0 !important;
    }
    
    /* دکمه‌های عملیاتی کوچکتر */
    .wc-notice-actions a.button,
    .wc-notice-actions .wc-forward {
        padding: 4px 12px !important;
        font-size: 11px !important;
    }
    
    /* متن پیام */
    .wc-notice-text {
        padding-right: 2px !important;
        font-size: 12.5px !important;
    }
}

/* ============================================
   استایل خطاها
   ============================================ */
.woocommerce-error li {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    list-style: none;
    margin: 2px 0;
    padding: 0 !important;
}

.woocommerce-error li a {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    font-size: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.woocommerce-error li a:hover {
    background: #f68b1f !important;
    color: #fff !important;
    border-color: #f68b1f !important;
}

/* ============================================
   تایمر حذف خودکار
   ============================================ */
.woocommerce-message::after,
.woocommerce-error::after,
.woocommerce-info::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 208, 132, 0.7);
    width: 100%;
    animation: shrinkBar 5s linear forwards;
    border-radius: 0 0 12px 12px;
    pointer-events: none !important;
}

/* ============================================
   انیمیشن‌ها
   ============================================ */
@keyframes slideInRightFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideOutRightFade {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(50px);
    }
}

@keyframes shrinkBar {
    to {
        width: 0%;
    }
}

.slide-out {
    animation: slideOutRightFade 0.4s ease-in forwards !important;
}

/* موبایل: انیمیشن خروج به پایین */
@media (max-width: 768px) {
    @keyframes slideOutDownFade {
        from {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
        to {
            opacity: 0;
            transform: translateY(30px) scale(0.95);
        }
    }
    
    .slide-out {
        animation: slideOutDownFade 0.3s ease-in forwards !important;
    }
}

/* ============================================
   مخفی کردن آیکون‌های پیش‌فرض
   ============================================ */
.woocommerce-message::before,
.woocommerce-error::before,
.woocommerce-info::before {
    display: none !important;
}

/* ============================================
   رفع استروک در کل صفحه برای عناصر ووکامرس
   ============================================ */
.woocommerce-notices-wrapper * {
    outline: none !important;
    outline-offset: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
}

.woocommerce-notices-wrapper *:focus,
.woocommerce-notices-wrapper *:focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
}

/* برای مرورگر فایرفاکس */
.woocommerce-notices-wrapper *::-moz-focus-inner {
    border: 0 !important;
    outline: none !important;
}

/* ============================================
   استایل دکمه بستن قدیمی
   ============================================ */
.wc-close-btn {
    display: none !important;
}