* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background-color: #ffffff;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeInPage 0.5s ease-out forwards;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Sayfa Kaydırmasını Kilitleme (Mobil Menü İçin) */
html.no-scroll,
body.no-scroll {
  overflow: hidden;
  height: 100%;
}

@keyframes fadeInPage {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* HEADER */
.site-header {
  background-color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  border-bottom: 1px solid #f1f5f9;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
}

.header-container {
  max-width: 120rem; /* Tighter threshold for better readability */
  margin: 0 auto;
  padding: 0 8vw; /* More breathing room */
  height: clamp(5rem, 5vw, 6rem); /* Reduced scaling by ~15% */
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: height 0.3s ease;
}

.logo a {
  display: flex;
  align-items: center;
}

.logo-img {
  height: clamp(2.5rem, 3vw, 3rem); /* Subtler scaling */
  width: auto;
  object-fit: contain;
}

.main-nav .nav-links {
  display: flex;
  gap: 2.5rem;
}

.main-nav .nav-links a {
  font-size: clamp(0.95rem, 1vw, 1.1rem); /* Reduced font scaling */
  font-weight: 500;
  color: #475569;
  position: relative;
  padding: 0.5rem 0;
  transition: color 0.3s ease;
}

.main-nav .nav-links a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #3b82f6;
  transition: width 0.3s ease;
}

.main-nav .nav-links a:hover,
.main-nav .nav-links a.active {
  color: #0f172a;
}

.main-nav .nav-links a:hover::after,
.main-nav .nav-links a.active::after {
  width: 100%;
}

/* MEGA MENU */
.mega-menu {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%; /* Dynamically anchor to the bottom of header */
  left: 0;
  width: 100%;
  background-color: #ffffff;
  box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.08);
  border-top: 1px solid #f1f5f9;
  z-index: 999;
  padding: 2.5rem 0;
  transform: translateY(-0.5rem);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s;
}

.dropdown:hover .mega-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.mega-menu-inner {
  max-width: 120rem;
  margin: 0 auto;
  padding: 0 8vw;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.mega-category {
  display: flex;
  flex-direction: column;
}

.mega-cat-header {
  position: relative;
  border-radius: 8px; /* Reduced from 14px */
  overflow: hidden;
  height: 130px;
  margin-bottom: 1.2rem;
  cursor: default;
}

.mega-cat-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.mega-category:hover .mega-cat-header img {
  transform: scale(1.05);
}

.mega-cat-header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.3),
    rgba(15, 23, 42, 0.7)
  );
  display: flex;
  align-items: flex-end;
  padding: 1rem 1.2rem;
}

.mega-cat-header-overlay span {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.mega-category-links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mega-category-links a {
  color: #475569 !important;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.55rem 0.8rem !important;
  border-radius: 4px; /* Reduced from 8px */
  transition: all 0.2s ease !important;
  display: block !important;
  text-align: left !important;
  border-bottom: none !important;
}

.mega-category-links a::after {
  display: none !important;
}

.mega-category-links a:hover {
  background-color: #f0f7ff;
  color: #3b82f6 !important;
  padding-left: 1.2rem !important;
}

/* HAMBURGER */
.hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
  z-index: 1001;
}

.hamburger .bar {
  width: 25px;
  height: 3px;
  background-color: #0f172a;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.toggle .bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger.toggle .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.toggle .bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* CONTENT & FOOTER */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 120rem;
  margin: 0 auto;
  padding: 2rem 8vw;
}

.site-footer {
  background-color: #0f172a;
  padding: 2rem 0;
  margin-top: auto;
}

.footer-container {
  max-width: 120rem;
  margin: 0 auto;
  padding: 0 8vw;
  text-align: center;
  color: #cbd5e1; /* Increased contrast for WCAG AA */
  font-size: 1.05rem;
  line-height: 1.6;
}

.footer-info {
  margin-bottom: 1.2rem;
}

.footer-address {
  font-style: normal;
  margin-bottom: 0.5rem;
  display: block;
}

.footer-contact {
  font-weight: 500;
  color: #f1f5f9; /* High contrast for emphasis */
}

.footer-copyright {
  font-size: 0.9rem;
  color: #cbd5e1; /* Increased contrast for WCAG AA */
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .site-header {
    overflow: visible;
  }

  .header-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
    padding: 0 1.5rem;
    position: relative;
  }

  .hamburger {
    display: flex !important;
    position: absolute !important;
    right: 1.5rem !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1010;
    cursor: pointer;
    margin: 0 !important;
  }

  .logo {
    margin-right: auto !important;
    margin-left: 0 !important;
    z-index: 1009;
    display: block !important;
  }

  .mega-menu {
    display: none !important;
  }

  .main-nav {
    position: static;
    width: auto;
  }

  .main-nav .nav-links {
    position: fixed;
    top: 4rem;
    right: -100%;
    width: 100%;
    height: calc(100vh - 4rem);
    background-color: #ffffff;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 4rem;
    gap: 3rem;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -0.25rem 0 1.25rem rgba(0, 0, 0, 0.08);
    z-index: 1001;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav .nav-links.nav-active {
    right: 0;
  }

  .main-nav .nav-links a {
    font-size: 1.4rem;
    font-weight: 600;
    display: block;
    width: 100%;
    text-align: center;
  }

  .mega-menu {
    display: none !important;
    position: static !important;
    width: 100% !important;
    box-shadow: none !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background-color: #f8fafc;
  }

  .mega-menu.mobile-active {
    display: block !important;
  }

  .mega-menu-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .mega-cat-header {
    display: block;
    height: auto;
    margin: 0;
    padding: 1.5rem 1rem 0.5rem 1rem;
    background-color: #f1f5f9;
    border-radius: 0;
  }

  .mega-cat-header img {
    display: none !important;
  }

  .mega-cat-header-overlay {
    position: static;
    background: none;
    display: block;
    text-align: center;
  }

  .mega-cat-header-overlay span {
    color: #1e293b;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .mega-category-links {
    padding: 0.5rem 0 1.5rem 0;
    background-color: #f8fafc;
  }

  .mega-category-links a {
    font-size: 1.05rem !important;
    padding: 0.7rem 2rem !important;
    text-align: center !important;
    color: #475569 !important;
  }

  .main-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .main-nav .nav-links {
    gap: 2rem;
  }
  .main-nav .nav-links a {
    font-size: 1.2rem;
  }
}

/* Language Switcher */
.lang-switcher-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  display: flex;
  align-items: center;
}

.lang-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px; /* Reduced from 50px for a sharper look */
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
  color: #0f172a;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  user-select: none;
}

.lang-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.lang-flag {
  width: 24px;
  height: auto;
  border-radius: 2px;
  display: block;
}

@media (max-width: 768px) {
  .lang-switcher-container {
    bottom: 20px; /* Positioned closer to the bottom on mobile */
    right: 20px;
  }

  .lang-btn {
    padding: 12px 20px;
    background: #ffffff !important;
    opacity: 1 !important;
  }
}
