/* Kontrast: koyu zeminde yalnızca açık (--surface), açık zeminde yalnızca koyu (--text / --hd4-dark).
   Değişken hem barda hem panelde tanımlı: panel header'ın dışında durur. */
.hd4,
.hd4-panel {
  --hd4-dark: color-mix(in srgb, var(--primary) 72%, black);
}

/* Koyu bar: ortada logo, menü iki yana bölünmüş */
.site-header.hd4 {
  position: sticky;
  top: 0;
  z-index: 20;
  color: var(--surface);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 7%, transparent), transparent 60%),
    var(--hd4-dark);
  border-bottom: 1px solid color-mix(in srgb, var(--surface) 14%, transparent);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--text) 14%, transparent);
}
.hd4-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem;
  min-height: 5.2rem;
}
.hd4-burger { display: none; }

/* Logo */
.hd4-logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  min-width: 0;
  color: var(--surface);
  font-family: var(--font-heading);
  text-decoration: none;
  white-space: nowrap;
}
.hd4-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid color-mix(in srgb, var(--surface) 55%, transparent);
  border-radius: 50%;
  color: var(--surface);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
}
.hd4-word { display: grid; line-height: 1.1; min-width: 0; text-align: left; }
.hd4-name {
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Menü */
.hd4-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
}
.hd4 .hd4-nav > a,
.hd4 .hd4-nav .nav-drop > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.75rem;
  color: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
}
/* Koyu bar: normal, hover ve aktif durumda yazı hep açık (temel .desk-nav a.is-active kuralını ezer) */
.hd4 .hd4-nav > a:hover,
.hd4 .hd4-nav > a.is-active,
.hd4 .hd4-nav .nav-drop > a:hover,
.hd4 .hd4-nav .nav-drop > a.is-active {
  color: var(--surface);
  border-bottom-color: transparent;
}
.hd4 .hd4-nav > a.is-active,
.hd4 .hd4-nav .nav-drop > a.is-active { font-weight: 700; }
.hd4-nav > a::after,
.hd4-nav .nav-drop > a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.1rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--surface);
  transform: translateX(-50%) scale(0);
  transition: transform 0.2s ease;
}
.hd4-nav > a:hover::after,
.hd4-nav > a.is-active::after,
.hd4-nav .nav-drop > a:hover::after,
.hd4-nav .nav-drop > a.is-active::after { transform: translateX(-50%) scale(1); }
.hd4-chev { width: 0.8rem; height: 0.8rem; flex: none; transition: transform 0.2s ease; }
.hd4 .nav-drop { position: relative; display: inline-flex; }
.hd4 .nav-drop:hover .hd4-chev,
.hd4 .nav-drop:focus-within .hd4-chev { transform: rotate(180deg); }
.hd4 .nav-drop::after {
  width: 100%;
  min-width: 13rem;
  height: 1.3rem;
}
/* Açılır liste açık kart: içindeki yazı koyu */
.hd4 .nav-sub {
  top: calc(100% + 0.75rem);
  min-width: 14rem;
  padding: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 26px 50px color-mix(in srgb, var(--text) 22%, transparent);
}
.hd4 .nav-sub a {
  display: flex;
  width: 100%;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  border: 0;
  border-radius: 9px;
}
.hd4 .nav-sub a::after { content: none; }
.hd4 .nav-sub a:hover,
.hd4 .nav-sub a.is-active {
  color: var(--hd4-dark);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}

/* Sağ taraf: eylemler */
.hd4-actions { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.hd4-actions .icon { width: 1.1rem; height: 1.1rem; flex: none; color: inherit; }
.hd4-cta {
  padding: 0.7rem 1.25rem;
  white-space: nowrap;
  color: var(--hd4-dark);
  background: var(--surface);
  border-color: var(--surface);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hd4-cta:hover { background: color-mix(in srgb, var(--surface) 86%, var(--primary)); border-color: transparent; }
.hd4-call {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid color-mix(in srgb, var(--surface) 45%, transparent);
  border-radius: 50%;
  color: var(--surface);
  text-decoration: none;
}
.hd4-call:hover { background: color-mix(in srgb, var(--surface) 14%, transparent); }
.hd4 a:focus-visible,
.hd4 button:focus-visible { outline: 2px solid var(--surface); outline-offset: 3px; }

/* Mobil: alttan açılan açık renk sayfa (bottom sheet) */
.hd4-panel {
  inset: auto 0 0 0;
  max-height: 88dvh;
  background: var(--surface);
  color: var(--text);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--text) 55%, transparent);
}
.hd4-grab {
  flex: none;
  width: 2.6rem;
  height: 4px;
  margin: 0.6rem auto 0;
  border-radius: 4px;
  background: color-mix(in srgb, var(--text) 22%, transparent);
}
.hd4-panel .nav-panel-top {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  border-bottom: 0;
}
.hd4-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}
.hd4-panel .hd4-logo { justify-content: flex-start; color: var(--text); }
.hd4-panel .hd4-mark { width: 2.3rem; height: 2.3rem; font-size: 1.1rem; border-color: var(--hd4-dark); color: var(--hd4-dark); }
.hd4-panel .hd4-name { font-size: 1.12rem; }
.hd4-panel .nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-sizing: border-box;
  width: 2.6rem;
  height: 2.6rem;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--hd4-dark);
  color: var(--surface);
  line-height: 0;
  cursor: pointer;
}
.hd4-panel .nav-close:hover { background: var(--primary); }
.hd4-panel .nav-close .icon { display: block; width: 1.1rem; height: 1.1rem; margin: 0; color: var(--surface); }
.hd4-panel .nav-panel-body { padding: 0.2rem 0 0.4rem; }

