﻿/* Menu module */

.header {
  height: 68px;
  border-bottom: 1px solid #f3eee9;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1500
}

.header .wrap {
  height: 100%;
  display: flex !important;
  align-items: center;
  gap: 28px;
  position: relative
}

.logo {
  flex: 0 0 auto
}

.logo img {
  width: 200px;
  height: auto;
  display: block
}

.nav {
  display: flex;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  flex: 1;
  justify-content: center;
  white-space: nowrap
}

.nav-group {
  position: relative
}

.nav a,
.nav-link {
  padding: 10px 12px;
  border-radius: 10px;
  transition: .2s
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer
}

.nav-link:after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: .2s
}

.nav-group:hover .nav-link,
.nav-group:focus-within .nav-link,
.nav a:hover,
.nav a:focus-visible {
  color: #ff6400;
  background: #fff4ea;
  outline: 0
}

.nav-group:hover .nav-link:after,
.nav-group:focus-within .nav-link:after {
  transform: rotate(225deg) translate(-2px, -1px)
}

.mega-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 270px;
  padding: 10px;
  border: 1px solid #f0e2d8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(73, 42, 22, .16);
  display: grid;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: .2s;
  z-index: 1805
}

.nav-group:last-child .mega-menu {
  left: auto;
  right: 0
}

.mega-menu:before {
  content: "";
  position: absolute;
  left: 24px;
  top: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #f0e2d8;
  border-top: 1px solid #f0e2d8;
  transform: rotate(45deg)
}

.nav-group:last-child .mega-menu:before {
  left: auto;
  right: 24px
}

.nav-group:hover .mega-menu,
.nav-group:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0)
}

.mega-menu a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 10px;
  white-space: normal
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto
}

.burger {
  width: 40px;
  height: 40px;
  border: 1px solid #f0e2d8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(93, 54, 31, .08);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: .2s;
  flex: 0 0 40px
}

.burger:hover,
.burger:focus-visible {
  border-color: #ffc49a;
  box-shadow: 0 12px 24px rgba(255, 106, 0, .13);
  outline: 0
}

.burger span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #ff6400;
  transition: .2s
}

.burger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg)
}

.burger.is-active span:nth-child(2) {
  opacity: 0
}

.burger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg)
}

.mobile-menu {
  position: fixed;
  top: 80px;
  right: max(24px, calc((100vw - 1280px)/2 + 24px));
  width: min(460px, calc(100vw - 48px));
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  border: 1px solid #f0e2d8;
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 24px 60px rgba(73, 42, 22, .16);
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  z-index: 1600
}

.mobile-menu::-webkit-scrollbar {
  width: 8px
}

.mobile-menu::-webkit-scrollbar-track {
  background: #fff3e8;
  border-radius: 999px
}

.mobile-menu::-webkit-scrollbar-thumb {
  background: #ff9d54;
  border-radius: 999px
}

.mobile-menu.is-open {
  display: grid
}

.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 800;
  color: #231f20;
  transition: .2s
}

.mobile-menu-group {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #f5e8de
}

.mobile-menu-group b {
  padding: 3px 4px 6px;
  color: #ff6400;
  font-size: 14px
}

.mobile-menu-group a {
  min-height: 36px;
  padding: 8px 9px;
  font-size: 13px;
  font-weight: 750;
  background: #fff
}

.mobile-menu a:hover,
.mobile-menu a:focus-visible {
  background: #fff4ea;
  color: #ff6400;
  outline: 0
}

