/* ==========================================================================
   DEMKA EMLAK - ULTRA PREMIUM NAVBAR & SIDEBAR SYSTEM
   Tamamen Yeniden Tasarlanmış - Sağdan Açılan Sidebar
   ========================================================================== */

/* --- NAVBAR ANA YAPI --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04);
}

.navbar.scrolled {
  height: 72px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  border-bottom-color: rgba(197, 160, 89, 0.25);
}

.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* --- LOGO ALANI --- */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.5px;
  text-decoration: none;
  z-index: 10001;
  position: relative;
}

.logo span {
  background: var(--color-gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- MASAÜSTÜ MENÜ (DESKTOP) --- */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
}

.nav-item {
  height: 100%;
  display: flex;
  align-items: center;
  position: relative;
}

.nav-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  transition: color 0.25s ease;
  padding: 10px 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 0;
  width: 0%;
  height: 2.5px;
  background: var(--color-gold-gradient);
  transition: width 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-radius: 2px;
}

.nav-link:hover,
.nav-item:hover .nav-link {
  color: var(--color-gold-dark);
}

.nav-link:hover::after,
.nav-item:hover .nav-link::after {
  width: 100%;
}

/* --- ÜCRETSIZ EKSPERTİZ BUTONU - PULSE ANIMASYONU --- */
.btn-accent {
  background: var(--color-gold-gradient);
  color: var(--color-primary) !important;
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 20px rgba(197, 160, 89, 0.35);
  border: none;
  white-space: nowrap;
}

/* Shine sweep animasyonu */
.btn-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  animation: expertizShine 2.8s ease-in-out infinite;
}

/* Pulse glow animasyonu */
.btn-accent::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 13px;
  background: var(--color-gold-gradient);
  z-index: -1;
  opacity: 0;
  animation: expertizPulse 2.5s ease-in-out infinite;
}

@keyframes expertizShine {
  0%   { left: -100%; opacity: 0; }
  20%  { opacity: 1; }
  60%  { left: 150%; opacity: 1; }
  100% { left: 150%; opacity: 0; }
}

@keyframes expertizPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.08); }
}

.btn-accent:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 30px rgba(197, 160, 89, 0.55);
}

/* --- MASAÜSTÜ MEGA DROPDOWN --- */
.has-mega-menu {
  position: static;
}

.mega-menu {
  position: fixed;
  top: 90px;
  left: 0;
  width: 100%;
  background: var(--color-white);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.10);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 2px solid rgba(197, 160, 89, 0.15);
  z-index: 1050;
  border-radius: 0 0 24px 24px;
}

.navbar.scrolled .mega-menu {
  top: 72px;
}

.mega-menu::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  width: 100%;
  height: 20px;
  background: transparent;
}

.has-mega-menu:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mega-menu-inner {
  display: flex;
  padding: 40px 32px;
  max-width: 1320px;
  margin: 0 auto;
  gap: 48px;
  min-height: 480px;
}

.mega-menu-categories {
  flex: 0 0 260px;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  padding-right: 24px;
}

.mega-category-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-gold);
  display: block;
}

