/* ==========================================================================
   HADIOSH — Header (with Theme Toggle)
   ========================================================================== */

.hd-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--hd-black);
  padding: var(--hd-space-2) var(--hd-space-3) 0;
}

.hd-header-wrap {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--hd-space-2);
}

.hd-header-main {
  display: flex;
  align-items: center;
  gap: var(--hd-space-3);
  padding: var(--hd-space-2) var(--hd-space-3);
  transition: padding var(--hd-transition);
}

.hd-site-header.is-scrolled .hd-header-main {
  padding: 10px var(--hd-space-3);
}
.hd-site-header.is-scrolled .hd-trust-strip {
  display: none;
}

.hd-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.hd-logo-mark { display: block; }
.hd-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.hd-logo-title {
  font-family: var(--hd-font-heading);
  font-weight: 700;
  font-size: 18px;
  color: var(--hd-text-primary);
  letter-spacing: 0.04em;
}
.hd-logo-sub {
  font-family: var(--hd-font-heading);
  font-weight: 700;
  font-size: 11px;
  color: var(--hd-gold);
  letter-spacing: 0.18em;
}

.hd-nav-main {
  display: flex;
  align-items: center;
  gap: var(--hd-space-4);
  margin-inline-start: var(--hd-space-4);
}

.hd-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--hd-font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--hd-text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--hd-transition);
}
.hd-nav-link:hover { color: var(--hd-gold); }

.hd-badge-new {
  background: var(--hd-gold);
  color: var(--hd-black);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.hd-nav-dropdown { position: relative; }
.hd-dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 180px;
  background: var(--hd-bg-card);
  border: var(--hd-border);
  border-radius: var(--hd-radius-md);
  box-shadow: var(--hd-shadow);
  padding: var(--hd-space-1);
  display: none;
  flex-direction: column;
}
.hd-nav-dropdown:hover .hd-dropdown-panel,
.hd-nav-dropdown.is-open .hd-dropdown-panel,
.hd-account-dropdown.is-open .hd-dropdown-panel { display: flex; }
.hd-dropdown-panel a {
  padding: 10px 12px;
  border-radius: var(--hd-radius-sm);
  color: var(--hd-text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: background var(--hd-transition), color var(--hd-transition);
}
.hd-dropdown-panel a:hover { background: var(--hd-graphite); color: var(--hd-text-primary); }

.hd-header-actions {
  display: flex;
  align-items: center;
  gap: var(--hd-space-2);
  margin-inline-start: auto;
}

.hd-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* width: 42px;
  height: 42px; */
  border-radius: var(--hd-radius-sm);
  border: 1px solid rgba(255, 255, 255, .1);
  background: transparent;
  color: var(--hd-text-primary) !important;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: border-color var(--hd-transition), color var(--hd-transition);
}
.hd-icon-btn svg { color: inherit; stroke: currentColor; display: block; }
.hd-icon-btn:hover,
.hd-icon-btn:hover svg { border-color: var(--hd-gold); color: var(--hd-gold) !important; }

.hd-cart-btn {
  border: none;
  background: none;
  width: auto;
  height: auto;
}
.hd-badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--hd-gold);
  color: var(--hd-black);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.hd-wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--hd-gold);
  border-radius: var(--hd-radius-sm);
  color: var(--hd-gold);
  font-family: var(--hd-font-mono);
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--hd-transition);
}
.hd-wallet-pill:hover { background: rgba(212, 175, 55, .08); }

.hd-account-dropdown { position: relative; }
.hd-account-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--hd-text-primary);
  padding: 0;
}
.hd-account-trigger img { border-radius: 50%; display: block; }
.hd-dropdown-panel--account { left: auto; right: 0; }

.hd-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--hd-radius-sm);
  color: var(--hd-text-primary);
  cursor: pointer;
}

