/* ===================================================================== */
/* === MƏHSUL ŞƏKİLLƏRİ: ÖLÇÜLƏR VƏ HİZALAMA (PRODUCT IMAGES) === */
/* ===================================================================== */

/* --- 1. ÜMUMİ MƏHSUL ŞƏKİLLƏRİ (DƏQİQ ÖLÇÜLƏR) --- */

/* 220px hündürlük qaydası - Maksimum spesifiklik ilə */
html body .woocommerce ul.products li.product .mf-product-thumbnail img,
html body .woocommerce ul.products li.product a img,
html body .woocommerce ul.products li.product img.wp-post-image,
html body .woocommerce ul.products li.product img.woocommerce-placeholder {
    width: 100% !important;
    height: 220px !important;
    max-width: 100% !important;
    max-height: 220px !important;
    object-fit: contain !important;
    background: #fff !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Konteyner (thumbnail) üçün hündürlük sabiti */
html body .woocommerce ul.products li.product .mf-product-thumbnail,
html body .woocommerce ul.products li.product .product-thumbnail,
html body .woocommerce ul.products li.product .woocommerce-product-gallery__image {
    height: 220px !important;
    max-height: 220px !important;
    overflow: hidden !important;
    position: relative !important;
}

/* 300x170px qaydası - Spesifik durumlar və səhifələr üçün */
html body .woocommerce ul.products li.product .mf-product-thumbnail img,
html body .woocommerce ul.products li.product a img,
html body .woocommerce ul.products li.product img.wp-post-image,
html body .woocommerce ul.products li.product img.woocommerce-placeholder,
html body .woocommerce-page ul.products li.product .mf-product-thumbnail img,
html body .woocommerce-page ul.products li.product a img,
html body .woocommerce-page ul.products li.product img.wp-post-image,
html body .woocommerce-page ul.products li.product img.woocommerce-placeholder {
    width: 300px !important;
    height: 170px !important;
    max-width: 100% !important;
    max-height: 170px !important;
    object-fit: contain !important;
    background: #fff !important;
    display: block !important;
    position: static !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* 300x170px Konteyner sabiti */
html body .woocommerce ul.products li.product .mf-product-thumbnail,
html body .woocommerce ul.products li.product .product-thumbnail,
html body .woocommerce ul.products li.product .woocommerce-product-gallery__image,
html body .woocommerce-page ul.products li.product .mf-product-thumbnail,
html body .woocommerce-page ul.products li.product .product-thumbnail,
html body .woocommerce-page ul.products li.product .woocommerce-product-gallery__image {
    width: 300px !important;
    height: 170px !important;
    max-width: 100% !important;
    max-height: 170px !important;
    overflow: hidden !important;
    position: relative !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* --- 2. ŞƏKİLLƏRİ MƏRKƏZDƏ SAXLAMAQ ÜÇÜN FLEX VƏ ÖLÇÜLƏR --- */

/* Məhsul kartı wrapper */
.product,
.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
}

/* Şəkil linki konteyneri - mərkəzləmə üçün */
.product>a:first-child,
.woocommerce ul.products li.product>a:first-child,
.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
    width: 300px !important;
    height: 170px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    margin: 0 auto !important;
    background: #fff !important;
    position: relative !important;
}

/* Şəkillərin özünü contain et və mərkəzlə */
.product img,
.woocommerce ul.products li.product img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- 3. AXtarış NƏTİCƏLƏRİ VƏ ARXİV SƏHİFƏSİ XÜSUSİ --- */

/* Axtarış nəticələri gridi şəkilləri */
.search-results-grid .product>a:first-child {
    width: 300px !important;
    height: 170px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f9f9f9 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.search-results-grid .product img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Arxiv səhifəsi üçün Məhsul Şəkil bloku (wrapper) */
.archive-product-page .product-card .product-image-wrapper {
    background: #ffffff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 12px !important;
    margin-bottom: 15px !important;
    position: relative !important;
    padding-top: 100% !important;
    height: 0 !important;
    overflow: visible !important;
}

/* Arxiv: Şəkil linki və hizalama */
.archive-product-page .product-card .product-image-wrapper a {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 15px;
    box-sizing: border-box !important;
}

/* Arxiv: Şəklin öz ölçüləri */
.archive-product-page .product-card .product-image-wrapper img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    position: static !important;
}

/* --- 4. ARXİV SƏHİFƏSİ: YEKUN 220PX HÜNDÜRLÜK TƏNZİMLƏNMƏSİ --- */

/* Bu qayda yalnız "Məhsullar" (Arxiv) səhifəsindəki şəkil blokuna təsir edəcək */
body.post-type-archive-product .product-card .product-image-wrapper {
    height: 220px !important;
    padding-top: 0 !important;
    position: relative !important;
}

/* Arxiv: Şəkil bloku daxilində tam mərkəzləmə */
body.post-type-archive-product .product-card .product-image-wrapper a {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 15px !important;
    box-sizing: border-box !important;
}

/* Arxiv: Şəklin final tənzimlənməsi */
body.post-type-archive-product .product-card .product-image-wrapper img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}