.velvetoo-topbar {
  width: 100%;
  background: var(--velv-topbar-bg, #0b4778);
  color: var(--velv-topbar-text, #fff);
  font-size: 14px;
  line-height: 1.25;
  position: relative;
  z-index: 20;
}

.velvetoo-topbar__inner {
  width: 100%;
  max-width: 1320px;
  min-height: 34px;
  margin: 0 auto;
  padding: 7px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.velvetoo-topbar__left { text-align: left; font-weight: 600; white-space: nowrap; }
.velvetoo-topbar__center { text-align: center; font-weight: 600; }
.velvetoo-topbar__right { text-align: right; white-space: nowrap; }
.velvetoo-topbar a, .velvetoo-topbar a:hover, .velvetoo-topbar a:focus { color: inherit; text-decoration: none; }
.velvetoo-topbar a:hover, .velvetoo-topbar a:focus { text-decoration: underline; }
.velvetoo-topbar__sep { margin: 0 5px; opacity: .8; }
.velvetoo-topbar__mobile-message { display: none; }

/* SECOND / FUNCTIONAL ROW */
#header .header-bottom {
  background: var(--velv-header-row2-bg, #fff);
  color: var(--velv-header-row2-text, #212121);
}

#header .header-bottom .header-block__action-btn,
#header .header-bottom .header-block__icon,
#header .header-bottom .header-block__title,
#header .header-bottom .ps-searchbar__magnifier,
#header .header-bottom .velv-wishlist-link {
  color: var(--velv-header-row2-text, #212121) !important;
}

/* THIRD ROW - PRODUCT MENU */
#header .header-nav-full-width {
  background: var(--velv-header-row3-bg, #fff);
  color: var(--velv-header-row3-text, #212121);
}

#header .header-nav-full-width .ps-mainmenu__tree-link,
#header .header-nav-full-width .ps-mainmenu__tree-dropdown-toggle,
#header .header-nav-full-width .menu-toggle {
  color: var(--velv-header-row3-text, #212121) !important;
}

#header .header-nav-full-width .velv-menu-label {
  margin-left: 7px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
}

.velv-wishlist-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}

@media (min-width: 768px) {
  /* Nav2 is redundant on desktop after account/cart are moved into row 2. */
  #header .header-top {
    display: none !important;
  }

  #header .header-bottom__container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  #header .header-bottom__row {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    min-height: 62px !important;
    gap: 0 !important;
    row-gap: 0 !important;
  }

  /* Exact desktop geometry: logo | search | free space | profile | favorites | cart. */
  #header .header-bottom__logo {
    order: 10 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 28px 0 0 !important;
    padding: 7px 0 !important;
  }

  #header .header-bottom__logo img {
    display: block;
    max-height: 46px;
    width: auto;
  }

  #header #_desktop_ps_searchbar {
    order: 20 !important;
    display: flex !important;
    flex: 1 1 380px !important;
    width: auto !important;
    min-width: 260px !important;
    max-width: 470px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-items: center !important;
  }

  #header #_desktop_velv_wishlist {
    order: 30 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    margin-left: auto !important;
    padding: 0 10px !important;
  }

  #header #_desktop_ps_customersignin {
    order: 40 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: auto !important;
    padding: 0 10px !important;
    align-items: center !important;
  }

  /* If wishlist exists, it owns the auto spacer instead of profile. */
  #header #_desktop_velv_wishlist + #_desktop_ps_customersignin,
  #header .velv-header-wishlist ~ #_desktop_ps_customersignin {
    margin-left: 0 !important;
  }

  #header #_desktop_ps_shoppingcart {
    order: 50 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 0 0 10px !important;
    align-items: center !important;
  }

  #header #_desktop_ps_customersignin > *,
  #header #_desktop_ps_shoppingcart > *,
  #header #_desktop_velv_wishlist > * {
    display: flex;
    align-items: center;
    margin: 0 !important;
  }

  #header #_desktop_ps_customersignin .header-block,
  #header #_desktop_ps_shoppingcart .header-block {
    display: flex;
    align-items: center;
    min-height: 42px;
    margin: 0 !important;
  }

  #header #_desktop_ps_customersignin .dropdown-menu {
    height: auto !important;
  }

  /* Desktop profile label is intentionally short; the blue bar already shows the customer name. */
  #header #_desktop_ps_customersignin .header-block__title {
    white-space: nowrap;
  }

  /* Full, Hippoland-like desktop search field. */
  #header #_desktop_ps_searchbar.velv-search-full .ps-searchbar,
  #header #_desktop_ps_searchbar.velv-search-full .ps-searchbar__form {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  #header #_desktop_ps_searchbar.velv-search-full .ps-searchbar__form {
    position: relative;
    display: flex !important;
    align-items: center !important;
  }

  #header #_desktop_ps_searchbar.velv-search-full .ps-searchbar__input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 40px !important;
    min-height: 40px !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
  }

  #header #_desktop_ps_searchbar.velv-search-full .ps-searchbar__magnifier {
    margin-top: 0 !important;
    align-self: center !important;
  }

  /* Optional compact mode remains available from module settings. */
  #_desktop_ps_searchbar.velv-search-ready .ps-searchbar {
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
  }
  #_desktop_ps_searchbar.velv-search-ready .ps-searchbar__form {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 100% !important;
    margin: 0 !important;
  }
  #_desktop_ps_searchbar.velv-search-ready .ps-searchbar__magnifier {
    position: relative;
    z-index: 3;
    cursor: pointer;
    flex: 0 0 auto;
    margin: 0 !important;
  }
  #_desktop_ps_searchbar.velv-search-ready .ps-searchbar__input {
    transition: width .18s ease, opacity .15s ease, padding .18s ease, border-color .18s ease;
  }
  #_desktop_ps_searchbar.velv-search-collapsed {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
  }
  #_desktop_ps_searchbar.velv-search-collapsed .ps-searchbar,
  #_desktop_ps_searchbar.velv-search-collapsed .ps-searchbar__form {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
  }
  #_desktop_ps_searchbar.velv-search-collapsed .ps-searchbar__input {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    opacity: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-width: 0 !important;
    pointer-events: none !important;
  }
  #_desktop_ps_searchbar.velv-search-open {
    flex: 0 1 330px !important;
    width: min(330px, 30vw) !important;
    min-width: 220px !important;
    max-width: 330px !important;
  }
  #_desktop_ps_searchbar.velv-search-open .ps-searchbar,
  #_desktop_ps_searchbar.velv-search-open .ps-searchbar__form {
    width: 100% !important;
    max-width: 330px !important;
  }
  #_desktop_ps_searchbar.velv-search-open .ps-searchbar__input {
    width: min(280px, 25vw) !important;
    min-width: 180px !important;
    max-width: 280px !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

