/* ==========================================================================
   LAYOUT — header, açılır menüler, mobil menü, footer, sabit iletişim öğeleri
   ========================================================================== */

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  transition:
    transform .45s var(--ease-out),
    background-color .3s,
    box-shadow .3s;
}

.site-header.is-scrolled,
.site-header.has-open-menu {
  background: rgb(255 255 255 / .86);
  -webkit-backdrop-filter: saturate(1.8) blur(16px);
  backdrop-filter: saturate(1.8) blur(16px);
  box-shadow: 0 1px 0 var(--line);
}

.site-header.is-hidden { transform: translateY(-100%); }

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
}

.site-header__logo img { width: auto; height: 46px; }

.site-nav { margin-inline: auto; height: 100%; }
.site-nav__list { display: flex; align-items: center; gap: 2px; height: 100%; }
.site-nav__item { position: relative; display: flex; align-items: center; height: 100%; }
/* Mega menü header genişliğine göre konumlanır */
.site-nav__item--mega { position: static; }

.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  transition: color .2s, background-color .2s;
}
.site-nav__link:hover,
.site-nav__link[aria-expanded="true"] { color: var(--ink); background: var(--bg-alt); }
.site-nav__link[aria-current="page"] { color: var(--ink); }

.site-nav__link .i {
  width: 14px;
  height: 14px;
  stroke-width: 2.25;
  color: var(--muted);
  transition: transform .3s var(--ease-out);
}
.site-nav__link[aria-expanded="true"] .i { transform: rotate(180deg); }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}
.site-nav + .site-header__actions { margin-left: 0; }

/* ---------- Açılır menüler ---------- */
.dropdown {
  position: absolute;
  top: calc(100% - 6px);
  left: -8px;
  z-index: 5;
  min-width: 300px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s var(--ease-out), transform .3s var(--ease-out);
}
.dropdown.is-open { opacity: 1; transform: none; }

/* Fare menü ile buton arasındaki boşlukta kaybolmasın */
.dropdown::before {
  content: "";
  position: absolute;
  inset: -14px 0 auto;
  height: 14px;
}

.dropdown--mega {
  left: 50%;
  width: min(880px, calc(100vw - 2 * var(--gutter)));
  padding: 0;
  transform: translate(-50%, -6px);
  overflow: hidden;
}
.dropdown--mega.is-open { transform: translate(-50%, 0); }

.menu-links { display: grid; gap: 2px; }

.menu-link {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  transition: background-color .15s;
}
.menu-link:hover,
.menu-link:focus-visible { background: var(--bg-alt); }
.menu-link:focus-visible { outline-offset: -2px; }

.menu-link__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--navy-50);
  color: var(--navy-800);
  box-shadow: inset 0 0 0 1px var(--navy-100);
  transition: background-color .15s, color .15s;
}
.menu-link:hover .menu-link__icon { background: var(--navy-900); color: #fff; box-shadow: none; }

.menu-link__text { display: grid; gap: 2px; line-height: 1.35; }
.menu-link__text strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.menu-link__text small { font-size: 13.5px; color: var(--muted); }

/* Mega menü: solda modül ızgarası, sağda vurgu kartı */
.mega {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
}
.mega__main { padding: 20px 16px 16px; }
.mega__title {
  padding: 0 12px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.mega .menu-links { grid-template-columns: 1fr 1fr; }

.mega__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 12px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.mega__aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: var(--navy-900);
  color: #fff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.mega__aside::after {
  content: "";
  position: absolute;
  right: -80px; bottom: -80px;
  z-index: -1;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(211 20 28 / .45), transparent 70%);
}
.mega__aside .mega__title { padding: 0; color: rgb(255 255 255 / .55); }
.mega__aside strong { font-size: 1.125rem; line-height: 1.3; letter-spacing: -.02em; }
.mega__aside p { font-size: 13.5px; color: rgb(255 255 255 / .7); }
.mega__aside img {
  width: 130px;
  margin: auto auto -64px;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 20px 40px -10px rgb(0 0 0 / .6);
}
.mega__aside .link-arrow { color: #fff; border-color: rgb(255 255 255 / .3); }

/* ---------- Menü düğmesi (mobil) ---------- */
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-right: -8px;
  place-items: center;
  border-radius: 10px;
}

.menu-toggle__bars { position: relative; width: 20px; height: 10px; }
.menu-toggle__bars i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .35s var(--ease-out), top .35s var(--ease-out);
}
.menu-toggle__bars i:first-child { top: 0; }
.menu-toggle__bars i:last-child { top: calc(100% - 2px); }

.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:first-child { top: 4px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars i:last-child { top: 4px; transform: rotate(-45deg); }

@media (max-width: 1060px) {
  .site-nav,
  .site-header__actions .link-quiet { display: none; }
  .menu-toggle { display: grid; }
  .site-header__actions,
  .site-nav + .site-header__actions { gap: 8px; margin-left: auto; }
}

@media (max-width: 420px) {
  .site-header__logo img { height: 38px; }
}

/* ---------- Mobil menü ---------- */
.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 8px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .3s var(--ease-out), transform .35s var(--ease-out);
}
.mobile-menu.is-open { opacity: 1; transform: none; }

.mobile-menu__nav { display: grid; }

