/* ============================================================
   Header — Shared navigation bar
   Prefix: hd-
   Palette: Gold #F5C518 · Dark #1a1a1a · White
   ============================================================ */

.hd-header {
  --hd-h: 64px;
  --hd-bg: rgba(255,255,255,.96);
  --hd-border: #ebebeb;
  --hd-text: #1a1a1a;
  --hd-muted: #888;
  --hd-gold: #F5C518;
  --hd-gold-dark: #d4a90e;
  --hd-accent: #E53935;
  --hd-r: 10px;
  --hd-surface: #f5f5f5;
}

/* ── Base ── */
.hd-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--hd-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hd-border);
  transition: box-shadow .3s, background .3s;
}
.hd-header.hd-scrolled {
  box-shadow: 0 1px 12px rgba(0,0,0,.06);
}

/* Homepage transparent mode — bg only, text stays dark */
.hd-header.hd-transparent {
  position: fixed;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.hd-header.hd-transparent.hd-scrolled {
  background: var(--hd-bg);
  border-bottom-color: var(--hd-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.hd-inner {
  max-width: 1499px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: var(--hd-h);
  gap: 12px;
}

/* ── Brand ── */
.hd-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: auto;
}
.hd-brand-img {
  height: 34px;
  width: auto;
  display: block;
  object-fit: contain;
}
.hd-header.hd-transparent .hd-brand-img {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .28));
}
.hd-brand-fallback {
  display: flex;
  align-items: center;
  gap: 2px;
}
.hd-brand-bar {
  width: 4px;
  height: 22px;
  border-radius: 2px;
}
.hd-brand-bar.hd-b1 { background: var(--hd-gold); }
.hd-brand-bar.hd-b2 { background: var(--hd-accent); }
.hd-brand-bar.hd-b3 { background: var(--hd-gold); }
.hd-brand-name {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--hd-text);
  letter-spacing: -.02em;
  white-space: nowrap;
}

/* ── Desktop Nav ── */
.hd-nav {
  display: flex;
  align-items: center;
  gap: 0;
}
.hd-nav a {
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--hd-muted);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: color .15s, background .15s;
  white-space: nowrap;
  position: relative;
}
.hd-nav a:hover { color: var(--hd-text); background: var(--hd-surface); }
.hd-nav a.hd-active { color: var(--hd-text); font-weight: 600; }
.hd-nav a.hd-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--hd-gold);
}

/* ── Right Actions ── */
.hd-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Cart — icon-only by default */
.hd-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--hd-border);
  background: transparent;
  color: var(--hd-text);
  text-decoration: none;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.hd-cart:hover { background: var(--hd-surface); }
.hd-cart-icon { width: 18px; height: 18px; flex-shrink: 0; }
.hd-cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--hd-accent);
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  line-height: 17px;
  text-align: center;
}

/* User avatar */
.hd-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--hd-border);
  background: transparent;
  text-decoration: none;
  transition: background .15s;
  cursor: pointer;
}
.hd-user:hover { background: var(--hd-surface); }
.hd-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hd-gold);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.hd-user-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--hd-text);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Login */
.hd-login {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--hd-border);
  background: transparent;
  color: var(--hd-text);
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  cursor: pointer;
  white-space: nowrap;
}
.hd-login:hover { background: var(--hd-surface); }
.hd-login svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Admin link (visible only to admins) */
.hd-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--hd-muted);
  text-decoration: none;
  transition: color .15s, background .15s;
}
.hd-admin-link:hover { color: var(--hd-text); background: var(--hd-surface); }
.hd-admin-link svg { width: 16px; height: 16px; }

/* CTA */
.hd-cta {
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--hd-text);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.hd-cta:hover { background: #333; }

/* ── Mobile Toggle ── */
.hd-mob-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hd-border);
  border-radius: 8px;
  background: transparent;
  color: var(--hd-text);
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.hd-mob-toggle:hover { background: var(--hd-surface); }

/* ══════════════════════════════
   Mobile Overlay
   ══════════════════════════════ */
.hd-mobile {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  background: #fff;
  /* Kullan opacity+visibility: iOS Safari'de translateX(100%) sayfayı yatay kaydırır */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  transition: opacity .3s cubic-bezier(.4,0,.2,1), visibility .3s cubic-bezier(.4,0,.2,1);
}
.hd-mobile.hd-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hd-mob-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.hd-mob-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.hd-mob-brand-img { height: 30px; width: auto; object-fit: contain; }
.hd-mob-brand-name {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--hd-text);
}
.hd-mob-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  color: #666;
  cursor: pointer;
  transition: background .15s;
}
.hd-mob-close:hover { background: #eee; }

/* Mobile user info */
.hd-mob-user-info {
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hd-mob-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hd-gold);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.hd-mob-user-detail { flex: 1; min-width: 0; }
.hd-mob-user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--hd-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hd-mob-user-email {
  font-size: 12px;
  color: var(--hd-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile nav */
.hd-mob-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hd-mob-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  color: var(--hd-text);
  transition: background .15s;
}
.hd-mob-link:hover { background: var(--hd-surface); }
.hd-mob-link.hd-active { color: var(--hd-gold-dark); font-weight: 600; }
.hd-mob-link-arrow { width: 16px; height: 16px; color: #ccc; }
.hd-mob-link.hd-active .hd-mob-link-arrow { color: var(--hd-gold); }

.hd-mob-divider { height: 1px; background: #f0f0f0; margin: 6px 14px; }

/* Mobile cart link */
.hd-mob-cart-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  color: var(--hd-text);
  transition: background .15s;
}
.hd-mob-cart-link:hover { background: var(--hd-surface); }
.hd-mob-cart-icon { width: 20px; height: 20px; color: var(--hd-muted); }
.hd-mob-cart-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hd-accent);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}

/* Mobile bottom */
.hd-mob-bottom {
  padding: 14px 20px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.hd-mob-cta {
  display: block;
  width: 100%;
  padding: 13px;
  background: var(--hd-text);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.hd-mob-cta:hover { background: #333; }
.hd-mob-login {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: transparent;
  color: var(--hd-text);
  border: 1px solid var(--hd-border);
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.hd-mob-login:hover { background: var(--hd-surface); }

/* Backdrop */
.hd-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 299;
  background: rgba(0,0,0,.3);
  opacity: 0;
  transition: opacity .3s;
}
.hd-backdrop.hd-show { display: block; opacity: 1; }

/* ══════════════════════════════
   Responsive
   ══════════════════════════════ */
@media (max-width: 1100px) {
  .hd-cta { display: none; }
}
@media (max-width: 960px) {
  .hd-nav { display: none; }
  .hd-cta { display: none; }
  .hd-mob-toggle { display: flex; }
  .hd-user-name { display: none; }
  .hd-inner { padding: 0 16px; }
}
@media (max-width: 480px) {
  .hd-brand-name { font-size: 16px; }
  .hd-login span { display: none; }
  .hd-login { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; }
}

/* Fixed header spacer (homepage) */
.hd-spacer { height: var(--hd-h); }