@media (max-width: 767px) {
  .velvetoo-topbar__inner {
    min-height: 0;
    padding: 8px 12px;
    display: flex;
    justify-content: center;
    gap: 10px;
  }

  .velvetoo-topbar__desktop-message { display: none; }
  .velvetoo-topbar__mobile-message { display: inline; }
  .velvetoo-topbar--mobile-center-only .velvetoo-topbar__left,
  .velvetoo-topbar--mobile-center-only .velvetoo-topbar__right { display: none; }
  .velvetoo-topbar__center { width: 100%; text-align: center; font-size: 13px; line-height: 1.25; }

  /* Mobile stays icon-only. Do not add desktop labels into the compact row. */
  #header .header-bottom .header-block__title,
  #header .velv-wishlist-tool--mobile .header-block__title {
    display: none !important;
  }

  #header .header-nav-full-width .menu-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* v0.2.3 - lock the compact mobile header to one deterministic row.
   Hummingbird renders: logo + displayTop tools + mobile account/cart placeholders.
   Explicit order prevents hook/class order from swapping the logo on very narrow screens. */
@media (max-width: 767px) {
  #header .header-bottom__container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  #header .header-bottom__row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 64px !important;
    gap: 0 !important;
  }

  #header .header-bottom__logo {
    order: 10 !important;
    flex: 0 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 8px !important;
  }

  #header .header-bottom__logo img {
    display: block !important;
    width: auto !important;
    max-width: 150px !important;
    max-height: 46px !important;
  }

  #header .header-bottom__row > .ps-searchbar--mobile {
    order: 20 !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-content: center !important;
  }

  #header #_mobile_velv_wishlist,
  #header .header-bottom__row > .velv-wishlist-tool--mobile {
    order: 30 !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-content: center !important;
  }

  #header #_mobile_ps_customersignin {
    order: 40 !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-content: center !important;
  }

  #header #_mobile_ps_shoppingcart {
    order: 50 !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-content: center !important;
  }

  #header .header-bottom__row .header-block,
  #header .header-bottom__row .header-block__action-btn,
  #header .velv-wishlist-link {
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    justify-content: center !important;
  }
}

/* Four tools must still fit beside the logo on 320-360 px phones. */
@media (max-width: 360px) {
  #header .header-bottom__logo img {
    max-width: 122px !important;
    max-height: 42px !important;
  }

  #header .header-bottom__logo {
    padding-right: 4px !important;
  }

  #header .header-bottom__row > .ps-searchbar--mobile,
  #header #_mobile_velv_wishlist,
  #header .header-bottom__row > .velv-wishlist-tool--mobile,
  #header #_mobile_ps_customersignin {
    flex-basis: 37px !important;
    width: 37px !important;
    min-width: 37px !important;
    max-width: 37px !important;
  }

  #header #_mobile_ps_shoppingcart {
    flex-basis: 41px !important;
    width: 41px !important;
    min-width: 41px !important;
    max-width: 41px !important;
  }
}

