.header {
  background-color: var(--bg-white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  background-color: var(--bg-top);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0;
}

.top-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.top-phones {
  display: flex;
  align-items: center;
  gap: 26px;
}

.phone-contact-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.phone-number-link {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.phone-number-link:hover {
  color: var(--primary);
}

.wa-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--whatsapp-soft);
  color: #128C7E;
  border: 1px solid rgba(37, 211, 102, 0.35);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: var(--transition);
}

.wa-pill-btn i {
  color: var(--whatsapp);
  font-size: 14px;
  transition: transform 0.2s ease;
}

.wa-pill-btn:hover {
  background-color: var(--whatsapp);
  color: #ffffff;
  border-color: var(--whatsapp);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
  transform: translateY(-1px);
}

.wa-pill-btn:hover i {
  color: #ffffff;
  transform: scale(1.1);
}

.top-socials {
  display: flex;
  align-items: center;
  gap: 14px;
}

.social-link {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  transition: var(--transition);
}

.social-link.vk { background-color: #0077FF; }
.social-link.ok { background-color: #EE8208; }
.social-link.tg { background-color: #2AABEE; }
.social-link.wa { background-color: #25D366; }

.social-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.header-main {
  padding: 14px 0;
}

.main-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img,
.custom-logo,
.custom-logo-link img {
  width: 140px;
  max-width: 140px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
  display: block;
}

.custom-logo-link {
  display: flex;
  align-items: center;
}

.catalog-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 0 18px;
  height: 44px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.catalog-btn:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(36, 199, 187, 0.3);
}

.search-form {
  flex: 1;
  max-width: 600px;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}

.search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 199, 187, 0.15);
  background: #fff;
}

.search-cat-select {
  border: none;
  background: transparent;
  padding: 0 10px;
  height: 42px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  outline: none;
  cursor: pointer;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0 14px;
  height: 42px;
  font-size: 14px;
  outline: none;
  color: var(--text-main);
}

.search-submit-btn {
  border: none;
  background: transparent;
  padding: 0 14px;
  height: 42px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.search-submit-btn:hover {
  color: var(--primary);
}

.main-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text-main);
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
  flex-shrink: 0;
}

.action-btn:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.action-btn i,
.action-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.badge,
.action-badge,
.cart-count-badge,
.wishlist-count-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(36, 199, 187, 0.4);
  line-height: 1;
  pointer-events: none;
  box-sizing: border-box;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
}

.menu-toggle:hover {
  color: var(--primary);
}

.phone-btn-mobile {
  display: none;
}

.header-nav {
  background-color: var(--bg-white);
  border-top: 1px solid var(--border);
}

.nav-list {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 28px;
  padding: 10px 0;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  position: relative;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link:hover::after {
  width: 100%;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.drawer-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.drawer-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  z-index: 2001;
  box-shadow: 0 0 30px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-left {
  left: 0;
  transform: translateX(-100%);
}

.drawer-right {
  right: 0;
  transform: translateX(100%);
}

.drawer-backdrop.is-active .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.drawer-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close:hover {
  color: var(--danger);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.drawer-nav-list, .drawer-cat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-nav-link, .drawer-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  transition: var(--transition);
}

.drawer-nav-link:hover, .drawer-cat-link:hover {
  background-color: var(--primary-soft);
  color: var(--primary);
}

.drawer-cat-count {
  font-size: 12px;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.phone-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.phone-modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.phone-modal-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 32px 20px;
  z-index: 2001;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.phone-modal-backdrop.is-active .phone-modal-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  margin: 0 auto 16px auto;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.sheet-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}

.modal-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.contact-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-phone-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.contact-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  color: #fff;
}

.contact-action-btn:active {
  transform: scale(0.92);
}

.btn-call {
  background-color: var(--primary);
}

.btn-wa {
  background-color: var(--whatsapp);
  font-size: 18px;
}

@media (max-width: 768px) {
  .header-top,
  .header-nav,
  .action-btn-text,
  .menu-text {
    display: none !important;
  }

  .phone-btn-mobile {
    display: inline-flex;
  }

  .header-main {
    padding: 10px 0 12px 0;
  }

  .main-wrapper {
    display: grid;
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "catalog logo actions"
      "search search search";
    row-gap: 10px;
    column-gap: 8px;
    align-items: center;
  }

  .catalog-btn {
    grid-area: catalog;
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
    gap: 6px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(36, 199, 187, 0.22);
  }

  .catalog-btn span {
    display: inline-block;
  }

  .logo {
    grid-area: logo;
    display: flex;
    align-items: center;
  }

  .logo-img,
  .custom-logo,
  .custom-logo-link img {
    width: 105px;
    max-width: 105px;
    height: auto;
    max-height: 38px;
    object-fit: contain;
  }

  .auth-btn {
    display: none !important;
  }

  .main-actions {
    grid-area: actions;
    justify-self: end;
    gap: 8px;
  }

  .action-btn {
    width: 36px;
    height: 36px;
    padding: 0;
  }

  .action-btn i,
  .action-btn svg {
    width: 20px !important;
    height: 20px !important;
  }

  .badge,
  .action-badge,
  .cart-count-badge,
  .wishlist-count-badge {
    top: -2px;
    right: -2px;
  }

  .search-form {
    grid-area: search;
    max-width: 100%;
  }

  .search-cat-select {
    display: none;
  }
}