.mega-category-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mega-category-item {
  color: var(--color-text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.mega-category-item:hover,
.mega-category-item.active {
  background-color: var(--color-primary);
  color: var(--color-white);
  transform: translateX(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.mega-category-item svg {
  transition: transform 0.25s ease;
}

.mega-category-item:hover svg,
.mega-category-item.active svg {
  color: var(--color-gold);
  transform: translateX(3px);
}

.mega-menu-previews {
  flex: 1;
}

.preview-group {
  display: none;
  width: 100%;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, auto);
  animation: menuFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.preview-group.active {
  display: grid;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: scale(0.98) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.preview-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.preview-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.10);
  border-color: var(--border-gold);
}

.preview-image {
  width: 100%;
  height: 130px;
  object-fit: cover;
}

.preview-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.preview-price {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.preview-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-meta {
  display: flex;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  padding-top: 8px;
  margin-top: auto;
}

/* ==========================================================================
   HAMBURGERİ GÖZEMLİ VE İŞLEVSEL YAP
   ========================================================================== */

/* Hamburger Button - sadece mobilde göster */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 46px;
  height: 46px;
  background: var(--color-gold-dark, #aa8c2c);
  border: 2px solid rgba(212,175,55,0.4);
  border-radius: 12px;
  cursor: pointer;
  z-index: 10001;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(212,175,55,0.25);
  transition: all 0.3s ease;
}

.hamburger:hover {
  background: var(--color-gold, #d4af37);
  box-shadow: 0 6px 20px rgba(212,175,55,0.4);
  transform: scale(1.05);
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #FFFFFF;
  border-radius: 3px;
  margin: 3px 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

/* Hamburger Active (X animasyonu) */
.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Desktop'ta sidebar-only elementleri gizle */
.sidebar-header-inner,
.sidebar-footer {
  display: none;
}

/* ==========================================================================
   SAĞDAN AÇILAN MOBİL SIDEBAR
   ========================================================================== */

/* ==========================================================================
   SAĞDAN AÇILAN MOBİL SIDEBAR (SIFIRDAN YAZILDI - BULLETPROOF)
   ========================================================================== */

/* Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999; /* BUG FIX: 9990 idi. Navbar (1000) altında olmalı ki çekmeceyi karartmasın. */
  display: none;
}
.sidebar-overlay.active {
  display: block;
}

/* Desktop Only Helper */
@media (min-width: 1025px) {
  .sidebar-header-inner, .sidebar-footer { display: none; }
}

@media (max-width: 1024px) {
  /* BUG FIX: Buzlu cam efekti (backdrop-filter) fixed elementleri hapseder! Mobilde iptal ediyoruz. */
  .navbar, .navbar.scrolled {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important; /* Transform da fixed'i hapseder */
    background: rgba(255, 255, 255, 1) !important;
  }

  .navbar .container { padding: 0 16px; }
  .logo { font-size: 1.4rem; }

  /* Hamburger - Bulletproof Absolute Positioning */
  .hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px; height: 44px;
    background: var(--color-gold-dark, #aa8c2c);
    border: 2px solid rgba(212,175,55,0.3);
    border-radius: 10px;
    position: relative;
    z-index: 100000 !important;
    cursor: pointer;
    gap: 0;
  }
  .hamburger-line {
    display: block;
    width: 20px; height: 2px;
    background-color: #FFFFFF;
    border-radius: 3px;
    margin: 3px 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
  }
  /* X animasyonu - mobilde de çalışacak şekilde override */
  .hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg) !important;
  }
  .hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0 !important;
    transform: scaleX(0) !important;
  }
  .hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg) !important;
  }

  /* Sidebar Drawer - Classic Block Layout */
  .nav-menu {
    position: fixed !important;
    top: 0 !important;
    right: -100%; /* Tamamen gizli */
    width: 320px;
    max-width: 85%;
    height: 100vh !important; /* Ekrani kaplamasi icin zorunlu */
    height: 100dvh !important;
    background: #FFFFFF !important; /* Arka planin seffaf olmamasi icin */
    z-index: 99999 !important;
    transition: right 0.3s ease;
    display: block !important;
    overflow-y: auto !important;
    padding: 0;
    margin: 0;
  }
  .nav-menu.active {
    right: 0;
    box-shadow: -10px 0 30px rgba(0,0,0,0.2);
  }

  /* Drawer Header */
  .sidebar-header-inner {
    padding: 20px 24px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fbfbfb;
  }
  .sidebar-brand { font-size: 1.25rem; font-weight: 800; color: var(--color-primary); }
  .close-sidebar-btn { background: none; border: none; font-size: 28px; color: #333; cursor: pointer; }
  
  /* Menu Items Stack */
  .nav-item {
    display: block;
    border-bottom: 1px solid #eaeaea;
    margin: 0; padding: 0;
    height: auto !important;
  }
  .nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
  }
  .nav-link::after { display: none; }
  .nav-link i { transition: transform 0.3s ease; }
  
  .has-mega-menu.mobile-expanded .nav-link i { transform: rotate(180deg); }

  /* --- MOBİL MEGA MENU (AKORDEON İPTAL - SADECE LİNKLER OLACAK) --- */
  .mega-menu { 
    display: none !important;
  }
  .has-mega-menu.mobile-expanded .mega-menu {
    display: none !important;
  }
  .has-mega-menu .nav-link i {
    display: none !important; /* Ok işaretini gizle çünkü tıklayınca linke gidecek */
  }
  
  /* İlan resimlerini mobilde gizle */
  .mega-menu-previews { display: none !important; }
  .mega-category-title { display: none !important; }
  
  .mega-menu-inner { display: block; padding: 0; min-height: auto !important; }
  .mega-menu-categories { width: 100%; border: none; padding: 0; }
  
  .mega-category-list { display: block; margin: 0; padding: 0; }
  .mega-category-item {
    display: block;
    padding: 14px 24px 14px 40px;
    font-size: 14.5px;
    color: #555;
    border-bottom: 1px solid #f1f1f1;
    font-weight: 500;
    text-decoration: none;
  }
  .mega-category-item:last-child { border-bottom: none; }
  .mega-category-item i, .mega-category-item svg { display: none; }

  /* CTA Button inside Menu */
  .nav-item .btn-accent { 
    display: block; 
    margin: 24px; 
    text-align: center;
    border-radius: 8px;
    padding: 16px;
  }
  
  /* Drawer Footer */
  .sidebar-footer {
    padding: 24px;
    background: #f9f9f9;
    margin-top: 20px;
    border-top: 1px solid #eaeaea;
  }
  .sidebar-contact-item {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
  }
}