/* Header styles for Marketlifepl */

.ml-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.ml-header__top {
  position: absolute;
  inset: 0 auto auto 0;
}

.ml-header__skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background-color: #0f172a;
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.875rem;
  text-decoration: none;
  z-index: 1001;
  transition: top 0.2s ease, box-shadow 0.2s ease;
}

.ml-header__skip-link:focus-visible {
  top: 0.75rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
}

.ml-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.ml-header__brand {
  display: flex;
  align-items: center;
}

.ml-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #0f172a;
}

.ml-header__logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #3b82f6, #0ea5e9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
}

.ml-header__logo-text {
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 1.05rem;
}

.ml-header__search {
  flex: 1;
  max-width: 520px;
}

.ml-header__search-form {
  width: 100%;
}

.ml-header__search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ml-header__search-fieldwrap {
  display: flex;
  align-items: center;
  background-color: #f1f5f9;
  border-radius: 999px;
  padding: 0.1rem 0.1rem 0.1rem 0.9rem;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ml-header__search-input {
  border: none;
  background: transparent;
  padding: 0.4rem 0.75rem 0.4rem 0;
  font-size: 0.95rem;
  width: 100%;
  outline: none;
}

.ml-header__search-input::placeholder {
  color: #9ca3af;
}

.ml-header__search-input:focus-visible + .ml-header__search-btn,
.ml-header__search-input:focus-visible {
  outline: none;
}

.ml-header__search-input:focus-visible ~ .ml-header__search-btn,
.ml-header__search-input:focus-visible,
.ml-header__search-fieldwrap:focus-within {
  border-color: #3b82f6;
  background-color: #e5f1ff;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

.ml-header__search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  background: #1d4ed8;
  color: #ffffff;
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.ml-header__search-btn:hover {
  background-color: #1e40af;
}

.ml-header__search-btn:active {
  transform: scale(0.96);
}

.ml-header__search-btn:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px #eff6ff, 0 0 0 4px #1d4ed8;
}

.ml-header__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ml-header__icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  color: #0f172a;
  background-color: #e5f1ff;
  text-decoration: none;
  font-size: 1.05rem;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.ml-header__icon-link:hover {
  background-color: #dbeafe;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.ml-header__icon-link:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.ml-header__icon-link:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px #eff6ff, 0 0 0 4px #1d4ed8;
}

.ml-header__icon-link--cart {
  margin-left: 0.15rem;
}

.ml-header__cart-count {
  position: absolute;
  top: -0.15rem;
  right: -0.1rem;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
}

.ml-header__menu-toggle {
  display: none;
  border: none;
  background: transparent;
  padding: 0.3rem;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 0.25rem;
}

.ml-header__menu-toggle-box {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.18rem;
  width: 1.45rem;
  height: 1.45rem;
}

.ml-header__menu-toggle-line {
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background-color: #0f172a;
  transition: transform 0.18s ease, opacity 0.18s ease, width 0.18s ease;
}

.ml-header__menu-toggle:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px #eff6ff, 0 0 0 4px #1d4ed8;
}

.ml-header__menu-toggle.is-open .ml-header__menu-toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.ml-header__menu-toggle.is-open .ml-header__menu-toggle-line:nth-child(2) {
  opacity: 0;
}

.ml-header__menu-toggle.is-open .ml-header__menu-toggle-line:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

.ml-header__nav {
  border-top: 1px solid rgba(15, 23, 42, 0.04);
}

.ml-header__nav-list {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  padding: 0 1rem 0.55rem 1rem;
}

.ml-header__nav-item {
  position: relative;
}

.ml-header__nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 999px;
}

.ml-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1rem;
  margin: 0 auto;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #0ea5e9);
  transition: width 0.18s ease;
}

.ml-header__nav-link:hover {
  color: #0f172a;
}

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

.ml-header__nav-link:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px #eff6ff, 0 0 0 4px #1d4ed8;
  border-radius: 999px;
}

.ml-header__nav-link[aria-current="page"] {
  color: #1d4ed8;
}

.ml-header__nav-link[aria-current="page"]::after {
  width: 100%;
}

/* Responsive behavior */

@media (max-width: 960px) {
  .ml-header__inner {
    padding-inline: 0.75rem;
    gap: 0.5rem;
  }

  .ml-header__search {
    display: none;
  }

  .ml-header__menu-toggle {
    display: inline-flex;
  }

  .ml-header__nav {
    position: fixed;
    inset: 3.5rem 0 auto 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    transition: max-height 0.22s ease;
  }

  .ml-header__nav.is-open {
    max-height: 16rem;
  }

  .ml-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.6rem 1rem 0.85rem 1rem;
    gap: 0.1rem;
  }

  .ml-header__nav-link {
    width: 100%;
    padding: 0.55rem 0.1rem;
  }

  .ml-header__nav-link::after {
    bottom: 0;
  }
}

@media (max-width: 640px) {
  .ml-header__inner {
    padding-inline: 0.75rem;
  }

  .ml-header__logo-text {
    font-size: 0.98rem;
  }

  .ml-header__logo-mark {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ml-header *,
  .ml-header *::before,
  .ml-header *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
