/* Product page — main image + thumbnail gallery */

.product-image {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    position: relative;
    overflow: visible;
}

.product-image .product_img_box {
    order: 1 !important;
    width: 100%;
    margin-bottom: 0 !important;
}

.product-gallery-main-frame {
    position: relative;
    width: 100%;
}

.product-gallery-main-frame.product_img_box__media {
    position: relative;
}

.product-main-view {
    background: #fff;
    min-height: 280px;
    display: block;
    overflow: hidden;
    line-height: 0;
}

.product-main-view.is-video-mode,
.product-main-view.is-playing {
    background: #000;
}

.product-main-view #product_img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* elevateZoom — inner hover zoom */
.product_img_box .zoomWrapper {
    width: 100% !important;
    max-width: 100%;
}

.product_img_box .zoomContainer {
    width: 100% !important;
    max-width: 100% !important;
    z-index: 8 !important;
}

.product_img_box .zoomContainer .zoomLens {
    cursor: crosshair;
}

.product_img_box .zoomContainer .zoomWindowContainer,
.product_img_box .zoomContainer .zoomWindow {
    z-index: 9;
}

/* Thumbnail strip + side arrows */
.product-gallery-thumbs-wrap {
    order: 2 !important;
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0;
    margin: 0;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
}

.product-image #pr_item_gallery {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    width: auto !important;
    margin: 0;
    padding: 0 !important;
    order: unset;
}

.product-gallery-thumb-nav {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    float: none !important;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border: 1px solid #d4af37;
    border-radius: 50%;
    background: #fff;
    color: #b8860b;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    z-index: 5;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.product-gallery-thumb-nav i {
    font-size: 14px;
    line-height: 1;
}

.product-gallery-thumb-nav:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.32);
    background: var(--color-1st, #fd6a00);
    color: #fff;
    border-color: var(--color-1st, #fd6a00);
}

/* Hide slick built-in arrows — they overlap thumbnails */
.product-image .slick-prev,
.product-image .slick-next,
.product-image .slick-arrow,
.product-gallery-thumbs-wrap .slick-prev,
.product-gallery-thumbs-wrap .slick-next {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Thumbnail strip items */
.product-image #pr_item_gallery .item {
    padding: 0 4px;
}

.product-image #pr_item_gallery button.product_gallery_item,
.product-image #pr_item_gallery button.product_gallery_video_item {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    padding: 4px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.product-image #pr_item_gallery button.product_gallery_item.active,
.product-image #pr_item_gallery button.product_gallery_video_item.active {
    border-color: var(--color-1st, #fd6a00);
    box-shadow: 0 0 0 1px var(--color-1st, #fd6a00);
}

.product-image #pr_item_gallery button.product_gallery_item img,
.product-image #pr_item_gallery button.product_gallery_video_item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

html.ahlmall-dark-mode .product-main-view:not(.is-video-mode):not(.is-playing) {
    background: #fff;
}

html.ahlmall-dark-mode .product-image #pr_item_gallery button.product_gallery_item,
html.ahlmall-dark-mode .product-image #pr_item_gallery button.product_gallery_video_item {
    background: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

html.ahlmall-dark-mode .product-gallery-thumb-nav {
    background: var(--ahlmall-dm-nav-btn-bg, #1a1a1a);
    border: 2px solid var(--ahlmall-dm-nav-btn-border, #c9a227);
    color: var(--ahlmall-dm-nav-btn-icon, #d4af37);
}

@media (max-width: 767px) {
    .product-main-view {
        min-height: 220px;
    }

    .product-gallery-thumbs-wrap {
        gap: 6px;
    }

    .product-gallery-thumb-nav {
        flex: 0 0 32px;
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .product-gallery-thumb-nav i {
        font-size: 12px;
    }
}
