/* SAFI STORE — عرض صور المنتجات كاملة بدون قص أو تشويه */

.product-image,
.details-gallery-main,
.product-image-gallery,
.main-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 70% 55% at 50% 42%, rgba(0, 243, 255, 0.07), transparent 62%),
        linear-gradient(180deg, #171922 0%, #0c0d12 100%);
}

.details-gallery-main {
    width: min(100%, min(72vh, 560px));
    margin-inline: auto;
    border-radius: var(--border-radius, 12px);
    cursor: zoom-in;
}

.product-image img,
.details-gallery-main img,
.gallery-main-image,
.main-image img,
.recs-card img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    object-position: center center;
    padding: 12px;
    transform: none !important;
    background: transparent;
}

.gallery-main-image {
    height: auto !important;
    aspect-ratio: 1 / 1;
    display: block;
}

.product-card:hover .product-image img,
.product-card:hover .gallery-main-image {
    transform: none !important;
}

.details-thumbnails img,
.gallery-thumbnail,
.thumbnail-list img {
    object-fit: contain !important;
    object-position: center;
    background: #12141c;
    padding: 4px;
}

.cart-item-image,
.cart-item-image img,
.wishlist-item img,
.wishlist-card img,
.order-product img,
.offer-product img,
.search-suggestion-thumb,
.ai-product-suggestion img {
    object-fit: contain !important;
    object-position: center;
    background: rgba(255, 255, 255, 0.04);
}

.recs-card img {
    aspect-ratio: 1 / 1;
    height: auto !important;
    padding: 10px;
}

.safi-img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 13000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(4, 6, 12, 0.88);
    cursor: zoom-out;
}

.safi-img-lightbox[hidden] { display: none !important; }

.safi-img-lightbox img {
    max-width: min(96vw, 1100px);
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.safi-img-lightbox-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

body[data-theme="light"] .product-image,
body[data-theme="light"] .details-gallery-main,
body[data-theme="light"] .product-image-gallery,
body[data-theme="light"] .main-image {
    background:
        radial-gradient(ellipse 70% 55% at 50% 42%, rgba(29, 78, 216, 0.08), transparent 62%),
        linear-gradient(180deg, #f5f7fa 0%, #e6ebf1 100%);
}

body[data-theme="light"] .details-thumbnails img,
body[data-theme="light"] .gallery-thumbnail,
body[data-theme="light"] .thumbnail-list img,
body[data-theme="light"] .cart-item-image img,
body[data-theme="light"] .search-suggestion-thumb {
    background: #eef1f5;
}

@media (max-width: 640px) {
    .product-image img,
    .details-gallery-main img,
    .gallery-main-image {
        padding: 8px;
    }
}