/* v0.2.4 - tighten the second mobile row without changing its order or functions. */
@media (max-width: 767px) {
  #header .header-bottom {
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  #header .header-bottom__container {
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  #header .header-bottom__row {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  #header .header-bottom__logo,
  #header .header-bottom__logo > a,
  #header .header-bottom__row > .ps-searchbar--mobile,
  #header #_mobile_velv_wishlist,
  #header .header-bottom__row > .velv-wishlist-tool--mobile,
  #header #_mobile_ps_customersignin,
  #header #_mobile_ps_shoppingcart {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    align-items: center !important;
  }

  #header .header-bottom__logo > a {
    display: flex !important;
  }

  #header .header-bottom__logo img {
    max-height: 38px !important;
  }

  #header .header-bottom__row .header-block,
  #header .header-bottom__row .header-block__action-btn,
  #header .velv-wishlist-link {
    min-height: 0 !important;
    height: auto !important;
  }
}

@media (max-width: 360px) {
  #header .header-bottom__row,
  #header .header-bottom__logo,
  #header .header-bottom__logo > a,
  #header .header-bottom__row > .ps-searchbar--mobile,
  #header #_mobile_velv_wishlist,
  #header .header-bottom__row > .velv-wishlist-tool--mobile,
  #header #_mobile_ps_customersignin,
  #header #_mobile_ps_shoppingcart {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
  }

  #header .header-bottom__logo img {
    max-height: 34px !important;
  }
}

/* v0.2.5 - desktop third row: a little more breathing room and stronger top-level category labels. */
@media (min-width: 768px) {
  #header .header-nav-full-width {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  #header .header-nav-full-width .ps-mainmenu__tree-link,
  #header .header-nav-full-width .ps-mainmenu__tree-dropdown-toggle {
    font-weight: 600 !important;
  }
}

/* v0.2.6 - desktop header rows sit flush together: no white gap and no divider lines. */
@media (min-width: 768px) {
  .velvetoo-topbar {
    margin-bottom: 0 !important;
    border-bottom: 0 !important;
  }

  #header .header-bottom {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
  }

  #header .header-bottom__container,
  #header .header-bottom__row {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
  }

  #header .header-nav-full-width {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
  }
}

/* v0.2.7 - remove the remaining desktop gap created by Hummingbird's displayBanner wrapper.
   The top information bar and the functional row should touch directly. */
@media (min-width: 768px) {
  #header .header-banner {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
  }

  #header .header-banner > .velvetoo-topbar {
    margin: 0 !important;
  }

  #header .header-banner + .header-bottom,
  #header .header-banner + .header-top + .header-bottom,
  #header .header-banner + .header-top + .header-bottom {
    margin-top: 0 !important;
  }
}

/* v0.2.8 - the remaining white band is the internal height of desktop row 2,
   not a separate wrapper. Tighten only the desktop functional row. */
@media (min-width: 768px) {
  #header .header-bottom,
  #header .header-bottom__container {
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  #header .header-bottom__row {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-items: center !important;
  }

  #header .header-bottom__logo {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    display: flex !important;
    align-items: center !important;
  }

  #header .header-bottom__logo > a {
    display: flex !important;
    align-items: center !important;
    height: 46px !important;
  }

  #header .header-bottom__logo img {
    max-height: 40px !important;
  }

  #header #_desktop_ps_searchbar,
  #header #_desktop_velv_wishlist,
  #header #_desktop_ps_customersignin,
  #header #_desktop_ps_shoppingcart {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    align-items: center !important;
  }

  #header #_desktop_ps_searchbar.velv-search-full .ps-searchbar__input {
    height: 36px !important;
    min-height: 36px !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }

  #header #_desktop_ps_customersignin .header-block,
  #header #_desktop_ps_shoppingcart .header-block {
    min-height: 36px !important;
  }
}

/* v0.2.9 - remove the exact residual Hummingbird spacer identified in DevTools.
   Desktop header-top is no longer needed after its account/cart tools are moved to header-bottom. */
@media (min-width: 768px) {
  #header .header-top,
  #header .header-top,
  #header .header-top.d-none.d-md-block {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  #header .header-banner,
  #header .header-bottom {
    margin-block: 0 !important;
    border-block: 0 !important;
    box-shadow: none !important;
  }

  /* Close any one-pixel seam left by theme rendering. */
  #header .header-bottom {
    margin-top: -1px !important;
  }
}

