/* ==========================================================================
   Egolia — Özel responsive düzeltmeler + mobil alt menü
   Bu dosya layout.tsx'te EN SON yüklenir; tema CSS'lerini override eder.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) Anasayfa "promo / anti-aging" bölümü mobil düzeltmesi
   Sorun: col-lg-6 stack olunca tek görsel aşırı uzuyor, telefon kutusu
   (collnumber) görselin üstüne taşıyor, dekoratif noktalar (dots) taşma
   yaratıyordu. ≤991px'te yerleşim sadeleştirilir.
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .section-anti-aging .anti-aging-img {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
  }

  .section-anti-aging .anti-aging-img .natural-img {
    width: 100%;
    gap: 0;
    margin: 0 auto;
  }

  /* Tek görseli makul, ortalanmış bir kart yap */
  .section-anti-aging .anti-aging-img .natural-img figure {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
  }

  .section-anti-aging .anti-aging-img .natural-img figure img {
    width: 100%;
    height: auto;
    max-height: 440px;
    object-fit: cover;
    display: block;
  }

  /* Telefon kutusu artık görselin üstüne binmiyor; altına akıyor */
  .section-anti-aging .anti-aging-img .collnumber {
    position: static;
    transform: none;
    left: auto;
    top: auto;
    width: 100%;
    max-width: 420px;
    margin: -28px auto 0;
    padding: 18px 20px;
    border-radius: 12px;
    box-sizing: border-box;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: flex-start;
  }

  .section-anti-aging .anti-aging-img .collnumber i {
    margin-left: 0;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
  }

  .section-anti-aging .anti-aging-img .collnumber h4 {
    font-size: 15px;
    margin-bottom: 2px;
  }

  .section-anti-aging .anti-aging-img .collnumber a {
    font-size: 18px;
    word-break: break-word;
  }

  /* Dekoratif noktalar mobilde taşma yaratıyor, gizle */
  .section-anti-aging .anti-aging-img img.dots-1,
  .section-anti-aging .anti-aging-img img.dots-2 {
    display: none;
  }

  /* Metin sütununu görselden sonra hava ile başlat */
  .section-anti-aging .col-lg-6.ps-xl-5 {
    margin-top: 8px;
  }
}

/* --------------------------------------------------------------------------
   1b) Hero slider (.egl-hero-*) mobil yerleşimi
   Sorun: yeni React slider'da görselin boyut sınırı yoktu (eski owl
   `width:50%` kuralı .egl-hero-slide'e uymuyor) → görsel ekranı kaplıyordu.
   Noktalar da masaüstü konumunda (left:14.5%) kalıyordu.
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .hero-section {
    padding-top: 110px;
    padding-bottom: 24px;
  }

  /* Metin: ortalı ve okunaklı (tema zaten ortalıyor, pekiştiriyoruz) */
  .egl-hero-slide .hero-text {
    padding-left: 0;
    width: 100%;
    text-align: center;
    margin-bottom: 28px;
  }
  .egl-hero-slide .hero-text p {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .egl-hero-slide .hero-text .btn {
    display: inline-block;
  }

  /* Görsel: ortalanmış ve makul boyutlu (ekranı kaplamasın) */
  .egl-hero-slide .hero-img {
    justify-content: center;
    margin: 0 auto;
  }
  .egl-hero-slide .hero-img img {
    width: auto !important;
    max-width: 72%;
    max-height: 44vh;
    height: auto;
    margin: 0 auto !important;
    object-fit: contain;
  }
  /* Dekoratif arka görsel (figure) küçült, taşmasın */
  .egl-hero-slide .hero-img figure {
    width: 60%;
    max-width: 60%;
  }

  /* Noktalar: görselin altında ortalanır */
  .egl-hero-dots {
    position: static;
    left: auto;
    bottom: auto;
    justify-content: center;
    margin: 18px auto 0;
  }
  .egl-hero-dots button {
    width: 34px;
    height: 3px;
    margin-left: 8px;
  }
}

@media (max-width: 575px) {
  .egl-hero-slide .hero-img img {
    max-width: 82%;
    max-height: 40vh;
  }
}

/* --------------------------------------------------------------------------
   1c) Blog kartı (.blogthree) görsel taşması
   Sorun: <Image> üzerindeki satır içi style={{width:'auto'}} temanın
   `.blogthree img{width:100%}` kuralını eziyor → görsel doğal boyutta kalıp
   sütundan (ekranın sağından) taşıyor. Satır içi stili yalnızca !important
   geçebilir. Tüm ekranlarda görsel sütununa sığar.
   -------------------------------------------------------------------------- */
