/* Modern Header - Desktop & Mobile */
:root {
  --header-height: 80px;
  --header-bg: #ffffff;
  --header-border: #e0e0e0;
  --header-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  --primary-color: #0f5132;
  --text-primary: #333333;
  --text-secondary: #666666;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s ease;
  --transition-bounce: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Base Header */
.nav-wrapper {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--header-shadow);
  padding: 0.25rem 0.75rem;
  position: sticky;
  top: 0;
  z-index: 998;
  transition: all var(--transition-smooth);
}

.nav-wrapper .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  min-height: var(--header-height);
  flex-wrap: nowrap;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: transform var(--transition-smooth);
}

.brand:hover {
  transform: scale(1.02);
}

.brand img {
  height: 52px;
  width: auto;
  transition: transform var(--transition-smooth);
  display: block;
}

.brand img:first-child {
  height: 90px;
  width: auto;
}

.brand .logo-text {
  height: 120px;
  margin-left: 0.5rem;
}

/* Toggle defaults & overlay */
.nav-toggle {
  display: none;
  border: none;
  background: transparent;
}

body.menu-open {
  overflow: hidden;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-smooth);
  z-index: 1000;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.site-nav {
  display: none;
}

@media (min-width: 769px) {
  .site-nav {
    display: flex !important;
    align-items: center;
    gap: 2.5rem;
    margin-left: 4rem;
    flex: 1;
    white-space: nowrap;
    flex-wrap: nowrap;
  }

  .site-nav ul {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .nav-cta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
    flex-shrink: 0;
  }

  .site-nav li {
    position: relative;
  }

  .mobile-nav-extra {
    display: none;
  }

  .offcanvas-head,
  .offcanvas-meta {
    display: none;
  }

  .dropdown {
    position: relative;
  }

  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid #e0e0e0;
    margin-top: 0.5rem;
    display: block !important;
    transform: translateY(-10px);
    transition: all var(--transition-smooth);
    z-index: 1000;
  }

  .dropdown-services .dropdown-menu {
    min-width: 320px;
    padding: 0.25rem 0.5rem;
  }

  .dropdown-menu li {
    width: 100%;
    display: block;
  }

  .dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
  }

  .dropdown-services .dropdown-menu li + li a {
    border-top: 1px solid rgba(28, 130, 96, 0.15);
  }

  .dropdown-menu li:last-child a {
    border-bottom: none;
  }

  .dropdown-menu a:hover {
    background: #f8f9fa;
    color: var(--primary-color);
    padding-left: 1.25rem;
  }

  .dropdown > a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
  }

  .dropdown > a::after {
    content: "▼";
    font-size: 0.6rem;
    transition: transform var(--transition-smooth);
  }

  .dropdown:hover > a::after {
    transform: rotate(180deg);
  }

  .site-nav a {
    font-weight: 500;
    display: inline-flex;
    padding-bottom: 0.2rem;
    position: relative;
    color: var(--text-primary);
    transition: color var(--transition-fast);
    align-items: center;
  }

  .site-nav a:hover {
    color: var(--primary-color);
  }

  .site-nav a.active {
    color: var(--primary-color);
  }

  .site-nav a.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.2rem;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
  }

  .phone-number {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: #10b981;
    font-weight: 600;
  }

  .quick-contact .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-smooth);
  }

  .btn-arrow {
    transition: transform var(--transition-smooth);
  }

  .quick-contact .btn:hover .btn-arrow {
    transform: translateX(2px);
  }
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-wrapper .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
  }

  .brand img {
    width: clamp(150px, 35vw, 220px);
    height: auto;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    position: relative;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    color: var(--primary-color);
  }

  .nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    margin: 5px 0;
    transition: 0.3s;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .nav-toggle::before {
    display: none;
  }

/* --- MOBİL MENÜ YENİ YAPILANMA (m-menu-*) --- */
/* AED (Advanced Environment Detection) Isolation */
@media (min-width: 992px) {
  .m-menu-overlay, 
  .m-menu-panel, 
  .nav-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    z-index: -1 !important;
  }
}

.m-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.m-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.m-menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: #ffffff;
  z-index: 999999;
  transform: translateX(-105%);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
}

.m-menu-panel.active {
  transform: translateX(0);
}

.m-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: var(--primary-color);
  color: #ffffff;
}

.m-menu-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
}

.m-menu-close {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  position: relative;
  cursor: pointer;
}

.m-menu-close span {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

.m-menu-close span:nth-child(1) { transform: rotate(45deg); }
.m-menu-close span:nth-child(2) { transform: rotate(-45deg); }

.m-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}

.m-menu-item {
  border-bottom: 1px solid #f0f0f0;
}

.m-menu-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  color: #333333;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.2s;
}

.m-menu-link.active {
  color: var(--primary-color);
  background: #f8f9fa;
}

.m-dropdown-toggle::after {
  content: '→';
  font-size: 0.9rem;
  transition: transform 0.3s;
}

.m-menu-item.active .m-dropdown-toggle::after {
  transform: rotate(90deg);
}

.m-submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #f9fafb;
  display: none;
}

.m-menu-item.active .m-submenu {
  display: block;
}

.m-submenu-link {
  display: block;
  padding: 0.9rem 1.5rem 0.9rem 2.5rem;
  color: #555555;
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}

.m-menu-footer {
  padding: 1.5rem;
  background: #ffffff;
  border-top: 1px solid #eeeeee;
}

.m-footer-phone {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  text-decoration: none;
}

.m-footer-phone span {
  font-size: 0.8rem;
  color: #888888;
  margin-bottom: 0.2rem;
}

.m-footer-phone strong {
  font-size: 1.2rem;
  color: #333333;
}

/* Masaüstünde gizle */
@media (min-width: 769px) {
  .m-menu-panel, .m-menu-overlay, .nav-toggle {
    display: none !important;
  }
}

/* --- ESKİ YAPI TEMİZLİĞİ (Gerektiği kadar) --- */
.mobile-nav-overlay, .site-nav.active {
  display: none !important;
}

  #siteNavPanel .offcanvas-head {
    display: flex !important;
    padding: 1.25rem 1.5rem !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .offcanvas-head span {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.2rem !important;
  }

  .offcanvas-close {
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
  }

  .offcanvas-close span {
    background: #ffffff !important;
    height: 2px !important;
    width: 18px !important;
  }
  
  .offcanvas-head * {
    color: #ffffff !important;
  }

  .offcanvas-meta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #f0f0f0;
  }

  .offcanvas-phone {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--text-primary);
  }

  .offcanvas-phone .eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: #7a8697;
  }

  .offcanvas-phone strong {
    font-size: 1.1rem;
    color: var(--primary-color);
  }

  .offcanvas-cta {
    width: 100%;
    text-align: center;
  }

  .nav-cta {
    display: none;
  }
}
