/* Modern Header Styles */
.modern-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Homepage - Transparent Header with White Logo & Text */
.homepage-body .modern-header {
  background: transparent;
  backdrop-filter: none;
}

.homepage-body .modern-header .brand-logo {
  filter: brightness(0) invert(1);
}

.homepage-body .modern-header .nav-menu-item {
  color: #ffffff !important;
}

/* Diğer sayfalar - Normal renkler */
body:not(.homepage-body) .modern-header .brand-logo {
  filter: none;
}

body:not(.homepage-body) .modern-header .nav-menu-item {
  color: var(--text-primary) !important;
}

.main-nav {
  padding: 20px 10px;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.3s ease;
  height: 40px;
}

.nav-brand:hover {
  transform: scale(1.05);
}

.brand-logo {
  display: block;
  max-height: 36px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.modern-header .brand-text {
  color: var(--text-primary);
  text-shadow: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  text-decoration: none;
  color: #1a202c;
  font-weight: 600;
  font-size: 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-menu-item::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width 0.3s ease;
}

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

/* Homepage - Beyaz alt çizgi */
.homepage-body .modern-header .nav-menu-item::after {
  background: #ffffff;
}

.nav-menu-item.has-mega {
  cursor: pointer;
}

.dropdown-icon {
  transition: transform 0.3s ease;
}

.nav-menu-item.has-mega.active .dropdown-icon {
  transform: rotate(180deg);
}

/* Mobile Toggle */
.mobile-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.homepage-body .mobile-toggle span {
  background: var(--white);
}

/* === OVERLAY LAYER === */
.mega-dropdown {
  position: absolute;
  inset: 0;

  z-index: 1200;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mega-dropdown.active {
  display: block;
  opacity: 1;
}

/* === CENTERED PANEL === */
.mega-dropdown>.container {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 1100px;
  margin: 80px auto 16px;
  transform: translateY(-10px);
  transition: transform 0.25s ease;
}

.mega-dropdown.active>.container {
  transform: translateY(0);
}

.mega-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  padding: 28px;
}

.mega-sidebar {
  border-right: 1px solid var(--border-color);
  padding-right: 32px;
}

.mega-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.mega-cat-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-cat-item {
  margin-bottom: 8px;
}

.mega-cat-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: 10px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.mega-cat-item a svg {
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.3s ease;
}

.mega-cat-item:hover a,
.mega-cat-item.active a {
  color: var(--brand);
  background: rgba(96, 165, 250, 0.1);
}

.mega-cat-item:hover a svg,
.mega-cat-item.active a svg {
  opacity: 1;
  transform: translateX(0);
}

.mega-products {
  position: relative;
}

.mega-product-grid {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mega-product-grid.active {
  display: grid;
  opacity: 1;
}

/* Mobile: allow full-width panel (overlay stays) */
@media (max-width: 991px) {
  .mega-dropdown>.container {
    margin: 0;
    border-radius: 0;
    max-width: 100%;
  }

  .mega-content {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }

  .mega-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 16px;
  }
}

.mega-product-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.mega-product-card:hover {
  background: transparent;
  transform: translateY(-4px);
}

.mega-product-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  background: transparent;
}

.mega-product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mega-product-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  transition: right 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-y: auto;
}

.mobile-menu.active {
  right: 0 !important;
}

@media (min-width: 992px) {
  .mobile-menu {
    display: none !important;
  }
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.mobile-menu-title {
  font-size: 18px;
  font-weight: 700;
}

.mobile-close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-secondary);
}

.mobile-menu-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.mobile-category-section {
  margin-bottom: 24px;
}

.mobile-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 8px 20px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.mobile-menu-link {
  display: block;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  border-radius: 10px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.mobile-submenu-link {
  padding: 12px 20px 12px 32px;
  font-size: 15px;
  font-weight: 400;
}

.mobile-menu-link:hover,
.mobile-submenu-link:hover {
  background: var(--bg-secondary);
  color: var(--brand);
}

.mobile-nested-link {
  padding: 10px 20px 10px 44px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-nested-link .bullet {
  color: var(--accent);
  font-size: 18px;
  line-height: 0;
}

.mobile-nested-link:hover {
  color: var(--brand);
  background: rgba(59, 130, 246, 0.05);
}

.mobile-category-item {
  margin-bottom: 4px;
}

.mobile-subcategory-list {
  margin-bottom: 12px;
  position: relative;
}

.mobile-subcategory-list::before {
  content: '';
  position: absolute;
  left: 32px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-color);
  opacity: 0.5;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9999;
}

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

/* Desktop'ta mobil menü hiç görünmesin */
@media (min-width: 992px) {

  .mobile-menu,
  .mobile-overlay {
    display: none !important;
  }
}

/* Global yatay taşma engelleyici */
html,
body {
  overflow-x: hidden;
  position: relative;
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 991px) {
  .mega-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .mega-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 20px;
  }

  .mega-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-header .container {
    padding-left: 20px;
    padding-right: 20px;
  }
}