/* =============================================================================
   Modli Swatches Custom - تمام استایل‌ها (دسکتاپ + موبایل)
   نسخه: 2.9.16
   ========================================================================== */

/* استایل عمومی سواچ‌ها - دسکتاپ */
.modli-swatches {
    margin: 20px 0;
    direction: rtl;
}

.modli-swatches label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 16px;
}

.modli-swatch {
    display: inline-block;
    margin: 5px;
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    min-width: 120px;
    background: #fff;
    transition: all 0.2s ease;
}

.modli-swatch:hover {
    border-color: #aaa;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.modli-swatch.selected {
    position: relative;
    z-index: 9999;
    outline: 3px solid #de3163;
    border: 2px solid #dddddd00 !important;
    outline-offset: 2px;
    border-color: #de3163 !important;
    box-shadow: 0 6px 20px rgba(222,49,99,0.25);
}

.modli-swatch img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.modli-swatch span {
    display: block;
    font-size: 14px;
    color: #333;
}

/* نمایش تصویر رنگ اصلی در بالای فرم (اختیاری) */
.modli-color-display {
    margin-top: 20px;
    text-align: center;
}

.modli-color-display img {
    max-height: 300px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* =============================================================================
   موبایل: مودال از پایین (فقط موبایل)
   ========================================================================== */

@media (max-width: 768px) {
    .modli-swatches-desktop {
        display: none !important;
    }

    .modli-swatches-mobile {
        margin: 20px 0;
    }

    /* دکمه ثابت در پایین صفحه */
    .modli-mobile-fixed-button {
        position: fixed;
        bottom: 50px;
        left: 15px;
        right: 15px;
        z-index: 99998;
        pointer-events: none;
    }

    .modli-fixed-toggle {
        pointer-events: auto;
        background: #de3163;
        color: #fff;
        padding: 12px 16px;
        border-radius: 16px;
        font-weight: bold;
        font-size: 16px;
        text-align: center;
        box-shadow: 0 8px 25px rgba(222, 49, 99, 0.4);
        cursor: pointer;
        transition: all 0.3s ease;
        backdrop-filter: blur(10px);
        border: 3px solid rgba(255,255,255,0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .modli-fixed-toggle:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 30px rgba(222, 49, 99, 0.5);
    }

    .modli-fixed-toggle .arrow {
        font-size: 20px;
    }

    /* مودال از پایین */
    .modli-bottom-modal {
        position: fixed;
        bottom: -100%;
        left: 0;
        right: 0;
        background: #fff;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -5px 30px rgba(0,0,0,0.2);
        transition: bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 99999;
        direction: rtl;
    }

    .modli-bottom-modal.open {
        bottom: 0;
    }

    .modli-modal-header {
        position: sticky;
        top: 0;
        background: #de3163;
        color: #fff;
        padding: 12px 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-radius: 20px 20px 0 0;
        z-index: 10;
    }

    .modli-modal-header h3 {
        margin: 0;
        font-size: 18px;
    }

    .modli-modal-close {
        background: none;
        border: none;
        font-size: 32px;
        color: #fff;
        cursor: pointer;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .modli-modal-body {
        padding: 16px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 14px;
    }

    .modli-bottom-modal-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.6);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        z-index: 99998;
    }

    .modli-bottom-modal-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* قفل اسکرول وقتی مودال بازه */
    body.modli-no-scroll {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }
}