/**
 * استایل‌های اعتبارسنجی صفحه تسویه حساب
 *
 * @package TAV Min Max Quantity
 */

/* استایل‌های پیام خطا */
.woocommerce-error {
    border-top-color: #b20000 !important;
    background-color:  #ff4343 !important;
    color: #b20000 !important;
    font-weight: bold !important;
    padding: 1em 2em 1em 3.5em !important;
    margin: 0 0 2em !important;
    position: relative !important;
    border-top: 3px solid #b20000 !important;
    list-style: none outside !important;
    width: auto !important;
    word-wrap: break-word !important;
    box-shadow: 0 0 10px rgba(178, 0, 0, 0.3) !important;
    font-size: 14px !important;
    border-radius: 4px !important;
    z-index: 999 !important;
}

.woocommerce-error::before {
    content: "\e016" !important;
    color: inherit !important;
    font-family: WooCommerce !important;
    display: inline-block !important;
    position: absolute !important;
    top: 1em !important;
    left: 1.5em !important;
    font-size: 1.2em !important;
}

.woocommerce-error li {
    margin-bottom: 0.5em !important;
    position: relative !important;
    padding-right: 20px !important;
}

.woocommerce-error li:last-child {
    margin-bottom: 0 !important;
}

/* استایل‌های دکمه غیرفعال */
button.disabled,
button:disabled,
button[aria-disabled="true"] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    position: relative !important;
}

/* اضافه کردن خط قرمز روی دکمه غیرفعال */
button.disabled:after,
button:disabled:after,
button[aria-disabled="true"]:after {
    content: '';
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 2px solid #b20000 !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
}

/* پیام هشدار بالای دکمه سفارش */
.tav-mq-error-warning {
    color: #b20000 !important;
    font-weight: bold !important;
    margin-bottom: 15px !important;
    background-color: #fff5f5 !important;
    padding: 10px 15px !important;
    border-left: 3px solid #b20000 !important;
    border-radius: 3px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    animation: errorBlink 2s infinite !important;
}

/* استایل باکس اطلاعات منطقه */
.tav-mq-zone-info {
    background-color: #e7f5ff !important;
    border: 1px solid #2196f3 !important;
    border-radius: 4px !important;
    padding: 15px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
}

.tav-mq-zone-info h4 {
    color: #0d47a1 !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    font-size: 16px !important;
    border-bottom: 1px solid rgba(33, 150, 243, 0.3) !important;
    padding-bottom: 8px !important;
}

.tav-mq-zone-info ul {
    margin: 0 !important;
    padding-right: 20px !important;
    list-style-type: none !important;
}

.tav-mq-zone-info li {
    margin-bottom: 5px !important;
    font-size: 14px !important;
    color: #0d47a1 !important;
}

.tav-mq-zone-info strong {
    font-weight: bold !important;
    color: #1565c0 !important;
}

/* استایل هشدار تغییر آدرس */
.tav-mq-location-alert {
    background-color: #fffde7 !important;
    border: 1px solid #ffd54f !important;
    border-radius: 4px !important;
    padding: 10px 15px !important;
    margin-bottom: 15px !important;
    font-size: 14px !important;
    color: #ff6f00 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    animation: fadeInDown 0.3s !important;
}

