/* =========================================
   MOMARY NUTRITION - TÜM ÜRÜN KARTLARI (LÜKS TASARIM)
   ========================================= */

/* Sadece Store Sayfası Grid Olsun, Best Sellers Flex Kalsın Diye: */
body:not(.home) .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
    max-width: 100% !important;
    overflow: hidden !important;
    padding: 0 10px !important;
}

/* Mobil Grid */
@media (max-width: 768px) {
    body:not(.home) .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}
@media (max-width: 480px) {
    body:not(.home) .woocommerce ul.products {
        grid-template-columns: 1fr !important;
    }
}

/* --------- ORTAK LÜKS KART TASARIMI (HEM HOME HEM STORE İÇİN) --------- */
.woocommerce ul.products li.product {
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    padding: 15px 15px 70px 15px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    position: relative !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12) !important;
}

/* Resim Alanı */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap {
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    height: 200px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 10px !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img:first-child {
    max-height: 200px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img:nth-child(2) {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.woocommerce ul.products li.product:hover .astra-shop-thumbnail-wrap img:nth-child(2) {
    opacity: 1 !important;
}

/* Metinler ve Fiyat */
.woocommerce ul.products li.product * {
    text-align: center !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #111 !important;
    margin-bottom: 5px !important;
}

.woocommerce ul.products li.product .price {
    color: #a87b51 !important;
    font-weight: bold !important;
    font-size: 15px !important;
    width: 100% !important;
}

/* Tam Genişlikte Siyah Buton */
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .add_to_cart_button {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 45px !important;
    background-color: #111 !important;
    color: #fff !important;
    font-size: 12px !important;
    letter-spacing: 1.5px !important;
    text-transform: uppercase !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 0 0 12px 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.woocommerce ul.products li.product .button:hover {
    background-color: #a87b51 !important;
}
/* =========================================
   SADECE MOBİLDE BAŞLIKLARI EŞİTLE VE KAYMAYI ÖNLE
   ========================================= */
@media (max-width: 768px) {
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        min-height: 55px !important; /* 3 satırlık boşluk bırakır, kaymayı engeller */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Tüm sitede o gereksiz Astra sepet ikonunu (hover) gizle */
.woocommerce ul.products li.product .ast-on-card-button { 
    display: none !important; 
}
/* =========================================
   AKILLI HİZALAMA: BAŞLIK NE KADAR UZUN OLURSA OLSUN BUTONLAR EŞİTLENİR
   ========================================= */
.woocommerce ul.products li.product .astra-shop-summary-wrap {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important; /* Kalan boşluğu doldurup alt kısmı iter */
    width: 100% !important;
}

.woocommerce ul.products li.product .price {
    margin-top: auto !important; /* Fiyatı ve butonu en alta sabitler */
}
/* Mobil Menude Dilleri Kalici Yan Yana Gosterme */
@media (max-width: 921px) {
    /* 1. Tiklanmayan ust ana bayragi gizle */
    li.menu-item-gtranslate > a.gt-current-wrapper {
        display: none !important;
    }
    
    /* 2. Altindaki asil bayraklari (Ing ve Isp) kalici olarak yan yana acik tut */
    li.menu-item-gtranslate ul.sub-menu {
        display: flex !important;
        flex-direction: row !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        position: static !important;
        box-shadow: none !important;
        background: transparent !important;
        padding-left: 20px !important;
        margin-top: 10px !important;
    }
    
    li.menu-item-gtranslate ul.sub-menu li {
        display: inline-block !important;
        margin-right: 15px !important;
    }
}
/* GTranslate bayraklarını SÜREKLİ görünür yap ve yan yana diz */
li.menu-item-gtranslate ul.sub-menu,
li.menu-item-gtranslate ul.elementor-nav-menu--dropdown {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 15px !important; /* Bayraklar arası boşluk */
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    
    /* İŞTE BURASI ÇÖZÜYOR: Üzerine gelmeden de sürekli görünmesini sağlar */
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    height: auto !important;
}

li.menu-item-gtranslate ul.sub-menu li,
li.menu-item-gtranslate ul.elementor-nav-menu--dropdown li {
    display: inline-block !important;
}

/* İngilizce yazan ana açılır menü öğesini gizle */
li.menu-item-gtranslate > a {
    display: none !important;
}

/* Mobilde ve PC'de hizalama düzeltmesi */
li.menu-item-gtranslate {
    display: flex !important;
    align-items: center !important;
}