/* Mobile: remove the visible separator between row 2 and "Меню продукти". */
@media (max-width: 767px) {
  #header .header-bottom,
  #header .header-bottom__container,
  #header .header-bottom__row,
  #header .header-nav-full-width,
  #header .header-nav-full-width > *,
  #header .header-nav-full-width .container,
  #header .header-nav-full-width .row {
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;
  }

  #header .header-bottom::before,
  #header .header-bottom::after,
  #header .header-bottom__container::before,
  #header .header-bottom__container::after,
  #header .header-nav-full-width::before,
  #header .header-nav-full-width::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    box-shadow: none !important;
  }
}
/* =========================================================
   VELVETOO - CLEAN COMPACT DESKTOP CATEGORY MENU
   Hummingbird / ps_mainmenu
   ========================================================= */

@media (min-width: 768px) {

  /* Всяка главна категория е опорна точка */
  #header .header-nav-full-width
  .ps-mainmenu__tree > .ps-mainmenu__tree-item {
    position: relative !important;
  }

  /* Главният падащ панел */
  #header .header-nav-full-width
  .ps-mainmenu__tree > .ps-mainmenu__tree-item
  > .js-sub-menu.submenu[data-ps-ref="desktop-submenu"] {

    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: auto !important;

    width: 205px !important;
    min-width: 205px !important;
    max-width: 205px !important;

    height: auto !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    background: #fff !important;
    border: 1px solid #e8e8e8 !important;
    box-shadow: 0 6px 16px rgba(0,0,0,.10) !important;

    overflow: visible !important;
    z-index: 9999 !important;
  }

  /* Премахваме Bootstrap разтягането */
  #header .header-nav-full-width
  .js-sub-menu.submenu > .container {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;
  }

  #header .header-nav-full-width
  .js-sub-menu.submenu .submenu__row {
    position: relative !important;

    display: block !important;

    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    --bs-gutter-x: 0 !important;
    --bs-gutter-y: 0 !important;
  }

  /* Лявата колона с категориите */
  #header .header-nav-full-width
  .js-sub-menu.submenu .submenu__left {

    display: block !important;

    width: 100% !important;
    max-width: none !important;
    flex: none !important;

    margin: 0 !important;
    padding: 4px 0 !important;

    border: 0 !important;
  }

  /* ВСЕКИ РЕД – целият текст е кликаем */
  #header .header-nav-full-width
  .js-sub-menu.submenu
  a.submenu__left-item {

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    width: 100% !important;
    max-width: none !important;

    box-sizing: border-box !important;

    margin: 0 !important;
    padding: 5px 10px !important;

    font-size: 13px !important;
    line-height: 16px !important;
    font-weight: 500 !important;

    color: #333 !important;
    text-decoration: none !important;

    cursor: pointer !important;
    pointer-events: auto !important;
  }

  #header .header-nav-full-width
  .js-sub-menu.submenu
  a.submenu__left-item:hover,
  #header .header-nav-full-width
  .js-sub-menu.submenu
  a.submenu__left-item[aria-selected="true"] {

    background: #f5f5f5 !important;
    color: #168bd2 !important;
  }

  /* Второто ниво */
  #header .header-nav-full-width
  .js-sub-menu.submenu
  .submenu__right-items {

    display: none !important;

    position: absolute !important;

    top: 0 !important;
    left: 100% !important;
    right: auto !important;

    width: 210px !important;
    min-width: 210px !important;
    max-width: 210px !important;

    height: auto !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 4px 0 !important;

    background: #fff !important;
    border: 1px solid #e8e8e8 !important;

    box-shadow: 5px 6px 16px rgba(0,0,0,.10) !important;

    z-index: 10000 !important;
  }

  #header .header-nav-full-width
  .js-sub-menu.submenu
  .submenu__right-items.active {
    display: block !important;
  }

  /* Второто ниво – само вертикални редове */
  #header .header-nav-full-width
  .submenu__right-items
  ul.menu-item__group--nochild {

    display: block !important;

    width: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    list-style: none !important;
  }

  #header .header-nav-full-width
  .submenu__right-items
  ul.menu-item__group--nochild > li {

    display: block !important;

    width: 100% !important;

    margin: 0 !important;
    padding: 0 !important;
  }

  #header .header-nav-full-width
  .submenu__right-items
  a.menu-item__group-main-item {

    display: block !important;

    width: 100% !important;
    box-sizing: border-box !important;

    margin: 0 !important;
    padding: 5px 10px !important;

    font-size: 12.5px !important;
    line-height: 16px !important;
    font-weight: 500 !important;

    color: #333 !important;
    text-decoration: none !important;

    white-space: normal !important;

    cursor: pointer !important;
    pointer-events: auto !important;
  }

  #header .header-nav-full-width
  .submenu__right-items
  a.menu-item__group-main-item:hover {
    background: #f5f5f5 !important;
    color: #168bd2 !important;
  }
}