/* افکت‌های بصری برای جلب توجه کاربر */
@keyframes errorPulse {
    0% { box-shadow: 0 0 0 0 rgba(178, 0, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(178, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(178, 0, 0, 0); }
}

@keyframes errorBlink {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -10px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.woocommerce-error {
    animation: errorPulse 1.5s infinite !important;
}

/* نمایش بهتر در حالت تسویه حساب بلوکی ووکامرس */
.wc-block-components-notice-banner.is-error {
    border-left-color: #b20000 !important;
    background-color: #fff5f5 !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left-width: 4px !important;
}

/* کلاس برای افزودن به بدنه در هنگام خطا */
body.tav-mq-has-errors .woocommerce-checkout-review-order {
    border: 2px solid #b20000 !important;
    padding: 10px !important;
    border-radius: 4px !important;
}

/* تغییر رنگ و استایل چارچوب سبد خرید در صفحه تسویه حساب در صورت وجود خطا */
body.tav-mq-has-errors .shop_table {
    border-color: #b20000 !important;
}

body.tav-mq-has-errors .shop_table th {
    background-color: #fff5f5 !important;
}

/* بهبود نمایش در موبایل */
@media (max-width: 768px) {
    .woocommerce-error {
        padding: 1em 1em 1em 3em !important;
        font-size: 13px !important;
    }
    
    .tav-mq-error-warning {
        padding: 8px 10px !important;
    }
    
    .tav-mq-zone-info {
        padding: 10px !important;
    }
    
    .tav-mq-zone-info h4 {
        font-size: 14px !important;
    }
    
    .tav-mq-zone-info li {
        font-size: 13px !important;
    }
}

/* لایه پوشاننده فرم چک‌اوت در هنگام خطا */
.tav-mq-checkout-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(178, 0, 0, 0.05) !important;
    z-index: 999 !important;
    pointer-events: all !important;
    cursor: not-allowed !important;
    animation: fadeIn 0.3s ease-in-out !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* تأکید بیشتر روی دکمه غیرفعال در صورت وجود خطا */
body.tav-mq-has-errors button#place_order {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    position: relative !important;
    border: 2px solid #b20000 !important;
    box-shadow: 0 0 8px #b20000 !important;
}

/* جلوگیری از تعامل با فرم در صورت وجود خطا */
body.tav-mq-has-errors .woocommerce-checkout-payment {
    pointer-events: none !important;
    opacity: 0.8 !important;
}

/* امکان تعامل با بخش خطا */
body.tav-mq-has-errors .woocommerce-error,
body.tav-mq-has-errors .tav-mq-error-warning,
body.tav-mq-has-errors .woocommerce-notices-wrapper {
    pointer-events: all !important;
    opacity: 1 !important;
}

/* تغییر استایل اصلی صفحه در هنگام خطا */
body.tav-mq-has-errors .checkout.woocommerce-checkout {
    border: 1px solid #b20000 !important;
    padding: 15px !important;
    border-radius: 5px !important;
    position: relative !important;
    overflow: visible !important;
}

/* استایل‌های مربوط به اعتبارسنجی تسویه حساب */

/* استایل‌های پیام‌های خطا */
.woocommerce-error {
    border-top-color: #b20000 !important;
    background-color:  #ff4343 !important;
    color: #b20000 !important;
    font-weight: bold !important;
    padding: 1em 2em 1em 3.5em !important;
    margin: 0 0 2em !important;
    position: relative !important;
    border-top: 3px solid #b20000 !important;
    list-style: none outside !important;
    width: auto !important;
    word-wrap: break-word !important;
}

.woocommerce-error::before {
    content: "\e016" !important;
    color: inherit !important;
    font-family: WooCommerce !important;
    display: inline-block !important;
    position: absolute !important;
    top: 1em !important;
    left: 1.5em !important;
}

.woocommerce-error li {
    margin-bottom: 0.5em !important;
}

.woocommerce-error li:last-child {
    margin-bottom: 0 !important;
}

/* استایل‌های دکمه غیرفعال */
button.disabled,
button:disabled,
button[aria-disabled="true"] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* پیام هشدار بالای دکمه ثبت سفارش */
.tav-mq-error-warning {
    color: #b20000 !important;
    font-weight: bold !important;
    margin-bottom: 15px !important;
    background-color: #fff5f5 !important;
    padding: 10px !important;
    border-left: 3px solid #b20000 !important;
}

/* استایل باکس اطلاعات منطقه */
.tav-mq-zone-info {
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.tav-mq-zone-info h4 {
    color: #333;
    margin-top: 0;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.tav-mq-zone-info ul {
    margin: 0;
    padding-right: 20px;
}

/* لایه پوششی روی فرم هنگام وجود خطا */
.tav-mq-checkout-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(178, 0, 0, 0.05);
    z-index: 999;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* استایل‌های برای فرم تسویه حساب هنگام وجود خطا */
.tav-mq-has-errors .woocommerce-checkout-payment {
    opacity: 0.7;
    position: relative;
}

.tav-mq-has-errors #order_review {
    border: 1px solid #ffcccc;
    padding: 15px;
    background-color: #fffafa;
}

/* استایل‌های اورلی و کانتینر */
.tav-mq-checkout-overlay-container {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
    filter: grayscale(50%);
    transition: all 0.3s ease;
}

.tav-mq-checkout-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 245, 245, 0.7);
    z-index: 100;
    display: block;
    animation: tav-mq-fade-in 0.5s forwards;
}

/* کلاس اضافه شده به بدنه در صورت وجود خطا */
body.tav-mq-checkout-has-errors .woocommerce-checkout {
    border: 2px dashed #b20000;
    padding: 20px;
    border-radius: 5px;
    background-color: rgba(255, 245, 245, 0.2);
}

/* انیمیشن‌ها */
@keyframes tav-mq-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes tav-mq-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(178, 0, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(178, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(178, 0, 0, 0);
    }
} 