.mobile-menu .mobile-add {
  grid-column: 1/-1;
  justify-content: center;
  margin-top: 6px;
  min-height: 44px;
  color: #fff;
  background: linear-gradient(135deg, #ff8b15, #ff6400);
  box-shadow: 0 10px 20px rgba(255, 106, 0, .2)
}

.mobile-menu .mobile-add:hover {
  color: #fff;
  background: linear-gradient(135deg, #ff982c, #ff6400)
}

@media(min-width:1101px) {
  .mobile-menu.is-open {
    display: none
  }
}

.heart {
  font-size: 27px;
  color: #8d5f42;
  line-height: 1
}

.btn,
.searchbtn {
  border: 0;
  border-radius: 10px;
  padding: 13px 22px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #eee2d8;
  font-weight: 600;
  cursor: pointer;
  transition: .25s;
  white-space: nowrap;
  font-size: 14px;
}

.btn.primary,
.searchbtn {
  background: linear-gradient(135deg, #ff8b15, #ff6400);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 106, 0, .24)
}

.btn:hover,
.searchbtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(255, 106, 0, .2)
}


/* Mobile menu visibility fix after CSS modularization */
@media (max-width: 1024px) {
  .nav {
    display: none;
  }

  .burger {
    display: inline-flex;
  }

  .header .wrap {
    justify-content: space-between;
    gap: 14px;
  }

  .mobile-menu {
    right: 24px;
    width: min(520px, calc(100vw - 48px));
  }

  .mobile-title,
  .mobile-menu-group b {
    padding: 3px 4px 6px;
    color: #ff6400;
    font-size: 14px;
    font-weight: 900;
  }
}

@media (max-width: 640px) {
  .mobile-menu {
    right: 14px;
    width: calc(100vw - 28px);
    top: var(--mobile-header-h, 64px);
    max-height: calc(100dvh - var(--mobile-header-h, 64px));
  }
}

/* Header search (all resolutions) */
.search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #eee2d8;
  border-radius: 10px;
  background: #fff;
  color: #231f20;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: .25s;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px #eee2d8;
}

.search-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-toggle:hover,
.search-toggle:focus-visible,
.search-toggle[aria-expanded="true"] {
  transform: translateY(-2px);
  border-color: #ffc49a;
  background: #fff4ea;
  color: #ff6400;
  box-shadow: 0 14px 28px rgba(255, 106, 0, .2);
  outline: 0;
}

.header-search {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 1700;
  width: 100%;
  max-width: 100%;
  padding: 16px 18px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 182, 123, .35);
  border-radius: 0 0 20px 20px;
  background:
    radial-gradient(circle at top right, rgba(255, 128, 36, .12), transparent 34%),
    linear-gradient(180deg, #fffdfb 0%, #ffffff 55%, #fff8f2 100%);
  box-shadow: 0 28px 70px rgba(73, 42, 22, .18);
  backdrop-filter: blur(14px);
}

.header-search:not([hidden]) {
  animation: headerSearchDrop .22s ease-out;
}

.header-search-top {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.header-search-top strong {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.header-search-top span {
  color: #786b63;
  font-size: 13px;
  line-height: 1.4;
}

.header-search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.header-search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid #f0ddd0;
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
  box-shadow: inset 0 0 0 1px rgba(255, 239, 228, .95);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.header-search-field svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: #9a7b66;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-search-form input {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #231f20;
}

.header-search-form input::placeholder {
  color: #9b8d85;
}

.header-search-field:focus-within {
  border-color: #ffc49a;
  background: #fff;
  box-shadow: 0 0 0 4px #fff1e6, inset 0 0 0 1px rgba(255, 214, 184, .7);
}

.header-search-form input:focus {
  outline: 0;
}

.header-search-form button {
  min-width: 118px;
  height: 54px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff8b15, #ff6400);
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(255, 106, 0, .22);
  transition: transform .2s ease, box-shadow .2s ease;
}

.header-search-form button:hover,
.header-search-form button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(255, 106, 0, .28);
  outline: 0;
}

.header-search-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.header-search-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #f1e1d5;
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  color: #5f5148;
  font-size: 13px;
  font-weight: 800;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.header-search-links a:hover,
.header-search-links a:focus-visible {
  border-color: #ffc49a;
  background: #fff1e6;
  color: #ff6400;
  transform: translateY(-1px);
  outline: 0;
}

@keyframes headerSearchDrop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .search-toggle span { display: none; }
  .search-toggle { padding: 0 10px; min-width: 40px; justify-content: center; }
  .header-search {
    position: fixed;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    top: var(--mobile-header-h, 64px);
    padding: 14px;
    border-radius: 0 0 18px 18px;
    box-sizing: border-box;
  }
  .header-search-form {
    grid-template-columns: 1fr;
  }
  .header-search-field,
  .header-search-form button {
    min-height: 50px;
    height: 50px;
  }
  .header-search-form button {
    width: 100%;
  }
}

/* Unified header controls: Search + Login */
.actions .search-toggle,
.actions .login-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #eee2d8 !important;
  border-radius: 10px;
  background: #fff !important;
  color: #231f20 !important;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px #eee2d8;
  transition: .25s;
}

