/* === Шапка === */
.header {
  background: #fff;
  border-bottom: none;
  flex-shrink: 0;
  z-index: 1001;
}
.header-inner {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  flex-shrink: 0;
}

.header-logo img {
  height: 46px;
  width: auto;
}

/* Бургер */
.btn-burger {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a2825;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.btn-burger .icon { width: 20px; height: 20px; }
.btn-burger:hover { opacity: 0.5; }

/* Поиск в шапке (десктоп) */
.header-search {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.header-search-form {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}
.header-search-input {
  width: 100%;
  height: 40px;
  border: none;
  background: #f5f5f3;
  padding: 0 42px 0 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: #2a2825;
  outline: none;
  transition: background-color 0.2s;
  border-radius: 0;
  -webkit-appearance: none;
}
.header-search-input:focus {
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.header-search-input::placeholder {
  color: transparent; /* скрываем нативный — у нас анимированный */
}
.header-search-placeholder {
  position: absolute;
  left: 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: rgba(42,40,37,0.45);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}
.header-search-placeholder.typing {
  color: rgba(42,40,37,0.6);
}
.header-search-placeholder.hidden {
  opacity: 0;
}
.header-search-submit {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  width: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a2825;
  transition: opacity 0.2s;
  border-radius: 0;
}
.header-search-submit .icon { width: 18px; height: 18px; }
.header-search-submit:hover { opacity: 0.5; }

/* Кнопки иконок справа */
.header-btn {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s;
  position: relative;
}
.header-btn .icon { width: 22px; height: 22px; }
.header-btn:hover { opacity: 0.5; }
.header-btn:focus { outline: none; -webkit-tap-highlight-color: transparent; }

/* Лупа мобильная — скрыта на десктопе */
.header-btn-search {
  display: none;
}

/* Счётчик корзины */
.header-cart-count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  background: #2a2825;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 16px;
  text-align: center;
}
.header-cart-count:empty { display: none; }

/* Мобильный поиск (раскрывается поверх шапки) */
.header-search-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  z-index: 1100;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.header-search-mobile.open {
  display: flex;
}
.header-search-mobile .header-search-form {
  flex: 1;
}
.header-search-close {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a2825;
  flex-shrink: 0;
}
.header-search-close .icon { width: 18px; height: 18px; }
/* Выпадающий список поиска */
.search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  z-index: 100;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: none;
}
.search-dropdown::-webkit-scrollbar { display: none; }
.search-dropdown.open { display: block; animation: searchFadeIn 150ms ease; }

@keyframes searchFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-dropdown--mobile {
  position: fixed;
  top: 64px;
  left: 8px;
  right: 8px;
  max-height: 70dvh;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  z-index: 1101;
  background: #fff;
}

.search-blur-bg {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1100;
  pointer-events: none;
}
.search-blur-bg.open { display: block; }

.search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 150ms;
  text-decoration: none;
  color: inherit;
}
.search-item:hover { background: #f5f4f2; }
.search-item + .search-item { border-top: 1px solid rgba(0,0,0,0.04); }

.search-item__img {
  width: 44px;
  height: 56px;
  flex-shrink: 0;
  overflow: hidden;
  background: #faf9f7;
}
.search-item__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.search-item__info { flex: 1; min-width: 0; }
.search-item__name {
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-item__meta {
  font-size: 12px;
  font-weight: 300;
  color: var(--secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item__price {
  font-family: var(--font-heading);
  font-size: 15px;
  flex-shrink: 0;
  white-space: nowrap;
}
.search-item__price .rub {
  font-family: var(--font-body);
  font-weight: 200;
  font-size: 13px;
}

.search-item__add {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 150ms;
  margin-left: 8px;
}
.search-item__add:hover { opacity: 0.7; }
.search-item__add.added { opacity: 0.5; }

.search-empty {
  padding: 24px 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 300;
  color: var(--secondary);
}

.search-all {
  display: block;
  padding: 12px 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  border-top: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
  transition: background 150ms;
}
.search-all:hover { background: #f5f4f2; }


/* Меню категорий под шапкой */
.header-categories {
  background: #fff;
  border-bottom: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  flex-shrink: 0;
  overflow: hidden;
  max-height: 48px;
  transition: max-height 0.35s ease, opacity 0.35s ease;
}
.header-categories-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.header-categories-inner::-webkit-scrollbar { display: none; }
.header-categories.hidden {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
}
.header.has-shadow {
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.header-cat-link {
  display: block;
  padding: 12px clamp(8px, 1.2vw, 18px);
  font-family: var(--font-body);
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #2a2825;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.header-cat-link:hover {
  background: var(--primary);
  color: #fff;
}

/* Планшет и мобилка — меню категорий скрыто, поиск за лупой */
@media (max-width: 1023px) {
  .header-categories { display: none; }
  .header-search { display: none; }
  .header-btn-search { display: flex; margin-left: auto; }
}

/* Мобилка — компактная шапка */
@media (max-width: 767px) {
  .header-inner {
    height: 56px;
    padding: 0 8px;
    gap: 8px;
  }
  .header-logo img {
    height: 36px;
  }
}


/* === Bottom Widget === */
.bottom-widget {
  flex-shrink: 0;
  padding: 8px var(--pad-x) 10px;
  background: var(--bg-white);
  border-top: none;
  z-index: 40;
  display: none;
}

/* Строка подбора (корзина) — видна когда есть товары */
.widget-pickup {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: var(--bg);
  cursor: pointer;
  transition: background var(--fast);
}
.widget-pickup.has-items { display: flex; }
.widget-pickup:hover { background: var(--accent-light); }

.widget-pickup-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
}
.widget-pickup-left strong { font-weight: 500; }

.widget-pickup-sum {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}

/* Строка чат-ввода */
.widget-chat {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  padding: 8px 12px;
  border: 1px solid var(--border);
  transition: border-color var(--fast);
}
.widget-chat:focus-within { border-color: var(--accent); }

.widget-chat .green-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.widget-chat input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 350;
  color: var(--primary);
  background: none;
}
.widget-chat input::placeholder { color: var(--secondary); }

.widget-chat .send-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  transition: all var(--fast);
  flex-shrink: 0;
}
.widget-chat .send-btn:hover { border-color: var(--primary); color: var(--primary); }


/* === Overlay (затемнение для меню/лендинга) === */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: all var(--medium);
}
.overlay.open { opacity: 1; visibility: visible; }


/* === Боковое меню (слева) === */
.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-white);
  z-index: 1060;
  transform: translateX(-100%);
  transition: transform var(--medium);
  overflow-y: auto;
  padding: 20px;
  box-shadow: 8px 0 30px rgba(0,0,0,0.08);
}
.side-menu.open { transform: translateX(0); }