.mobile-menu__nav > a,
.m-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -.02em;
  cursor: pointer;
  list-style: none;
}
.m-group summary::-webkit-details-marker { display: none; }
.m-group summary .i { width: 20px; height: 20px; color: var(--muted); transition: transform .3s var(--ease-out); }
.m-group[open] summary .i { transform: rotate(180deg); }
.m-group[open] summary { border-bottom-color: transparent; }

.m-group ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}
.m-group a { display: block; padding: 8px 0; font-size: 15px; font-weight: 500; color: var(--ink-2); }

/* Bağlantılar menü açılırken sırayla gelir */
.mobile-menu__nav > * {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s var(--ease-out), transform .5s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 40ms + 60ms);
}
.mobile-menu.is-open .mobile-menu__nav > * { opacity: 1; transform: none; }

.mobile-menu__foot { display: grid; gap: 10px; }
.mobile-menu__phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 8px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted);
}

body.menu-open { overflow: hidden; }
body.menu-open .site-header { background: var(--bg); box-shadow: 0 1px 0 var(--line); transform: none; }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 72px 28px;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  font-size: 15px;
}

.site-footer__top {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 40px;
}

.site-footer__brand { display: grid; gap: 18px; align-content: start; }
.site-footer__brand img { width: auto; height: 54px; }
.site-footer__brand p { max-width: 34ch; color: var(--muted); }

.site-footer__contact { display: grid; gap: 10px; }
.site-footer__contact a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
  transition: color .2s;
}
.site-footer__contact a:hover { color: var(--red-600); }
.site-footer__contact .i {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--navy-700);
}

.site-footer__col h2 {
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}
.site-footer__col ul { display: grid; gap: 13px; }
.site-footer__col a { color: var(--muted); transition: color .2s; }
.site-footer__col a:hover { color: var(--ink); }

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.site-footer__bottom a { color: var(--ink-2); font-weight: 600; transition: color .2s; }
.site-footer__bottom a:hover { color: var(--ink); }
/* Sağ alttaki sabit WhatsApp düğmesi sosyal ikonların üstüne binmesin */
@media (min-width: 721px) { .site-footer__bottom { padding-right: 80px; } }

.socials { display: flex; gap: 8px; }
.socials a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  transition: color .2s, border-color .2s, background-color .2s;
}
.socials a:hover { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }

@media (max-width: 1060px) {
  .site-footer__top { grid-template-columns: repeat(4, 1fr); }
  .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .site-footer__top { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
}

/* ---------- WhatsApp kartı ---------- */
.wa {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  justify-items: end;
  gap: 12px;
}

.wa__fab {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1fa855;
  color: #fff;
  box-shadow: 0 2px 4px rgb(0 0 0 / .1), 0 12px 28px -8px rgb(20 120 60 / .6);
  transition: transform .3s var(--ease-spring), background-color .2s;
}
.wa__fab .i { width: 26px; height: 26px; }
.wa__fab:hover { transform: scale(1.06); }
.wa__fab[aria-expanded="true"] { background: var(--navy-900); }

.wa__card {
  width: min(340px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform-origin: bottom right;
  animation: wa-in .35s var(--ease-out);
}
@keyframes wa-in {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
}

.wa__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--navy-900);
  color: #fff;
}
.wa__head > div { display: grid; flex: 1; line-height: 1.3; }
.wa__head strong { font-size: var(--fs-sm); font-weight: 600; }
.wa__head span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: rgb(255 255 255 / .7); }
.wa__head .icon-btn { background: transparent; border-color: rgb(255 255 255 / .2); color: #fff; }

.wa__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1fa855;
}
.wa__avatar .i { width: 20px; height: 20px; }

.wa__hint { padding: 14px 16px 6px; font-size: 13px; color: var(--muted); }

.wa__options { display: grid; padding: 6px 8px 10px; }
.wa__options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 10px;
  border-radius: 10px;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background-color .15s;
}
.wa__options a::after {
  content: "→";
  color: var(--muted);
  transition: transform .2s var(--ease-out);
}
.wa__options a:hover { background: var(--navy-50); }
.wa__options a:hover::after { transform: translateX(3px); }

/* ---------- Mobil alt eylem çubuğu ---------- */
.mobile-bar { display: none; }

@media (max-width: 720px) {
  .wa { display: none; }

  .mobile-bar {
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 90;
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgb(255 255 255 / .08);
    border-radius: 16px;
    background: rgb(11 31 69 / .94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
    transform: translateY(calc(100% + 24px));
    transition: transform .45s var(--ease-out);
  }
  .mobile-bar.is-visible { transform: none; }

  .mobile-bar a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    border-radius: 11px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: #fff;
  }
  .mobile-bar a:active { background: rgb(255 255 255 / .08); }
  .mobile-bar .is-primary { background: #fff; color: var(--navy-900); }
}

/* Header'daki "Portala giriş" düğmesi */
.site-header__cta { --btn-h: 48px; padding-inline: 22px; font-size: 15.5px; border-radius: 12px; }
.site-header__cta .i { width: 18px; height: 18px; }
@media (max-width: 420px) {
  .site-header__cta { --btn-h: 42px; padding-inline: 14px; gap: 6px; font-size: 14.5px; }
}

/* Açılır menüde bulunulan sayfa */
.menu-link[aria-current="page"] { background: var(--bg-alt); }
.menu-link[aria-current="page"] .menu-link__icon { background: var(--navy-900); color: #fff; box-shadow: none; }