.actions .search-toggle:hover,
.actions .search-toggle:focus-visible,
.actions .search-toggle[aria-expanded="true"],
.actions .login-btn:hover,
.actions .login-btn:focus-visible {
  transform: none;
  border-color: #ffc49a !important;
  background: #fff4ea !important;
  color: #ff6400 !important;
  box-shadow: 0 14px 28px rgba(255, 106, 0, .2);
  outline: 0;
}

/* Final strict sync: Search and Login must look identical */
.header .actions .search-toggle,
.header .actions .login-btn {
  font-family: Inter, Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;

  min-height: 40px !important;
  height: 40px !important;
  padding: 0 12px !important;

  border: 1px solid #eee2d8 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #231f20 !important;

  box-shadow: inset 0 0 0 1px #eee2d8 !important;
  transform: none !important;
  transition: transform .25s, border-color .25s, background-color .25s, color .25s, box-shadow .25s !important;
}

.header .actions .search-toggle:hover,
.header .actions .search-toggle:focus-visible,
.header .actions .search-toggle[aria-expanded="true"],
.header .actions .login-btn:hover,
.header .actions .login-btn:focus-visible {
  border: 1px solid #ffc49a !important;
  background: #fff4ea !important;
  color: #ff6400 !important;
  box-shadow: 0 14px 28px rgba(255, 106, 0, .2) !important;
  transform: none !important;
  outline: 0 !important;
}

.header .actions .login-btn .login-text,
.header .actions .search-toggle span {
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

/* Always show icon inside Login button */
.header .actions .login-btn {
  gap: 8px !important;
}

.header .actions .login-btn .login-icon {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
}

.header .actions .login-btn .login-text {
  display: inline !important;
}

/* Login button visual fix */
.header .actions .login-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  line-height: 1 !important;
}

.header .actions .login-btn .login-icon {
  width: 16px !important;
  height: 16px !important;
  display: block !important;
  flex: 0 0 16px !important;
}

.header .actions .login-btn .login-icon path:first-child {
  fill: currentColor !important;
  stroke: none !important;
}

.header .actions .login-btn .login-icon path:last-child {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* Login icon (left side) - updated glyph */
.header .actions .login-btn .login-icon {
  order: -1;
  width: 16px !important;
  height: 16px !important;
  display: block !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.header .actions .login-btn .login-icon path {
  fill: none !important;
  stroke: currentColor !important;
}

/* Search button: icon only */
.header .actions .search-toggle span {
  display: none !important;
}

.header .actions .search-toggle {
  width: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
  justify-content: center !important;
}

/* Final mobile layout for header/menu (when burger is visible) */
@media (max-width: 1024px) {
  .header .wrap {
    position: relative !important;
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
    column-gap: 10px !important;
  }

  .header .logo {
    justify-self: start !important;
    margin-right: 0 !important;
  }

  .header .nav {
    display: none !important;
  }

  .header .actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    justify-self: end !important;
    margin-left: auto !important;
  }

  .header .burger {
    display: inline-flex !important;
    justify-self: end !important;
    margin-left: 0 !important;
    flex: 0 0 auto !important;
    position: relative !important;
    z-index: 1801 !important;
  }

  .header .mobile-menu,
  .header .mobile-menu.is-open {
    position: fixed !important;
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
    margin: 0 !important;
    transform: none !important;
    top: var(--mobile-header-h, 68px) !important;
    max-height: calc(100dvh - var(--mobile-header-h, 68px) - 14px) !important;
    height: auto !important;
    overflow-y: auto !important;
    z-index: 1800 !important;
  }
}



/* Global header safety guards across breakpoints */
.header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1900 !important;
}

.header .wrap {
  min-height: 68px;
}

@media (max-width: 1024px) {
  .header {
    min-height: var(--mobile-header-h, 68px) !important;
  }

  .header .wrap {
    min-height: var(--mobile-header-h, 68px) !important;
  }

  .header .mobile-menu,
  .header .mobile-menu.is-open {
    top: var(--mobile-header-h, 68px) !important;
    max-height: calc(100dvh - var(--mobile-header-h, 68px) - 14px) !important;
  }
}

