/* ─── HEADER (Wikkeo-style) ───────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #eee;
  backdrop-filter: none;
}

/* Top bar */
.header-top {
  background: transparent;
  border-bottom: 1px solid #f0f0f0;
}

.header-top-inner {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-location {
  position: absolute;
  left: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #888;
  white-space: nowrap;
}

.header-location i {
  color: #3d8f63;
  font-size: 13px;
}

.header-top-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 28px;
}

.header-top-nav a {
  font-size: 15px;
  font-weight: 700;
  color: #555;
  transition: color 0.15s;
  padding: 4px 0;
}

.header-top-nav a:hover {
  color: #111;
}

.header-top-nav a.active {
  color: #111;
}

@media (max-width: 767px) {
  .header-top-nav {
    display: none;
  }
}

/* Main header row */
.header-main {
  position: relative;
}

.header-main-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 15px;
  display: grid;
  grid-template-columns: 1fr minmax(320px, 640px) 1fr;
  align-items: center;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  justify-self: start;
  grid-column: 1;
}

.header-catalog-wrap {
  position: static;
}

.header-catalog-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  color: #333;
  font-size: 18px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.header-catalog-btn:hover {
  border-color: #ccc;
  background: #fafafa;
}

.header-logo {
  font-size: 26px;
  font-weight: 800;
  color: #1a5c3a;
  letter-spacing: -0.8px;
  white-space: nowrap;
}

/* Search bar — по центру хедера */
.header-search-wrap {
  width: 100%;
  max-width: 640px;
  position: relative;
  justify-self: center;
  grid-column: 2;
}

.header-search {
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.header-search:focus-within {
  border-color: #3d8f63;
  box-shadow: 0 0 0 3px rgba(61, 143, 99, 0.12);
}

.header-search-scope {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  margin-left: 6px;
  padding: 0 12px;
  border-radius: 8px;
  background: #f5f5f5;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.header-search-scope:hover {
  background: #eee;
}

.header-search-scope-arrow {
  font-size: 11px;
  color: #999;
}

.header-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: #111;
  background: transparent;
}

.header-search-input::placeholder {
  color: #aaa;
}

.header-search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 2px;
  border: none;
  border-radius: 10px;
  background: #3d8f63;
  color: #fff;
  font-size: 17px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.header-search-submit:hover {
  background: #2f7350;
}

/* Search dropdown */
.header-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  z-index: 300;
  max-height: 400px;
  overflow-y: auto;
}

.header-search-results {
  list-style: none;
  padding: 8px;
}

.header-search-results li + li {
  margin-top: 2px;
}

.header-search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.12s;
}

.header-search-result:hover {
  background: #f5f5f5;
}

.header-search-result img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  background: #f0f0f0;
  flex-shrink: 0;
}

.header-search-result-info {
  min-width: 0;
  flex: 1;
}

.header-search-result-name {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-search-result-price {
  font-size: 13px;
  font-weight: 700;
  color: #1a5c3a;
  margin-top: 2px;
}

.header-search-empty {
  padding: 20px 16px;
  font-size: 14px;
  color: #888;
  text-align: center;
  margin: 0;
}

/* Action buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  justify-self: end;
  grid-column: 3;
}

.header-action-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  color: #333;
  font-size: 18px;
  transition: border-color 0.15s, background 0.15s;
}

.header-action-btn:hover {
  border-color: #ccc;
  background: #fafafa;
}

.header-auth-link {
  display: none;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #1a5c3a;
  font-size: 13px;
  font-weight: 600;
  color: #1a5c3a;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.header-auth-link:hover {
  background: #1a5c3a;
  color: #fff;
}

@media (min-width: 768px) {
  .header-auth-link {
    display: inline-flex;
  }
}

.header-search-mobile-btn {
  display: none;
}

.header-action-btn .cart-badge {
  top: 4px;
  right: 4px;
}

/* Mega menu full width under header-main */
.header-main .mega-menu {
  top: 100%;
}

.header-catalog-wrap.open > .header-catalog-btn {
  border-color: #3d8f63;
  background: #f8fcf9;
}

/* Hamburger — mobile */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  color: #333;
  font-size: 22px;
  flex-shrink: 0;
}

.hamburger:hover {
  background: #fafafa;
}

@media (max-width: 1199px) {
  .header-main-inner {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }

  .header-search-wrap {
    display: none;
    grid-column: auto;
  }

  .header-search-mobile-btn {
    display: flex;
  }

  .header-catalog-wrap {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .header-actions {
    grid-column: auto;
    justify-self: auto;
    margin-left: auto;
  }

  .header-logo {
    font-size: 20px;
  }

  .header-left {
    flex: 1;
  }
}

@media (max-width: 1199px) {
  .header-left .header-logo {
    margin-right: auto;
  }
}

#nav-overlay {
  top: var(--site-header-height, 110px);
}
