.wm-site-header,
.wm-site-header * {
  box-sizing: border-box;
}

.wm-site-header {
  position: relative;
  direction: rtl;
  z-index: 900;
  background: var(--wm-color-bg, var(--wm-color-background, #f6f5f2));
}

.wm-site-header.is-sticky {
  position: sticky;
  top: 0;
}

.admin-bar .wm-site-header.is-sticky {
  top: 32px;
}

.wm-header-topbar {
  border-bottom: 1px solid rgba(229, 224, 216, 0.82);
  background: rgba(255, 255, 255, 0.72);
  color: var(--wm-color-muted, #6b7280);
  font-size: 12px;
  font-weight: 650;
}

.wm-header-topbar__inner {
  width: min(100% - 40px, var(--wm-content-width, 1200px));
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 auto;
  padding: 7px 0;
  white-space: nowrap;
}

.wm-header-topbar__item {
  display: inline-flex;
  align-items: center;
  color: inherit;
}

.wm-header-topbar__item:not(:last-child)::after {
  content: "";
  width: 4px;
  height: 4px;
  margin-inline: 12px;
  border-radius: 50%;
  background: var(--wm-color-accent, #c89b3c);
  opacity: 0.78;
}

.wm-header-topbar__item a {
  color: inherit;
  text-decoration: none;
  transition: color 180ms ease;
}

.wm-header-topbar__item a:hover,
.wm-header-topbar__item a:focus {
  color: var(--wm-color-accent-dark, #9f7425);
}

.wm-site-header__inner {
  width: min(100% - 40px, var(--wm-content-width, 1200px));
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin: 12px auto 0;
  padding: 12px 18px;
  border: 1px solid var(--wm-color-border, #e5e0d8);
  border-radius: 22px;
  background: var(--wm-color-surface, #fff);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.06);
  transition: min-height 180ms ease, margin 180ms ease, box-shadow 180ms ease;
}

.wm-site-header.is-scrolled .wm-site-header__inner {
  min-height: 66px;
  margin-top: 8px;
  box-shadow: 0 16px 38px rgba(17, 24, 39, 0.09);
}

.wm-site-header__brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  color: var(--wm-color-primary, #111827);
  text-decoration: none;
}

.wm-site-header__logo {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 48px;
  border: 1px solid rgba(229, 224, 216, 0.92);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, rgba(249, 248, 245, 0.92));
}

.wm-site-header__logo img,
.wm-site-header__logo .custom-logo {
  width: auto;
  max-width: 86%;
  height: auto;
  max-height: 86%;
  display: block;
  object-fit: contain;
}

.wm-site-header__site-name {
  overflow: hidden;
  color: var(--wm-color-primary, #111827);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-site-header__nav {
  min-width: 0;
  justify-self: center;
}

.wm-site-header__menu,
.wm-site-header__menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wm-site-header__menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.wm-site-header__menu li {
  position: relative;
}

.wm-site-header__menu a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 11px;
  border-radius: 13px;
  color: var(--wm-color-primary, #111827);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.5;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
}

.wm-site-header__menu > li > a::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 5px;
  left: 12px;
  height: 2px;
  border-radius: 999px;
  background: var(--wm-color-accent, #c89b3c);
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 180ms ease, transform 180ms ease;
}

.wm-site-header__menu > li:hover > a,
.wm-site-header__menu > li:focus-within > a,
.wm-site-header__menu > li.current-menu-item > a,
.wm-site-header__menu > li.current-menu-ancestor > a {
  color: var(--wm-color-accent-dark, #9f7425);
  background: rgba(200, 155, 60, 0.07);
}

.wm-site-header__menu > li:hover > a::after,
.wm-site-header__menu > li:focus-within > a::after,
.wm-site-header__menu > li.current-menu-item > a::after,
.wm-site-header__menu > li.current-menu-ancestor > a::after {
  opacity: 1;
  transform: scaleX(1);
}

.wm-site-header__menu .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(229, 224, 216, 0.95);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(17, 24, 39, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.wm-site-header__menu .menu-item-has-children:hover > .sub-menu,
.wm-site-header__menu .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wm-site-header__menu .sub-menu a {
  width: 100%;
  min-height: 36px;
  justify-content: flex-start;
  padding: 0 10px;
  color: var(--wm-color-primary, #111827);
  font-size: 12.5px;
}

.wm-site-header__actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
}

.wm-site-header__action {
  position: relative;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid rgba(229, 224, 216, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--wm-color-primary, #111827);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.045);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.wm-site-header__action:hover,
.wm-site-header__action:focus {
  border-color: rgba(200, 155, 60, 0.48);
  background: #fff;
  color: var(--wm-color-accent-dark, #9f7425);
  box-shadow: 0 12px 24px rgba(200, 155, 60, 0.1);
  transform: translateY(-1px);
}

.wm-site-header__action-icon {
  font-size: 16px;
  line-height: 1;
}

.wm-site-header__cart-count {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--wm-color-accent, #c89b3c);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.wm-header-search {
  position: relative;
}

.wm-header-search__panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid rgba(229, 224, 216, 0.95);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 46px rgba(17, 24, 39, 0.12);
}

.wm-header-search--open .wm-header-search__panel {
  display: block;
}

.wm-header-search__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.wm-header-search__field {
  min-width: 0;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--wm-color-border, #e5e0d8);
  border-radius: 14px;
  background: #f9f8f5;
  color: var(--wm-color-primary, #111827);
}

.wm-header-search__submit {
  min-height: 42px;
  padding: 0 15px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--wm-color-primary, #111827), #26364d);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

@media (max-width: 782px) {
  .admin-bar .wm-site-header.is-sticky {
    top: 46px;
  }
}

@media (max-width: 767px) {
  .wm-header-topbar {
    display: none;
  }

  .wm-site-header__inner {
    width: min(100% - 24px, var(--wm-content-width, 1200px));
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 60px;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 18px;
  }

  .wm-site-header__nav {
    display: none;
  }

  .wm-site-header__brand {
    gap: 8px;
  }

  .wm-site-header__logo {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 14px;
  }

  .wm-site-header__site-name {
    max-width: 150px;
    font-size: 14px;
  }

  .wm-site-header__actions {
    gap: 6px;
  }

  .wm-site-header__action {
    width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .wm-site-header__action-text {
    display: none;
  }

  .wm-site-header__account,
  .wm-site-header__cart {
    display: none !important;
  }

  .wm-header-search__panel {
    position: fixed;
    top: 74px;
    right: 12px;
    left: 12px;
    width: auto;
    padding: 10px;
    border-radius: 18px;
    background: var(--wm-color-surface, #fff);
    border: 1px solid var(--wm-color-border, #e5e0d8);
    box-shadow: 0 18px 42px rgba(17, 24, 39, 0.12);
    z-index: 1200;
  }

  .wm-header-search__form {
    position: relative;
    display: block;
  }

  .wm-header-search__field,
  .wm-header-search input[type="search"] {
    width: 100%;
    min-height: 44px;
    padding-inline-start: 44px;
    padding-inline-end: 14px;
    border-radius: 14px;
    border: 1px solid var(--wm-color-border, #e5e0d8);
    background: #fff;
    color: var(--wm-color-primary, #111827);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
  }

  .wm-header-search__form::before {
    content: "";
    position: absolute;
    inset-inline-start: 15px;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid var(--wm-color-muted, #6b7280);
    border-radius: 50%;
    transform: translateY(-50%);
    pointer-events: none;
  }

  .wm-header-search__form::after {
    content: "";
    position: absolute;
    inset-inline-start: 30px;
    top: calc(50% + 8px);
    width: 7px;
    height: 2px;
    border-radius: 999px;
    background: var(--wm-color-muted, #6b7280);
    transform: rotate(45deg);
    transform-origin: right center;
    pointer-events: none;
  }

  .wm-header-search__submit,
  .wm-header-search button[type="submit"] {
    position: absolute !important;
    width: 1px;
    height: 1px;
    min-width: 0;
    min-height: 0;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (min-width: 1024px) {
  .wm-mega-menu {
    display: block;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    z-index: 1100;
    pointer-events: none;
  }

  .wm-mega-menu__panel {
    width: min(100% - 40px, var(--wm-content-width, 1200px));
    margin: 10px auto 0;
    padding: 24px;
    border: 1px solid var(--wm-color-border, #e5e0d8);
    border-radius: 26px;
    background: var(--wm-color-surface, #fff);
    box-shadow: 0 24px 64px rgba(17, 24, 39, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 220ms ease, transform 220ms ease;
    pointer-events: none;
  }

  .wm-mega-menu .wm-mega-menu__panel.is-active,
  .wm-mega-menu .wm-mega-menu__panel.is-open,
  .wm-mega-menu .wm-mega-menu__panel[aria-hidden="false"],
  .wm-mega-menu .wm-mega-menu__panel.is-active.hidden,
  .wm-mega-menu .wm-mega-menu__panel.is-open.hidden {
    display: block !important;
    z-index: 9999;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  .wm-mega-menu__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 24px;
    direction: rtl;
  }

  .wm-mega-menu__inner--no-feature {
    grid-template-columns: 1fr;
  }

  .wm-mega-menu__main {
    min-width: 0;
  }

  .wm-mega-menu__intro {
    margin-bottom: 16px;
  }

  .wm-mega-menu__title {
    margin: 0;
    color: var(--wm-color-primary, #111827);
    font-size: 18px;
    font-weight: 850;
    line-height: 1.6;
  }

  .wm-mega-menu__subtitle {
    max-width: 620px;
    margin: 4px 0 0;
    color: var(--wm-color-muted, #6b7280);
    font-size: 13px;
    line-height: 1.85;
  }

  .wm-mega-menu__columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .wm-mega-menu__inner--no-feature .wm-mega-menu__columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wm-mega-menu__column {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(229, 224, 216, 0.82);
    border-radius: 18px;
    background: #f9f8f5;
  }

  .wm-mega-menu__column-title {
    margin: 0 0 10px;
    color: var(--wm-color-primary, #111827);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.6;
  }

  .wm-mega-menu__links {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .wm-mega-menu__link {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--wm-color-primary, #111827);
    text-decoration: none;
    transition: background 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
  }

  .wm-mega-menu__link:hover,
  .wm-mega-menu__link:focus {
    border-color: rgba(200, 155, 60, 0.28);
    background: rgba(200, 155, 60, 0.1);
    color: var(--wm-color-accent-dark, #9f7425);
    transform: translateY(-1px);
  }

  .wm-mega-menu__link-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 32px;
    border: 1px solid rgba(229, 224, 216, 0.9);
    border-radius: 11px;
    background: #fff;
  }

  .wm-mega-menu__link-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .wm-mega-menu__link-content {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .wm-mega-menu__link-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 820;
    line-height: 1.55;
  }

  .wm-mega-menu__link-description {
    color: var(--wm-color-muted, #6b7280);
    font-size: 12px;
    line-height: 1.7;
  }

  .wm-mega-menu__badge {
    min-height: 19px;
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(200, 155, 60, 0.14);
    color: var(--wm-color-accent-dark, #9f7425);
    font-size: 10.5px;
    font-weight: 850;
  }

  .wm-mega-menu__feature {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    overflow: hidden;
    border-radius: 20px;
    background:
      linear-gradient(135deg, rgba(200, 155, 60, 0.22), rgba(255, 255, 255, 0)),
      linear-gradient(180deg, #1f2937, #111827);
    color: #fff;
  }

  .wm-mega-menu__feature-image {
    width: 100%;
    min-height: 126px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
  }

  .wm-mega-menu__feature-image img {
    width: 100%;
    height: 100%;
    max-height: 170px;
    display: block;
    object-fit: contain;
  }

  .wm-mega-menu__feature-title {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.65;
  }

  .wm-mega-menu__feature-text {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 12.5px;
    line-height: 1.85;
  }

  .wm-mega-menu__feature-button {
    width: fit-content;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    padding: 0 13px;
    border-radius: 999px;
    background: #fff;
    color: var(--wm-color-primary, #111827);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
  }

  .wm-site-header__menu > li.wm-mega-trigger-active > a,
  .wm-site-header__menu > li > a.wm-mega-trigger-active {
    color: var(--wm-color-accent-dark, #9f7425);
    background: rgba(200, 155, 60, 0.07);
  }

  .wm-site-header__menu > li.wm-mega-trigger-active > a::after,
  .wm-site-header__menu > li > a.wm-mega-trigger-active::after {
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (max-width: 1023px) {
  .wm-mega-menu {
    display: none;
  }
}
