/* استایل کلی کانتینر */
.pym-custom-product-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px !important;
    border-radius: 15px;
    margin: 0 auto;
    direction: ltr;
    position: relative;
    gap: 10px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* چیدمان موقعیت تامنیل‌ها */
.pym-custom-product-container.pym-thumbs-right {
    flex-direction: row;
}
.pym-custom-product-container.pym-thumbs-right .pym-main-product-image-wrapper { order: 1; }
.pym-custom-product-container.pym-thumbs-right .pym-product-thumbnails { order: 2; }

.pym-custom-product-container.pym-thumbs-left {
    flex-direction: row;
}
.pym-custom-product-container.pym-thumbs-left .pym-product-thumbnails { order: 1; }
.pym-custom-product-container.pym-thumbs-left .pym-main-product-image-wrapper { order: 2; }

.pym-custom-product-container.pym-thumbs-top {
    flex-direction: column;
    justify-content: center;
}
.pym-custom-product-container.pym-thumbs-top .pym-product-thumbnails {
    order: 1;
    flex-direction: row;
}
.pym-custom-product-container.pym-thumbs-top .pym-main-product-image-wrapper { order: 2; }

.pym-custom-product-container.pym-thumbs-bottom {
    flex-direction: column;
    justify-content: center;
}
.pym-custom-product-container.pym-thumbs-bottom .pym-main-product-image-wrapper { order: 1; }
.pym-custom-product-container.pym-thumbs-bottom .pym-product-thumbnails {
    order: 2;
    flex-direction: row;
}

/* استایل تصویر اصلی */
.pym-main-product-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

.pym-gallery {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pym-main-product-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
    display: block;
}

/* استایل آیکون‌ها */
.pym-product-icons {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pym-like-wrapper,
.pym-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.pym-icon {
    width: 48px;
    height: 48px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.3s;
}

.pym-icon:hover {
    background-color: #828181;
}

.pym-icon img,
.pym-icon span {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.pym-like-icon.pym-liked {
    background-color: #ff6f61;
}

.pym-like-count {
    position: absolute;
    top: -5px;
    right: -12px;
    background: #e3200d;
    color: #fff;
    font-size: 14px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s, color 0.3s;
}

.pym-like-wrapper:hover .pym-like-count {
    background-color: #fff;
    color: #ff0000;
    border: solid 1px #828181;
}

/* استایل تولتیپ آیکون‌ها */
.pym-icon-tooltip {
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ff0000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out;
    z-index: 10;
}

.pym-like-wrapper:hover .pym-icon-tooltip,
.pym-icon-wrapper:hover .pym-icon-tooltip {
    opacity: 1;
    visibility: visible;
}

/* استایل تامنیل‌ها */
.pym-product-thumbnails {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.pym-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: border-color 0.3s;
    position: relative;
}

.pym-thumbnail.pym-active {
    border-color: #EB1111;
}

.pym-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* استایل آیکن پلی روی تامنیل ویدیو */
.pym-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: auto;
    z-index: 2;
    pointer-events: none;
    animation: pulse 1.5s infinite ease-in-out;
}

/* انیمیشن پالس */
@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
}

/* استایل پاپ‌آپ‌ها */
.pym-video-popup,
.pym-notify-popup,
.pym-share-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pym-video-popup-content,
.pym-notify-popup-content,
.pym-share-popup-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.pym-video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

.pym-video-container iframe,
.pym-video-container video {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 5px;
    display: block;
}

.pym-close-video-popup,
.pym-close-notify-popup,
.pym-close-share-popup {
    position: absolute;
    top: 6px;
    right: 7px;
    font-size: 24px;
    cursor: pointer;
    color: #fff;
    background-color: #D32F2F;
    border-radius: 100%;
    padding: 12px 6px;
    display: flex;
    align-content: center;
    align-items: center;
    height: 26px;
    width: 26px;
}

.pym-notify-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
}

.pym-notify-form input[type="email"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.pym-notify-form button {
    background: #e11;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.pym-notify-message {
    margin-top: 10px;
    color: #333;
}

.pym-share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pym-share-btn {
    padding: 10px;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: block;
}

.pym-telegram-btn {
    background-color: #0088cc;
}

.pym-telegram-btn:hover {
    background-color: #006699;
}

.pym-whatsapp-btn {
    background-color: #25d366;
}

.pym-whatsapp-btn:hover {
    background-color: #1da851;
}

.pym-copy-link-btn {
    background-color: #666;
}

.pym-copy-link-btn:hover {
    background-color: #555;
}

/* تنظیمات موبایل */
@media (max-width: 768px) {
    .pym-custom-product-container {
        flex-direction: column !important;
        align-items: center;
        justify-content: center;
        padding: 10px !important;
        width: 100%;
        height: auto;
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* در موبایل همه تامنیل‌ها افقی نمایش داده شوند */
    .pym-custom-product-container .pym-product-thumbnails {
        order: 2 !important;
        flex-direction: row !important;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }
    
    .pym-custom-product-container .pym-main-product-image-wrapper {
        order: 1 !important;
        width: 100%;
        margin: 0;
    }

    .pym-product-icons {
        position: absolute;
        top: 10px;
        left: 10px;
        flex-direction: row;
        justify-content: flex-start;
        margin-bottom: 10px;
        width: 100%;
    }

    .pym-icon {
        width: 40px;
        height: 40px;
    }

    .pym-icon img,
    .pym-icon span {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }

    .pym-main-product-image-wrapper {
        margin: 20px 0 10px 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .pym-main-product-image {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    .pym-thumbnail {
        width: 60px;
        height: 60px;
    }

    .pym-video-popup-content {
        width: 90%;
        padding: 10px;
    }

    .pym-video-container {
        max-height: 50vh;
    }

    .pym-close-video-popup,
    .pym-close-notify-popup,
    .pym-close-share-popup {
        font-size: 21px;
        padding: 8px 5px;
        height: 22px;
        width: 22px;
    }

    .pym-icon-tooltip {
        left: 50px;
    }
}

@media (max-width: 390px) {
    .pym-custom-product-container {
        width: 90vw;
        max-width: 100% !important;
        height: 90vw;
    }
}

/* تنظیم z-index برای SweetAlert2 */
.swal2-container {
    z-index: 10000 !important;
}