/* header.css — Clean white header (Trendyol-like) */

body { --tbm-topbar-offset: 34px; }

.tbm-header-shell {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.tbm-header-shell .topbar {
  position: relative;
  z-index: 2;
}

.site-header {
  background: var(--white);
  border-bottom: var(--border);
  position: relative;
  top: auto;
  z-index: 1;
  transform: translateY(0);
  will-change: transform, box-shadow;
  transition: box-shadow var(--ease), transform .32s ease, background-color var(--ease);
}
.site-header.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.08); }
.site-header.header-reveal { animation: headerSlideDown .34s ease both; }
.site-header.header-compact {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}

@keyframes headerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header main row */
.header-main { padding: 10px 0; }
.site-header.header-compact .header-main { padding: 7px 0; }
.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-5);
  min-width: 0;
}

/* === LOGO === */
.site-logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
  flex-shrink: 0;
  text-decoration: none;
  gap: 2px;
}
.logo-mark {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  color: var(--black);
}
.site-header.header-compact .logo-mark { font-size: 22px; }
.logo-mark span { color: var(--primary); }
.logo-domain {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--gray-400);
  text-transform: uppercase;
}
.site-header.header-compact .logo-domain { font-size: 8px; }

/* === SEARCH === */
.header-search {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  min-width: 0;
}
.search-form {
  display: flex;
  align-items: center;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r-full);
  overflow: hidden;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-10);
  background: var(--white);
}
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px var(--sp-5);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  color: var(--black);
  outline: none;
  min-width: 0;
}
.search-input::placeholder { color: var(--gray-400); }
.search-btn {
  border: none;
  background: var(--primary);
  color: white;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--ease);
  flex-shrink: 0;
  font-size: 16px;
  border-radius: 0 var(--r-full) var(--r-full) 0;
}
.search-btn:hover { background: var(--primary-dark); }

/* Suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  z-index: 350;
  display: none;
  overflow: hidden;
}
.search-suggestions.active { display: block; }
.suggestion-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-4);
  text-decoration: none;
  color: var(--black);
  font-size: var(--text-sm);
  transition: background var(--ease);
  border-bottom: var(--border);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--gray-50); }
.suggestion-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.suggestion-text { flex: 1; }
.suggestion-text mark { background: none; color: var(--primary); font-weight: 700; }
.suggestion-cat  { font-size: var(--text-xs); color: var(--gray-400); }
.suggestion-price{ font-size: var(--text-xs); color: var(--primary); font-weight: 700; white-space: nowrap; }
.suggestion-all  {
  display: block;
  padding: 10px var(--sp-4);
  font-size: var(--text-xs);
  color: var(--primary);
  font-weight: 600;
  text-align: center;
  background: var(--primary-bg);
  text-decoration: none;
}

/* === ACTIONS === */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-shrink: 0;
  min-width: 0;
}
.action-divider {
  width: 1px;
  height: 24px;
  background: var(--gray-200);
  margin: 0 var(--sp-2);
}
.header-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--r-md);
  position: relative;
  transition: background var(--ease);
  color: var(--gray-700);
  min-width: 56px;
  min-height: 44px;
}
.header-action-btn:hover { background: var(--gray-50); color: var(--black); }
.btn-icon-img { font-size: 20px; line-height: 1; }
.action-icon { font-size: 18px; line-height: 1; }
.btn-label   { font-size: 10px; font-weight: 600; color: var(--gray-600); white-space: nowrap; }
.header-action-badge {
  position: absolute;
  top: 2px; right: 4px;
  min-width: 18px; height: 18px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  padding: 0 3px;
}

/* === NAV === */
.site-nav {
  background: var(--white);
  border-top: var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: height .26s ease;
}
.site-header.header-compact .site-nav { height: calc(var(--nav-height) - 4px); }
.nav-list {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0; padding: 0;
  height: 100%;
  min-width: 0;
}
.nav-item { position: relative; height: 100%; display: flex; align-items: center; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 var(--sp-4) 2px;
  height: 100%;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
  transition: color var(--ease);
  border-bottom: 2px solid transparent;
}
.nav-link:hover,
.nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.nav-link.highlight { color: var(--primary); font-weight: 700; }
.nav-arrow { font-size: 10px; opacity: .6; }

/* Mobile toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--r-sm);
}
.mobile-menu-toggle .bar {
  width: 22px; height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: all var(--ease);
  display: block;
}

/* Search suggestions overflow fix */
.header-search { overflow: visible !important; }
.site-header { overflow: visible !important; }
.header-main { overflow: visible !important; }
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 9999;
  display: none;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}
.search-suggestions.active { display: block; }
