/* Mespi header/search refresh. Kept separate from Journal core styles. */

:root {
  --mespi-header-border: #ece7f4;
  --mespi-header-muted: #6d6477;
  --mespi-header-text: #211a2d;
  --mespi-header-soft: #faf8fd;
  --mespi-header-chip: #f4f1fa;
  --mespi-header-primary: #6f42c1;
  --mespi-header-accent: #00a6a6;
  --mespi-header-chip-hover: #6f42c1;
  --mespi-header-shadow: 0 18px 45px rgba(27, 18, 45, .15);
  --mespi-icon-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16'/%3E%3Cpath d='M4 12h16'/%3E%3Cpath d='M4 17h16'/%3E%3C/svg%3E");
  --mespi-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m16.5 16.5 4 4'/%3E%3C/svg%3E");
  --mespi-icon-cart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.5' cy='20' r='1.4'/%3E%3Ccircle cx='18' cy='20' r='1.4'/%3E%3Cpath d='M3 4h2.4l2.1 11.2a2 2 0 0 0 2 1.6h7.9a2 2 0 0 0 1.9-1.4L21 8H6.3'/%3E%3C/svg%3E");
}

.mespi-search-overlay-head {
  display: none;
}

.mespi-search-close,
.mespi-mobile-search-toggle {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.mespi-search-close::before,
.mespi-mobile-search-toggle::before {
  font-family: icomoon;
  font-weight: normal;
  line-height: 1;
}

.mespi-search-close::before {
  content: "\f00d";
}

.mespi-mobile-search-toggle::before {
  content: "\f002";
}

.header-search input[name="search"]::placeholder {
  font-style: italic;
  color: #9c89bc !important;
}

.dropdown-search .header-search {
  border: 1px solid var(--mespi-header-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(33, 26, 45, .04);
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.dropdown-search .header-search.focused,
.dropdown-search.is-mespi-search-open .header-search,
.dropdown-search.is-searching .header-search {
  border-color: rgba(111, 66, 193, .42);
  box-shadow: 0 0 0 4px rgba(111, 66, 193, .08);
}

.dropdown-search .header-search input {
  color: var(--mespi-header-text);
  font-size: 15px;
}

.dropdown-search .search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  box-sizing: border-box;
  height: calc(100% - 2px);
  min-width: 46px;
  border: 0 !important;
  margin: -2px 1px -2px 0;
  color: #fff;
  background: var(--mespi-header-primary);
  transition: background-color .16s ease, transform .16s ease;
  border-top-right-radius: 2px;
  border-bottom-right-radius: 2px;
}

.dropdown-search .search-button:hover {
  background: #58359d;
}

.dropdown-search .search-button:active {
  transform: translateY(1px);
}

.dropdown-search .hidden-content-search {
  border: 1px solid var(--mespi-header-border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  box-shadow: var(--mespi-header-shadow);
}

.dropdown-search .search-content,
.dropdown-search .search-content-bottom {
  background: #fff;
}

.dropdown-search .h-divider {
  margin: 12px 0 8px;
}

.dropdown-search .h-divider .zeta,
.dropdown-search .search-content-bottom .zeta {
  color: var(--mespi-header-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.dropdown-search .h-divider::after,
.dropdown-search .hr-line-gray {
  background-color: #f1edf7;
}

.dropdown-search .search-result-list.phrases,
.dropdown-search .search-result-list.manufacturers,
.dropdown-search .search-result-list.categories {
  gap: 9px;
  padding-bottom: 12px;
}

.dropdown-search .search-result-list-text.phrase,
.dropdown-search .search-result-list-text.manufacturer,
.dropdown-search .search-result-list-text.category {
  display: inline-flex;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid #e8e1f4;
  border-radius: 999px;
  color: #382a4f;
  background: var(--mespi-header-chip);
  box-shadow: none;
  line-height: 1.15;
  transition: border-color .16s ease, color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.dropdown-search .search-result-list-link:hover .search-result-list-text.phrase,
.dropdown-search .search-result-list-link:hover .search-result-list-text.manufacturer,
.dropdown-search .search-result-list-link:hover .search-result-list-text.category,
.dropdown-search .search-result-list-link:focus-visible .search-result-list-text.phrase,
.dropdown-search .search-result-list-link:focus-visible .search-result-list-text.manufacturer,
.dropdown-search .search-result-list-link:focus-visible .search-result-list-text.category {
  color: #fff;
  border-color: var(--mespi-header-chip-hover);
  background: var(--mespi-header-chip-hover);
  box-shadow: 0 8px 18px rgba(111, 66, 193, .16);
  text-decoration: none;
  transform: translateY(-1px);
}

.dropdown-search .search-result-list-link:hover .search-result-list-text,
.dropdown-search .search-result-list-link:hover .search-result-list-text::after {
  text-decoration: none;
}

.dropdown-search .search-result-list-product .search-result-list-item {
  border-bottom: 1px solid #f2eef7;
}

.dropdown-search .search-result-list-product .search-result-list-item:last-child {
  border-bottom: 0;
}

.dropdown-search .search-result-list-product .search-result-list-link {
  min-height: 72px;
  padding: 7px 8px;
  border-radius: 10px;
  transition: background-color .16s ease;
}

.dropdown-search .search-result-list-product .search-result-list-link:hover {
  background: var(--mespi-header-soft);
}

.dropdown-search .search-result-list-img {
  width: 54px;
  max-width: 54px;
  flex-basis: 54px;
  margin-right: 12px;
}

.dropdown-search .search-result-list-img img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
}

.dropdown-search .search-result-list-text {
  color: var(--mespi-header-text);
  line-height: 1.32;
}

.search-content-bottom ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-content-bottom .search-result-list-item {
  margin: 0;
}

.search-content-bottom .search-result-list-link {
  padding: 0;
  color: var(--mespi-header-primary);
}

@media (min-width: 992px) {
  .desktop-header-active .header-classic {
    border-bottom: 0;
    background: #fff;
  }

  .desktop-header-active .header-classic .top-bar {
    height: 28px !important;
    min-height: 28px;
    border-bottom: 0;
  }

  .desktop-header-active .header-classic .mid-bar {
    height: 76px !important;
  }

  .desktop-header-active .header-classic .desktop-logo-wrapper,
  .desktop-header-active .header-classic #logo,
  .desktop-header-active .header-classic #logo a {
    display: flex;
    align-items: center;
  }

  .desktop-header-active .header-classic .desktop-main-menu-wrapper {
    height: 44px !important;
    min-height: 44px;
    border-top: 0;
    box-shadow: 0 7px 20px rgba(27, 18, 45, .04);
  }

  .desktop-header-active .header-classic .desktop-main-menu-wrapper .main-menu,
  .desktop-header-active .header-classic .desktop-main-menu-wrapper .main-menu > .j-menu,
  .desktop-header-active .header-classic .desktop-main-menu-wrapper .main-menu .main-menu-item,
  .desktop-header-active .header-classic .desktop-main-menu-wrapper .main-menu .main-menu-item > a {
    height: 44px;
    min-height: 44px;
  }

  .desktop-header-active .header-classic .desktop-main-menu-wrapper .desktop-cart-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 44px !important;
  }

  .desktop-header-active .header-classic .desktop-main-menu-wrapper #cart,
  .desktop-header-active .header-classic .desktop-main-menu-wrapper #cart > a.cart-heading {
    height: 40px !important;
    max-height: 40px !important;
    min-height: 40px;
  }

  .desktop-header-active .header-classic .desktop-main-menu-wrapper #cart {
    display: flex;
    align-items: center;
    margin-left: 12px;
  }

  .desktop-header-active .header-classic .desktop-main-menu-wrapper #cart > a.cart-heading {
    align-items: center;
    border-radius: 12px;
    background: #f7f4fb;
    overflow: visible;
  }

  .desktop-header-active .header-classic .desktop-main-menu-wrapper #cart-total {
    height: 40px;
    padding: 0 9px 0 11px;
    font-size: 13px;
    line-height: 40px;
  }

  .desktop-header-active .header-classic .desktop-main-menu-wrapper #cart > a > i {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    max-height: 40px !important;
    border-radius: 12px;
    font-size: 19px;
  }

  .desktop-header-active .header-classic .desktop-main-menu-wrapper #cart-items {
    top: -5px;
    right: -6px;
    width: 18px;
    min-width: 18px;
    height: 18px;
    margin: 0 !important;
    padding: 0 3px;
    font-size: 11px;
    line-height: 14px;
  }

  .desktop-header-active .header-classic #logo img {
    max-height: 64px;
    width: auto;
    object-fit: contain;
  }

  .desktop-header-active .header-classic .mespi-desktop-search-wrapper {
    padding: 0 18px;
  }

  .desktop-header-active .header-classic .full-search #search {
    height: 42px !important;
  }

  .desktop-header-active .header-classic .full-search #search > .j-dropdown {
    overflow: visible;
  }

  .desktop-header-active .header-classic .desktop-search-wrapper .hidden-content-search {
    top: calc(100% + 10px);
    min-width: 620px;
    max-height: min(680px, calc(100vh - 132px));
    border-top: 1px solid var(--mespi-header-border);
    border-radius: 16px;
  }

  .desktop-header-active .header-classic .desktop-search-wrapper .hidden-content-search::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 34px;
    width: 14px;
    height: 14px;
    transform: rotate(45deg);
    border-top: 1px solid var(--mespi-header-border);
    border-left: 1px solid var(--mespi-header-border);
    background: #fff;
  }

  .desktop-header-active .header-classic .dropdown-search.is-mespi-search-open {
    z-index: 25;
  }

  .desktop-header-active .header-classic .dropdown-search .search-content {
    padding: 6px 16px 2px;
    border-radius: 16px 16px 0 0;
  }

  .desktop-header-active .header-classic .dropdown-search .search-content-bottom {
    padding: 4px 16px 16px;
    border-radius: 0 0 16px 16px;
  }
}