.blogthree figure {
  width: 100%;
  margin: 0;
  overflow: hidden;
}
.blogthree figure img {
  width: 100% !important;
  height: auto !important;
  display: block;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   1d) İletişim formu kartı (.content-style) taşması
   Sorun: tema `.content-style{width:90%;margin-left:auto}` + satır içi
   padding, box-sizing border-box olmadığından kart sütundan (sağdan) taşıyor.
   border-box ile padding genişliğe dahil edilir; mobilde tam genişlik +
   küçük padding.
   -------------------------------------------------------------------------- */
.content-style { box-sizing: border-box; }

@media (max-width: 991px) {
  .content-style {
    width: 100%;
    margin-left: 0;
    padding: 28px 20px !important;
  }
  /* İletişim sosyal ikon satırı form kartından önce, altına boşluk */
  .social-media.two { margin-bottom: 36px; }
  /* Harita üst boşluğunu mobilde küçült */
  .map iframe { margin-top: 40px; height: 300px; }
}

/* --------------------------------------------------------------------------
   1e) Anasayfa "Yeni Ürünler" (.section-products) kart normalizasyonu
   Sorun: görseller sabit kutuya oturmadığı için (inline width:auto) kart
   yükseklikleri farklı → grid kayıyor; "İndirimde" üçgen rozeti yazısı
   üçgene sığmayıp taşıyor. Kartları eşit yükseklik + sabit görsel kutusu
   yapıyoruz. (Sadece .section-products; diğer .products varyantları etkilenmez.)
   -------------------------------------------------------------------------- */
.section-products .row {
  align-items: stretch;
}
.section-products .products {
  width: 100%;
  height: 100%;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  box-sizing: border-box;
  overflow: hidden;
}
/* Görsel: tüm kartlarda aynı yükseklikte, ortalanmış kutu */
.section-products .products img {
  padding-left: 0 !important;
  width: 100% !important;
  height: 190px !important;
  max-height: 190px !important;
  object-fit: contain !important;
  margin: 0 auto 8px !important;
  display: block;
}
/* Başlık linki: üstteki aşırı boşluğu azalt, satır yüksekliği topla */
.section-products .products > a:not(.btn) {
  padding-top: 14px;
  padding-bottom: 8px;
  line-height: 1.35;
}
/* Fiyat ve yıldızlar kartın altına hizalansın (eşit yükseklik için) */
.section-products .products h4 {
  margin-top: auto;
}
/* "İndirimde" üçgen rozeti: yazı üçgene sığsın */
.section-products .products span {
  width: 96px;
  height: 96px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.1;
}

@media (max-width: 575px) {
  .section-products .products {
    padding: 14px 12px;
  }
  .section-products .products img {
    height: 150px !important;
    max-height: 150px !important;
  }
  .section-products .products > a:not(.btn) {
    font-size: 15px;
    padding-top: 10px;
  }
  .section-products .products h4 { font-size: 17px; }
  .section-products .products h4 del { font-size: 13px; }
  .section-products .products span {
    width: 80px;
    height: 80px;
    padding: 9px;
    font-size: 11px;
  }
}

/* --------------------------------------------------------------------------
   2) Genel küçük taşma önlemleri (mobil)
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  html, body { overflow-x: hidden; }
}

/* --------------------------------------------------------------------------
   3) Mobil alt sabit menü (.egl-bottom-nav)
   Sadece ≤991px'te görünür; üstünde gizlidir.
   -------------------------------------------------------------------------- */
.egl-bottom-nav { display: none; }

@media (max-width: 991px) {
  .egl-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: #fff;
    border-top: 1px solid #e7e3d6;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
    padding: 6px 4px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: stretch;
  }

  .egl-bn-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    font-size: 11px;
    line-height: 1.1;
    color: #6b6f66;
    text-decoration: none;
    transition: color 0.15s ease;
  }

  .egl-bn-item i {
    font-size: 19px;
    line-height: 1;
  }

  .egl-bn-item span:not(.egl-bn-icon-wrap) {
    font-weight: 600;
    letter-spacing: 0.2px;
  }

  .egl-bn-item:hover,
  .egl-bn-item.is-active {
    color: var(--egolia-primary, #394c32);
  }

  .egl-bn-item.is-active i {
    color: var(--egolia-secondary, #ae9f60);
  }

  .egl-bn-icon-wrap {
    position: relative;
    display: inline-flex;
    line-height: 1;
  }

  .egl-bn-badge {
    position: absolute;
    top: -7px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #c0392b;
    color: #fff;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
  }

  /* İçerik alt menünün altında kalmasın: gövdeye boşluk ekle.
     #progress (yukarı çık) butonunu da yukarı taşı. */
  body { padding-bottom: 62px; }
  #progress { bottom: 74px; }
}