/* ---------- Search ---------- */
.hd-search-wrap { position: relative; }
.hd-search-overlay {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  background: var(--hd-dark-gray);
  border: var(--hd-border);
  border-radius: var(--hd-radius-md);
  box-shadow: var(--hd-shadow);
  padding: var(--hd-space-2);
  display: none;
  z-index: 50;
}
.hd-search-overlay.is-open { display: block; }
.hd-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--hd-graphite);
  border: var(--hd-border);
  border-radius: var(--hd-radius-sm);
  padding: 10px 12px;
  color: var(--hd-text-muted);
}
.hd-search-form input[type="search"] {
  flex: 1;
  background: none;
  border: none;
  color: var(--hd-text-primary);
  font-size: 13px;
}
.hd-search-form input[type="search"]:focus { outline: none; }
@media (max-width: 600px) {
  .hd-search-overlay { position: fixed; top: 70px; left: var(--hd-space-2); right: var(--hd-space-2); width: auto; }
}

.hd-trust-strip {
  display: flex;
  padding: var(--hd-space-3);
}
.hd-trust-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--hd-space-3);
  border-inline-start: 1px solid var(--hd-border-color);
  color: var(--hd-gold);
}
.hd-trust-item:first-child { border-inline-start: none; padding-inline-start: 0; }
.hd-trust-item div { display: flex; flex-direction: column; }
.hd-trust-item strong {
  font-family: var(--hd-font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--hd-text-primary);
}
.hd-trust-item span {
  font-size: 12px;
  color: var(--hd-text-secondary);
}

/* ═══ Drawer ═══ */
.hd-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(360px, 88vw);
  background: var(--hd-bg-card);
  border-inline-start: var(--hd-border);
  z-index: 201;
  padding: var(--hd-space-3);
  display: flex;
  flex-direction: column;
  gap: var(--hd-space-3);
  transform: translateX(100%);
  transition: transform var(--hd-transition);
  overflow-y: auto;
}
.hd-drawer.is-open { transform: translateX(0); }

.hd-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hd-transition);
}
.hd-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.hd-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hd-drawer-top-actions { display: flex; gap: var(--hd-space-1); }

.hd-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: var(--hd-border);
  border-bottom: var(--hd-border);
  padding: var(--hd-space-2) 0;
}
.hd-drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: var(--hd-radius-sm);
  color: var(--hd-text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.03em;
}
.hd-drawer-nav a:hover { background: var(--hd-graphite); }
.hd-drawer-nav a .hd-badge-new { margin-inline-start: auto; }
.hd-drawer-nav a svg:last-child { margin-inline-start: auto; color: var(--hd-text-muted); }

.hd-drawer-quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.hd-drawer-quick-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--hd-space-2) 8px;
  border: var(--hd-border);
  border-radius: var(--hd-radius-md);
  color: var(--hd-text-secondary);
  text-decoration: none;
  text-align: center;
  font-size: 12px;
}
.hd-drawer-quick-links a strong { color: var(--hd-gold); font-family: var(--hd-font-mono); font-size: 12px; font-weight: 500; }
.hd-drawer-quick-links svg { color: var(--hd-gold); }

.hd-drawer-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--hd-space-2) 4px;
  text-decoration: none;
  color: var(--hd-text-primary);
  margin-top: auto;
  border-top: var(--hd-border);
  padding-top: var(--hd-space-3);
}
.hd-drawer-profile img { border-radius: 50%; }
.hd-drawer-profile > span { display: flex; flex-direction: column; }
.hd-drawer-profile > span span { font-size: 12px; color: var(--hd-text-secondary); font-weight: 400; }
.hd-drawer-profile svg:last-child { margin-inline-start: auto; color: var(--hd-text-muted); }

@media (max-width: 960px) {
  .hd-nav-main,
  .hd-account-dropdown,
  .hd-nav-dropdown,
  .hd-search-wrap,
  #hd-theme-toggle { display: none; }
  .hd-header-actions { margin-inline-start: auto; }
  .hd-wallet-pill span { display: inline; }
  .hd-mobile-toggle { display: inline-flex; }
}

@media (max-width: 600px) {
  .hd-logo-text { display: none; }
  .hd-wallet-pill { padding: 8px 12px; font-size: 12px; }
  .hd-trust-strip { flex-wrap: wrap; gap: var(--hd-space-2); }
  .hd-trust-item { flex: 1 1 45%; border-inline-start: none; padding-inline-start: 0; }
}

/* جستجوی داخل دراور موبایل */
.hd-search-form--drawer {
  margin-bottom: var(--hd-space-2);
}