@media (max-width: 640px) {
  .header {
    min-height: var(--mobile-header-h, 64px) !important;
  }

  .header .wrap {
    min-height: var(--mobile-header-h, 64px) !important;
  }

  .header .mobile-menu,
  .header .mobile-menu.is-open {
    top: var(--mobile-header-h, 64px) !important;
    max-height: calc(100dvh - var(--mobile-header-h, 64px) - 12px) !important;
  }
}

/* Tablet header tuning: keep actions in frame near 1106px */
@media (max-width: 1200px) and (min-width: 901px) {
  .header .wrap {
    gap: 10px !important;
  }

  .header .nav {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .header .actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
  }

}

/* Mobile header scroll fix when burger is visible */
@media (max-width: 1024px) {
  .header {
    overflow: visible !important;
  }

  .header .wrap {
    overflow: visible !important;
    min-height: var(--mobile-header-h, 68px) !important;
  }

  .header .actions {
    overflow: visible !important;
  }

  .header .mobile-menu,
  .header .mobile-menu.is-open {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
}

/* Header compact mode for medium widths */
@media (max-width: 1220px) and (min-width: 901px) {
  .header .wrap {
    gap: 14px !important;
  }

  .header .nav {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: visible !important;
    gap: 2px !important;
  }

  .header .actions {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  .header .nav-link,
  .header .nav a {
    padding: 10px 9px !important;
  }

}

/* Fix CTA text rendering in header */
@media (max-width: 1220px) and (min-width: 901px) {
  .header .actions .add {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
  }
}

/* Logo + burger alignment fix (tablet/mobile) */
@media (max-width: 1024px) {
  .header .logo,
  .header .burger {
    align-self: center !important;
  }

  .header .logo {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 40px !important;
  }

  .header .logo img {
    display: block !important;
    height: auto !important;
    width: 200px !important;
  }

  .header .burger {
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
  }
}

/* Global edge alignment: logo left, burger right (all widths) */
.header .wrap {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  justify-content: space-between !important;
}

.header .logo {
  justify-self: start !important;
  margin: 0 !important;
}

.header .nav {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.header .actions {
  flex: 0 0 auto !important;
  justify-content: flex-end !important;
  margin-left: auto !important;
}

.header .burger {
  margin: 0 !important;
}

@media (max-width: 1024px) {
  .header .wrap {
    grid-template-columns: auto 1fr auto auto !important;
  }

  .header .actions .add {
    display: none !important;
  }
}

/* Burger visibility rule: show only when mega-nav is hidden */
.header .burger {
  display: none !important;
}

@media (max-width: 1024px) {
  .header .nav.mega-nav {
    display: none !important;
  }

  .header .burger {
    display: inline-flex !important;
  }
}

@media (max-width: 1099px) {
  .header .actions .login-btn {
    width: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .header .actions .login-btn .login-text {
    display: none !important;
  }
}

/* Pin "Добавить питомник" to the right inside actions */
.header .actions .add {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  height: 40px !important;
  padding: 0 22px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  margin-left: auto !important;
}

/* Hard fix: place "Добавить питомник" at the far right of actions */
.header .actions {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

.header .actions .add {
  order: 99 !important;
  margin-left: auto !important;
  margin-right: 0 !important;
}

@media (max-width: 1024px) {
  .header .actions .add {
    display: none !important;
  }
}

.header .actions .heart {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border: 1px solid #eee2d8 !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: inset 0 0 0 1px #eee2d8 !important;
  color: #8d5f42 !important;
  font-size: 22px !important;
  line-height: 1 !important;
  transition: transform .25s, border-color .25s, background-color .25s, color .25s, box-shadow .25s !important;
}

.header .actions .heart:hover,
.header .actions .heart:focus-visible {
  border-color: #ffc49a !important;
  background: #fff4ea !important;
  box-shadow: 0 14px 28px rgba(255, 106, 0, .2) !important;
  color: #ff6400 !important;
  transform: none !important;
  outline: 0 !important;
}

.header .burger:hover,
.header .burger:focus-visible,
.header .burger:active {
  transform: none !important;
}

.header .actions .heart:hover::before,
.header .actions .heart:focus-visible::before {
  content: none;
}

.header .actions .heart .favorites-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8b15, #ff6400);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 6px 14px rgba(255, 106, 0, .26);
}

@media (max-width: 640px) {
  .header .actions {
    gap: 4px !important;
  }

  .header .actions .heart {
    width: 40px !important;
    min-width: 40px !important;
  }
}

/* Mobile edge stretch: keep header controls aligned to screen edges */
@media (max-width: 640px) {
  .header .wrap {
    width: 100% !important;
    max-width: none !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center !important;
    column-gap: 6px !important;
  }

  .header .logo {
    justify-self: start !important;
    min-width: 0 !important;
  }

  .header .logo img {
    width: clamp(132px, 38vw, 170px) !important;
    height: auto !important;
  }

  .header .actions {
    justify-self: end !important;
    margin-left: 0 !important;
    gap: 4px !important;
  }

  .header .burger {
    justify-self: end !important;
    margin-left: 0 !important;
  }
}

/* Default pages (incl. index): keep header in the base container */
@media (min-width: 641px) {
  body:not(.catalog-page-body) .header .wrap {
    width: min(1280px, calc(100% - 48px)) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Catalog page: match header width to catalog content container
   (единые поля с базовым .wrap: 24px на мобиле, 48px на десктопе) */
@media (min-width: 641px) and (max-width: 760px) {
  body.catalog-page-body .header .wrap {
    width: calc(100% - 24px) !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media (min-width: 761px) and (max-width: 1024px) {
  body.catalog-page-body .header .wrap {
    width: calc(100% - 48px) !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media (min-width: 1025px) and (max-width: 1333px) {
  body.catalog-page-body .header .wrap {
    width: calc(100% - 48px) !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Mobile menu full-height under header */
@media (max-width: 1024px) {
  .header .mobile-menu,
  .header .mobile-menu.is-open {
    top: var(--mobile-header-h, 68px) !important;
    bottom: 0 !important;
    height: calc(100dvh - var(--mobile-header-h, 68px)) !important;
    max-height: calc(100dvh - var(--mobile-header-h, 68px)) !important;
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 640px) {
  .header .mobile-menu,
  .header .mobile-menu.is-open {
    top: var(--mobile-header-h, 64px) !important;
    height: calc(100dvh - var(--mobile-header-h, 64px)) !important;
    max-height: calc(100dvh - var(--mobile-header-h, 64px)) !important;
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }
}

/* ==========================================================================
   Live search suggestions (new-ui addition, assets/js/search.js)
   Выпадающие подсказки формы .header-search-form (backend: /ajax_search.php)
   ========================================================================== */
.header-search-form {
  position: relative;
}

.header-search-suggest {
  grid-column: 1 / -1;
  margin-top: 4px;
  max-height: min(60vh, 440px); /* длинный список прокручивается, а не уходит за экран */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #f0ddd0 transparent;
  border: 1px solid #f0ddd0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(35, 31, 32, .14);
  z-index: 40;
}

.header-search-suggest[hidden] {
  display: none;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #231f20;
  text-decoration: none;
  border-bottom: 1px solid #f7ece3;
  transition: background-color .15s ease;
}

.suggest-item:last-child {
  border-bottom: 0;
}

.suggest-item:hover,
.suggest-item.is-active {
  background: #fff4ea;
}

.suggest-type {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f7ece3;
  color: #9a7b66;
  font-size: 12px;
  font-weight: 700;
  text-transform: lowercase;
}

.suggest-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-empty {
  padding: 14px 16px;
  font-size: 14px;
  color: #9b8d85;
}

/* ==========================================================================
   Cookie bar (Stage 2, ported from old footer; markup in layout/footer.inc.php)
   ========================================================================== */
.cookie-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  background: #231f20;
  color: #fff;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .2);
}

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

.cookie-content span {
  font-size: 14px;
  line-height: 1.5;
}

.cookie-content a {
  color: #ffb27a;
}

.cookie-btn {
  flex: 0 0 auto;
  min-width: 64px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 20px;
  font: inherit;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff8b15, #ff6400);
  cursor: pointer;
}

.cookie-btn:hover {
  transform: translateY(-1px);
}

/* Строка поиска на странице /search/ — та же форма, что в шапке,
   но без живых подсказок (data-suggest не ставим) и во всю ширину колонки */
.search-page-form {
  margin-top: 16px;
  margin-bottom: 4px;
}

@media (max-width: 640px) {
  .search-page-form {
    grid-template-columns: 1fr;
  }

  .search-page-form button {
    width: 100%;
  }
}
