/* ========================================
   PRODUCT DETAIL RESPONSIVE FIX
   Fix image stretching on mobile devices
   ======================================== */

/* Desktop - giữ nguyên layout hiện tại */
.product-detail-page .big-image-holder {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    margin-bottom: 12px;
    display: block;
    border: 1px solid #e8e8e8;
    background: #f8f8f8;
}

.product-detail-page .big-image-holder img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Tablet và Mobile - Fix ảnh bị kéo dài */
@media only screen and (max-width: 991px) {
    .product-detail-page .big-image-holder {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 1 / 1; /* Tỷ lệ vuông 1:1 */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .product-detail-page .big-image-holder img {
        width: 100%;
        height: 100%;
        object-fit: contain; /* Giữ tỷ lệ ảnh, không bị kéo dài */
        object-position: center;
    }

    .product-detail-page .pd-box-left {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 20px;
    }

    .product-detail-page .pd-box-middle {
        width: 100% !important;
        margin-left: 0 !important;
    }
}

/* Mobile nhỏ - Tối ưu thêm */
@media only screen and (max-width: 767px) {
    .product-detail-page .big-image-holder {
        aspect-ratio: 1 / 1;
        max-height: 400px;
    }

    .product-detail-page .big-image-holder img {
        max-width: 100%;
        max-height: 100%;
    }

    /* Fix thumbnail gallery trên mobile */
    .product-detail-page .pd-img-gallery a {
        height: 60px !important;
        width: 60px !important;
        margin: 0 5px 5px 0 !important;
    }

    .product-detail-page .pd-img-gallery a img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* iPhone và các thiết bị nhỏ hơn */
@media only screen and (max-width: 480px) {
    .product-detail-page .big-image-holder {
        max-height: 350px;
    }

    .product-detail-page .pd-img-gallery a {
        height: 50px !important;
        width: 50px !important;
    }
}
