/**
 * Custom Styles for WoodMart Variable Product Enhancer
 * Author: Mehdi Shams (مهدی شمس)
 * Version: 1.0
 */

/* -------------------------------------------------- */
/* ۱. استایل دکمه افزودن به سبد خرید (فقط افکت‌ها) */
/* -------------------------------------------------- */

.single-product .single_add_to_cart_button,
.single-product .wc-variation-is-unavailable .single_add_to_cart_button {
    /* رنگ‌ها حذف شدند تا از استایل قالب پیروی کنند */
    transition: all 0.3s ease-in-out !important;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(100, 100, 100, 0.15); /* سایه خنثی */
}

/* افکت هاور (رفتن موس روی دکمه) */
.single-product .single_add_to_cart_button:hover {
    /* رنگ‌ها حذف شدند */
    box-shadow: 0 6px 20px rgba(100, 100, 100, 0.25);
    transform: translateY(-2px); /* افکت حرکت به بالا باقی می‌ماند */
}

/* -------------------------------------------------- */
/* ۲. مخفی کردن قیمت اولیه و نمایش با افکت */
/* -------------------------------------------------- */

/* قیمت به صورت عادی نمایش داده شود */

/* -------------------------------------------------- */
/* ۶. بج‌های وضعیت تصویر در گالری */
/* -------------------------------------------------- */

.wve-image-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    z-index: 10;
}

.wve-badge-success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.wve-badge-warning {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}

.woocommerce-product-gallery__image {
    position: relative;
}


/* -------------------------------------------------- */
/* ۳. افکت نرم برای تغییر عنوان محصول */
/* -------------------------------------------------- */

/* یک ترنزیشن نرم برای عنوان محصول که با جاوا اسکریپت تغییر می‌کند.
*/
.single-product h1.product_title {
    transition: opacity 0.3s ease-in-out;
}

/* کلاسی که جاوا اسکریپت قبل از تغییر متن اضافه و حذف می‌کند
  تا افکت fade out / fade in ایجاد شود.
*/
.single-product h1.product_title.title-swapping {
    opacity: 0;
}


/* -------------------------------------------------- */
/* ۴. استایل بهتر برای فیلدهای سفارشی در پنل مدیریت */
/* -------------------------------------------------- */

.wve-custom-fields {
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
    margin-top: 10px;
}

/* -------------------------------------------------- */
/* ۵. استایل‌های گالری در پنل مدیریت */
/* -------------------------------------------------- */

.wve-gallery-wrapper {
    margin-bottom: 15px;
}

.wve-gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    min-height: 60px;
    border: 2px dashed #ddd;
    padding: 10px;
    border-radius: 5px;
}

.wve-gallery-thumb {
    position: relative;
    width: 60px;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
}

.wve-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wve-remove-thumb {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
}

.wve-remove-thumb:hover {
    background: #c82333;
    color: white;
}

.wve-add-gallery-button {
    margin-top: 5px;
}

/* استایل برای تصاویر استفاده شده در کتابخانه رسانه */
.wve-used-image {
    opacity: 0.5;
    position: relative;
}

.wve-used-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
}

.wve-used-image .check {
    display: none !important;
}

/* -------------------------------------------------- */
/* ۷. خط افقی باحال بین ویژگیهای متغیر */
/* -------------------------------------------------- */

/* تراز عمودی لیبل و دکمهها در هر ردیف */
.variations tr {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 15px;
}

/* خط جداکننده داینامیک با border-bottom */
.variations tr:not(:last-child) .value {
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    padding-bottom: 15px;
    margin-bottom: 0;
}

/* حذف خط از آخرین ردیف */
.variations tr:last-child .value {
    border-bottom: none;
    padding-bottom: 0;
}

/* -------------------------------------------------- */
/* ۸. استایل توضیحات کوتاه سفارشی */
/* -------------------------------------------------- */

.wve-custom-description {
    margin: 10px 0 20px 0;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.03);
    border-right: 3px solid #007cba;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    display: none;
}

.wve-custom-description:empty {
    display: none !important;
}

/* -------------------------------------------------- */
/* ۹. حذف پنل/راهنمای فرانت‌اند بنا به درخواست */
/* -------------------------------------------------- */
/* در صورت وجود هرگونه المان راهنما/دیباگ در فرانت، مخفی شود */
.wve-image-badge,
.wve-custom-description,
.wve-debug-panel,
.wve-usage-guide {
    display: none !important;
}