/* Standart liste: sade satırlar, ince ayraç */
.hd4-panel .panel-item { border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.hd4-panel .panel-item:last-child { border-bottom: 0; }
.hd4-panel .panel-row {
  display: flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
}
.hd4-panel .panel-row::-webkit-details-marker { display: none; }
.hd4-panel .panel-row::marker { content: ""; }
.hd4-panel .panel-link {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.95rem 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  border: 0;
}
.hd4-panel .panel-text { overflow-wrap: anywhere; }
/* Aktif: açık zeminde koyu yazı + sol çizgi */
.hd4-panel .panel-link.is-active {
  color: var(--hd4-dark);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--hd4-dark);
  padding-left: 0.85rem;
}
.hd4-panel .panel-chev {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  color: var(--text);
}
.hd4-panel .panel-chev:hover { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.hd4-panel .panel-chev .hd4-chev { width: 1.05rem; height: 1.05rem; }
.hd4-panel .panel-group[open] .panel-chev .hd4-chev { transform: rotate(180deg); }
.hd4-panel .panel-sub {
  margin: 0 0 0.7rem 0.35rem;
  border-left: 2px solid var(--line);
}
.hd4-panel .panel-child {
  display: block;
  padding: 0.6rem 0 0.6rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 0;
}
.hd4-panel .panel-child i { display: none; }
.hd4-panel .panel-child.is-active {
  color: var(--hd4-dark);
  font-weight: 700;
  box-shadow: inset 2px 0 0 var(--hd4-dark);
  margin-left: -2px;
  padding-left: calc(1rem + 2px);
}
/* Alt eylemler: iki düğme yan yana */
.hd4-panel .nav-panel-foot { padding: 0.5rem 0 1.1rem; }
.hd4-panel .panel-reach {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.hd4-panel .panel-reach:has(> :only-child) { grid-template-columns: 1fr; }
.hd4-panel .panel-reach .button {
  min-width: 0;
  padding: 0.8rem 0.6rem;
  white-space: nowrap;
  border-radius: 14px;
  font-size: 0.92rem;
}
.hd4-panel .panel-reach .button span { overflow: hidden; text-overflow: ellipsis; }
.hd4-panel .panel-reach .button:not(.button-ghost) { color: var(--surface); background: var(--hd4-dark); border-color: var(--hd4-dark); }
.hd4-panel .panel-reach .button-ghost { color: var(--text); background: transparent; border-color: var(--line); }
.hd4-panel a:focus-visible,
.hd4-panel button:focus-visible,
.hd4-panel summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .hd4-panel:not([hidden]) { animation: hd4-sheet 0.28s ease both; }
}
@keyframes hd4-sheet {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 1330px) {
  .hd4-row { gap: 1.25rem; }
  .hd4-nav > a,
  .hd4-nav .nav-drop > a { padding: 0.6rem 0.55rem; font-size: 0.86rem; }
  .hd4-cta { padding: 0.65rem 1rem; }
}
/* Menü sığmıyorsa: burger solda, logo ortada, telefon sağda */
@media (max-width: 1240px) {
  .hd4-nav { display: none; }
  .hd4-row { grid-template-columns: 1fr auto 1fr; gap: 0.75rem; min-height: 4.4rem; }
  .hd4-logo { justify-content: center; }
  .hd4-actions { justify-self: end; }
  .hd4-burger {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    justify-self: start;
    width: 2.8rem;
    height: 2.8rem;
    margin-left: -0.3rem;
    padding: 0 0.7rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--surface);
    cursor: pointer;
  }
  .hd4-burger span:not(.sr) {
    display: block;
    width: 1.4rem;
    height: 2px;
    border-radius: 2px;
    background: var(--surface);
  }
  .hd4-burger span:not(.sr):nth-of-type(2) { width: 1rem; }
  .hd4-burger:hover { background: color-mix(in srgb, var(--surface) 12%, transparent); }
}
@media (max-width: 800px) {
  .hd4-actions .hd4-cta { display: none; }
  .hd4-row { min-height: 4rem; }
  .hd4-name { font-size: 1.12rem; }
  .hd4-mark { width: 2.3rem; height: 2.3rem; font-size: 1.1rem; }
  .hd4-call { width: 2.5rem; height: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hd4-nav > a::after, .hd4-nav .nav-drop > a::after, .hd4-chev { transition: none; }
}