@media (max-width: 1199px) {
  html.mespi-mobile-search-active,
  body.mespi-mobile-search-active {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .mobile-header-active .mobile-header {
    border-bottom: 1px solid var(--mespi-header-border);
    background: #fff;
    box-shadow: 0 6px 20px rgba(27, 18, 45, .08);
  }

  .mobile-header-active .mobile-header .mobile-bar {
    height: 60px !important;
    padding: 0 8px;
    z-index: 4;
  }

  .mobile-header-active .mobile-1 .mobile-logo-wrapper {
    max-width: 46%;
    margin-left: 0 !important;
  }

  .mobile-header-active .mobile-1 #logo img {
    max-height: 42px;
    width: auto;
    object-fit: contain;
  }

  .mobile-header-active .mobile-1 .mobile-bar-group {
    gap: 5px;
  }

  .mobile-header-active .mobile-1 .mobile-bar-group > div,
  .mobile-header-active .mobile-1 .mobile-bar-group > button,
  .mobile-header-active .mobile-2 .mobile-bar > .mespi-mobile-search-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px !important;
    min-height: 44px;
  }

  .mobile-header-active .menu-trigger,
  .mobile-header-active .mobile-cart-wrapper,
  .mobile-header-active .mespi-mobile-search-toggle,
  .mobile-header-active .mobile-custom-menu {
    border-radius: 12px;
    transition: background-color .16s ease, color .16s ease;
  }

  .mobile-header-active .mobile-1 .menu-trigger,
  .mobile-header-active .mobile-1 .mobile-cart-wrapper,
  .mobile-header-active .mespi-mobile-search-toggle {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    color: #2b2140;
    font-size: 20px;
    background: #f7f4fb;
  }

  .mobile-header-active .mobile-1 .menu-trigger {
    position: static !important;
    left: auto !important;
    right: auto !important;
    flex: 0 0 auto;
    font-size: 0;
    line-height: 1;
  }

  .mobile-header-active .mobile-1 .menu-trigger::before {
    content: "" !important;
    width: 24px;
    height: 24px;
    color: inherit !important;
    background: currentColor !important;
    box-shadow: none !important;
    font-family: inherit !important;
    -webkit-mask: var(--mespi-icon-menu) center / 24px 24px no-repeat;
    mask: var(--mespi-icon-menu) center / 24px 24px no-repeat;
  }

  .mobile-header-active .mobile-1 .menu-trigger::after {
    display: none !important;
    content: none !important;
  }

  .mobile-header-active .mespi-mobile-search-toggle:hover,
  .mobile-header-active .mespi-mobile-search-toggle:focus,
  .mobile-header-active .mobile-1 .menu-trigger:hover,
  .mobile-header-active .mobile-1 .menu-trigger:focus,
  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a.cart-heading:hover,
  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a.cart-heading:focus {
    color: #fff;
    background: var(--mespi-header-primary);
    outline: none;
  }

  .mobile-header-active .mobile-1 .mobile-cart-wrapper {
    padding: 0;
  }

  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart,
  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a.cart-heading {
    width: 44px !important;
    height: 44px !important;
    max-height: 44px !important;
  }

  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart {
    margin: 0 !important;
  }

  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a.cart-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #2b2140;
    background: #f7f4fb;
    transition: background-color .16s ease, color .16s ease;
  }

  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a > i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    max-height: 44px !important;
    color: inherit;
    background: transparent !important;
    border-radius: 12px;
    font-size: 0;
    line-height: 1;
  }

  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a > i::before,
  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a > i.fa::before {
    content: "" !important;
    display: block;
    width: 24px;
    height: 24px;
    color: inherit !important;
    background: currentColor !important;
    font-family: inherit !important;
    -webkit-mask: var(--mespi-icon-cart) center / 24px 24px no-repeat;
    mask: var(--mespi-icon-cart) center / 24px 24px no-repeat;
  }

  .mobile-header-active .mespi-mobile-search-toggle::before {
    content: "" !important;
    display: block;
    width: 24px;
    height: 24px;
    color: inherit !important;
    background: currentColor !important;
    font-family: inherit !important;
    -webkit-mask: var(--mespi-icon-search) center / 24px 24px no-repeat;
    mask: var(--mespi-icon-search) center / 24px 24px no-repeat;
  }

  .mobile-header-active .mespi-mobile-search-toggle::after,
  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a.cart-heading::after,
  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a > i::after {
    display: none !important;
    content: none !important;
  }

  .mobile-header-active .mobile-1 .menu-trigger,
  .mobile-header-active .mespi-mobile-search-toggle,
  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a.cart-heading {
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart-items {
    top: -4px;
    right: -4px;
    left: auto !important;
    width: 18px;
    min-width: 18px;
    height: 18px;
    margin: 0 !important;
    padding: 0 3px;
    border: 2px solid #fff;
    font-size: 11px;
    line-height: 14px;
    transform: none !important;
  }

  .mobile-header-active .mespi-mobile-search-group {
    display: block !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    overflow: visible;
    position: relative;
    z-index: 10000;
  }

  .mobile-header-active .mespi-mobile-search-group .mobile-search-wrapper.full-search {
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    flex: 0 0 0 !important;
    overflow: visible;
  }

  .mobile-header-active .mespi-mobile-search-group #search {
    position: fixed !important;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
    background: rgba(27, 18, 45, .52);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 10001;
    transition: opacity .18s ease, visibility .18s ease;
  }

  .mobile-header-active .mespi-mobile-search-group #search.is-mespi-search-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-header-active .mespi-mobile-search-group #search > .mespi-search-panel {
    display: block !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: min(100%, 620px) !important;
    height: auto !important;
    min-width: 0 !important;
    max-height: calc(100dvh - 24px);
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--mespi-header-shadow);
    overflow: hidden;
    transform: translateY(-8px);
    transition: transform .18s ease;
  }

  .mobile-header-active .mespi-mobile-search-group #search.is-mespi-search-open > .mespi-search-panel {
    transform: translateY(0);
  }

  .mobile-header-active .mespi-search-overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 0 10px 0 16px;
    border-bottom: 1px solid var(--mespi-header-border);
    background: #fff;
  }

  .mobile-header-active .mespi-search-overlay-title {
    color: var(--mespi-header-text);
    font-size: 15px;
    font-weight: 700;
  }

  .mobile-header-active .mespi-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #312541;
    font-size: 18px;
    background: #f7f4fb;
  }

  .mobile-header-active .mespi-search-close:hover,
  .mobile-header-active .mespi-search-close:focus {
    color: #fff;
    background: var(--mespi-header-primary);
    outline: none;
  }

  .mobile-header-active .mespi-mobile-search-group .header-search {
    height: 48px !important;
    min-height: 48px;
    margin: 10px;
    border-radius: 13px;
  }

  .mobile-header-active .mespi-mobile-search-group .header-search input {
    padding-left: 14px;
    font-size: 16px !important;
  }

  .mobile-header-active .mespi-mobile-search-group .search-button {
    min-width: 48px;
    height: 42px !important;
    border-top-right-radius: 9px;
    border-bottom-right-radius: 9px;
  }

  .mobile-header-active .mespi-mobile-search-group .hidden-content-search {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    max-height: calc(100dvh - 126px) !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  .mobile-header-active .mespi-mobile-search-group .search-content {
    padding: 2px 12px 0;
  }

  .mobile-header-active .mespi-mobile-search-group .search-content-bottom {
    padding: 4px 12px 16px;
  }

  .mobile-header-active .mespi-mobile-search-group .search-result-list.phrases,
  .mobile-header-active .mespi-mobile-search-group .search-result-list.manufacturers,
  .mobile-header-active .mespi-mobile-search-group .search-result-list.categories {
    gap: 8px;
    padding-bottom: 10px;
  }

  .mobile-header-active .mespi-mobile-search-group .search-result-list-text.phrase,
  .mobile-header-active .mespi-mobile-search-group .search-result-list-text.manufacturer,
  .mobile-header-active .mespi-mobile-search-group .search-result-list-text.category {
    min-height: 34px;
    padding: 8px 11px;
    font-size: 13px;
  }

  .mobile-header-active .mespi-mobile-search-group .search-result-list-product .search-result-list-link {
    min-height: 70px;
    padding: 8px 6px;
  }

  .mobile-header-active .mespi-mobile-search-group .search-result-list-img {
    width: 50px;
    max-width: 50px;
    flex-basis: 50px;
    margin-right: 10px;
  }

  .mobile-header-active .mespi-mobile-search-group .search-result-list-img img {
    width: 50px;
    height: 50px;
  }

  .mobile-header-active .mespi-mobile-search-group .search-result-list-text {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .mobile-header-active .mobile-1 .mobile-bar-group > div,
  .mobile-header-active .mobile-1 .mobile-bar-group > button,
  .mobile-header-active .mobile-2 .mobile-bar > .mespi-mobile-search-toggle {
    width: 40px;
    min-width: 40px;
    height: 40px !important;
    min-height: 40px;
  }

  .mobile-header-active .mobile-1 .mobile-bar-group {
    gap: 3px;
  }

  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart,
  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a.cart-heading,
  .mobile-header-active .mobile-1 .mobile-cart-wrapper #cart > a > i {
    width: 40px !important;
    height: 40px !important;
    max-height: 40px !important;
  }

  .mobile-header-active .mespi-mobile-search-toggle {
    width: 40px;
    min-width: 40px;
  }
}