.menu-close {
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--fast);
}
.menu-close:hover { color: var(--primary); }

.menu-section-title {
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin: 24px 0 12px;
}

.menu-link {
  display: block;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 350;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  transition: color var(--fast);
}
.menu-link:hover { color: var(--accent-dark); }

.menu-footer-link {
  display: block;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 350;
  color: var(--primary);
  text-decoration: none;
  transition: opacity var(--fast);
}
.menu-footer-link:hover { opacity: 0.6; }

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.menu-request-btn {
  width: 100%;
  height: 40px;
  background: var(--primary);
  color: var(--bg-white);
  border: none;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: opacity var(--fast), box-shadow var(--fast);
  margin-top: 8px;
}
.menu-request-btn:hover { opacity: 0.85; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3); }


/* === Боковой лендинг (справа) === */
.side-landing {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-white);
  z-index: 1060;
  transform: translateX(100%);
  transition: transform var(--medium);
  overflow-y: auto;
  padding: 24px;
  box-shadow: -8px 0 30px rgba(0,0,0,0.08);
}
.side-landing.open { transform: translateX(0); }

.landing-logo { margin: 16px 0 4px; }
.landing-logo img { height: 32px; }
.landing-logo-sub {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 350;
  color: var(--secondary);
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.landing-heading {
  font-family: var(--font-heading);
  font-size: 16px;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.landing-text {
  font-size: 13px;
  font-weight: 350;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.landing-adv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 350;
  color: var(--primary);
}

.landing-adv-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-dark);
  flex-shrink: 0;
}

.landing-contacts-title {
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.landing-contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 350;
}

.landing-contact-icon {
  width: 16px;
  height: 16px;
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-tg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  background: var(--primary);
  color: var(--bg-white);
  border: none;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 20px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: opacity var(--fast), box-shadow var(--fast);
}
.landing-tg-btn:hover { opacity: 0.85; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3); }

.landing-legal-title {
  font-size: 11px;
  font-weight: 400;
  color: var(--secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.landing-legal-text {
  font-size: 11px;
  font-weight: 350;
  color: var(--secondary);
  line-height: 1.8;
}
