/* ===================================================
   MOBİL MENÜ - OFFCANVAS STYLİNG
   =================================================== */
   
/* Offcanvas temel özellikleri */
.mobile-offcanvas {
  width: 300px;
  max-width: 100vw;
  height: 100vh !important;
  position: fixed !important;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid rgba(57, 168, 224, 0.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .mobile-offcanvas {
    max-width: 400px;
  }
}

.mobile-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(57, 168, 224, 0.1);
  padding: 1rem;
  height: 70px;
}

.mobile-offcanvas .offcanvas-body {
  padding: 1rem;
  overflow-y: auto;
  height: calc(100vh - 70px) !important;
  max-height: none !important;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
}

/* Mobil menü konteyner */
.mobile-menu-container {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 100%;
  overflow-y: visible;
  flex: 1;
  width: 100%;
  position: relative;
  z-index: 10;
}

/* Mobil menü navigasyon listesi */
.mobile-nav {
  width: 100%;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
  max-height: none;
  overflow-y: visible;
  min-height: auto;
}

.mobile-nav .nav-item {
  margin: 0.5rem 0;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
  display: block !important;
  width: 100%;
}

.mobile-nav .nav-link {
  padding: 0.8rem 1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  color: #333;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.mobile-nav .nav-link i {
  color: #39A8E0;
}

.mobile-nav .nav-link:hover {
  background-color: rgba(57, 168, 224, 0.05);
  transform: translateY(-2px);
}

.mobile-nav .nav-link.active {
  background-color: rgba(57, 168, 224, 0.1);
  color: #39A8E0;
  font-weight: 700;
}

/* Özel butonlar (Fiyat, İletişim, Sepet) */
.mobile-price-btn, 
.mobile-contact-btn, 
.mobile-cart-btn {
  background: linear-gradient(45deg, rgba(253, 200, 61, 0.1), rgba(57, 168, 224, 0.05));
  border: 1px solid rgba(253, 200, 61, 0.15);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-weight: 600;
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
}

.mobile-price-btn i {
  color: #FDC83D !important;
}

.mobile-contact-btn {
  background: linear-gradient(45deg, rgba(57, 168, 224, 0.1), rgba(253, 200, 61, 0.05));
}

.mobile-cart-btn {
  position: relative;
}

.mobile-cart-count {
  position: absolute;
  top: 0;
  right: 5px;
  background-color: #FDC83D;
  color: white;
  font-size: 0.7rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobil dil seçimi grid */
.mobile-lang-selector {
  border-top: 1px solid rgba(57, 168, 224, 0.1);
  padding-top: 1.5rem;
}

.mobile-lang-title {
  color: #555;
  font-weight: 600;
  font-size: 1.1rem;
}

.mobile-lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 1rem;
}

.mobile-lang-grid-btn {
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(57, 168, 224, 0.1);
  border-radius: 8px;
  padding: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
}

.mobile-lang-grid-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  background-color: rgba(253, 200, 61, 0.05);
  color: #333;
}

.mobile-lang-grid-btn.active {
  background-color: rgba(57, 168, 224, 0.1);
  border-color: rgba(57, 168, 224, 0.2);
  font-weight: 700;
}

.mobile-lang-grid-btn.primary-lang {
  grid-column: span 1;
  background-color: rgba(253, 200, 61, 0.05);
}

.lang-flag {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-block;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-lang-name {
  font-size: 0.9rem;
}

/* Animasyon */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Offcanvas backdrop özelleştirme */
.offcanvas-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

/* Offcanvas tam ekran düzeltmeleri */
body .offcanvas.mobile-offcanvas {
  height: 100vh !important;
  max-height: 100vh !important;
  visibility: visible !important;
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
}

/* Offcanvas scroll sorunları için */
.offcanvas-body::-webkit-scrollbar {
  width: 6px;
}

.offcanvas-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.offcanvas-body::-webkit-scrollbar-thumb {
  background: rgba(57, 168, 224, 0.2);
  border-radius: 10px;
}

/* Sepet butonu PC görünümü için */
@media (min-width: 1200px) {
  .cart-btn {
    padding: 0.5rem 1.2rem !important;
    border-radius: 8px !important;
    margin-left: 10px !important;
    background: linear-gradient(45deg, rgba(253, 200, 61, 0.1), rgba(57, 168, 224, 0.05)) !important;
    border: 1px solid rgba(253, 200, 61, 0.2) !important;
    min-width: 110px !important;
    text-align: center !important;
  }
  
  .cart-text {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    display: inline-block !important;
  }
  
  .cart-btn i {
    font-size: 1rem !important;
    margin-right: 6px !important;
  }
}


/* ===========================================
   iOS ve Safari için Mobil Menü Fix'leri
   ========================================= */

/* Sayfa içi hash bağlantıları için düzeltmeler */
html:not(.menu-open) {
  scroll-behavior: smooth;
}

body:not(.menu-open) {
  position: static !important;
  overflow: auto !important;
  height: auto !important;
  touch-action: auto !important;
}

/* iOS için height düzeltmeleri */
@supports (-webkit-touch-callout: none) {
  .mobile-offcanvas {
    height: -webkit-fill-available !important;
    min-height: -webkit-fill-available !important;
    max-height: -webkit-fill-available !important;
  }
  
  .mobile-offcanvas .offcanvas-body {
    height: calc(-webkit-fill-available - 70px) !important;
    min-height: calc(-webkit-fill-available - 70px) !important;
    max-height: calc(-webkit-fill-available - 70px) !important;
  }

  .mobile-menu-container {
    min-height: calc(-webkit-fill-available - 90px);
  }
}

/* Mobile Safari için bottom nav bar düzeltmesi */
@supports (padding: max(0px)) {
  .mobile-offcanvas {
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .mobile-offcanvas .offcanvas-body {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

/* Hem Android hem iOS için Ek Düzeltmeler */
body.menu-open {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  inset: 0;
  touch-action: none;
}

/* Offcanvas'ın tam ekran kaplama düzeltmeleri */
.mobile-offcanvas.offcanvas-start.showing,
.mobile-offcanvas.offcanvas-start.show {
  width: 300px !important;
  max-width: 100% !important;
  transform: none !important;
}

/* Offcanvas body ve diğer elementlerin yükseklik düzeltmeleri */
.offcanvas-backdrop.show + .mobile-offcanvas .offcanvas-body {
  height: calc(100vh - 70px) !important;
  display: flex;
  flex-direction: column;
}

/* Overflow sorunları için düzeltmeler */
.offcanvas-body .mobile-menu-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Firefox için scroll sorunları düzeltmeleri */
@-moz-document url-prefix() {
  .offcanvas-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(57, 168, 224, 0.2) rgba(0, 0, 0, 0.05);
  }
}

/* iOS notch ve bottom bar için safe area insets */
.offcanvas.mobile-offcanvas {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
