﻿/* Основная подложка хедера */
.main-header {
    background-color: #FFFFFF;
    padding: 12px 0;
    border-bottom: 1px solid var(--brand-accent);
}

/* Флекс-контейнер для выравнивания в ряд */
.header-flex {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr) auto;
    align-items: center;
    gap: clamp(12px, 1.6vw, 20px);
}

.mobile-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #A8C8A0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    background: #FFFFFF;
}

.mobile-nav-toggle > span:not(.sr-only) {
    width: 16px;
    height: 2px;
    background: #1E3A2B;
    border-radius: 10px;
}

/* Логотип: фиксируем размер, чтобы не "разносило" хедер */
.logo img {
    height: 52px; /* Чистый знак должен читаться рядом с крупной поисковой плашкой */
    width: auto;
    display: block;
}

/* Current wholesale direction stays next to the logo without adding a header row. */
#header-module .logo.header-logo-with-context {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
#header-module .header-logo-with-context > a { flex-shrink: 0; }
.header-wholesale-context {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding-left: 10px;
    border-left: 2px solid var(--brand-dark, #1E3A2B);
    white-space: nowrap;
    color: var(--brand-dark, #1E3A2B);
}
.header-wholesale-context[hidden] { display: none !important; }
.header-wholesale-label { font-size: 14px; font-weight: 500; line-height: 1.15; }
.header-wholesale-context strong { font-size: 18px; font-weight: 700; line-height: 1.15; }
@media (max-width: 768px) {
    #header-module .logo.header-logo-with-context { gap: 8px; }
    .header-wholesale-context { padding-left: 8px; }
    .header-wholesale-context strong { font-size: 17px; }
}

/* Поиск-плашка */
.search-wrapper {
    width: 100%;
    min-width: 0;
    max-width: 620px; /* Ограничиваем ширину поиска */
    display: flex;
    align-items: center;
    background-color: #FFFFFF;
    border-radius: 18px;
    min-height: 54px;
    padding: 5px 10px 5px 14px;
    border: 1px solid rgba(168, 200, 160, 0.7);
    box-shadow: 0 14px 30px rgba(30, 58, 43, 0.08);
    justify-self: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.search-wrapper:focus-within {
    border-color: #A8C8A0;
    box-shadow: 0 18px 36px rgba(30, 58, 43, 0.14);
}

.search-wrapper input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 10px 10px 10px 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1E3A2B;
    outline: none;
}

.search-wrapper input::placeholder {
    color: rgba(30, 58, 43, 0.48);
}

.search-wrapper input[type="search"]::-webkit-search-cancel-button {
    display: none;
}

.search-btn {
    background: none;
    border: none;
    color: #1E3A2B;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    order: -1;
    width: 44px;
    height: 44px;
    gap: 8px;
    padding: 0;
    border-radius: 14px;
    flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.search-btn:hover {
    background: var(--brand-accent);
}

.search-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.1;
    flex-shrink: 0;
}

.search-btn-label {
    display: none;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

/* Правая часть: телефон и иконки */
.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-self: end;
    min-width: 0;
}

.phone {
    display: none;
}

.icon-group {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.header-cart-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 184px;
    min-height: 48px;
    padding: 9px 14px 9px 11px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1E3A2B 0%, #1E3A2B 100%);
    color: #FFFFFF;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(30, 58, 43, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.header-cart-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(30, 58, 43, 0.24);
}

.header-cart-icon {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    flex-shrink: 0;
}

.header-cart-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.header-cart-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
}

.header-cart-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.88);
}

.header-cart-meta span[data-cart-count-label] {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-cart-separator {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
}

/* Круглые кнопки действий */
.icon-circle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--brand-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    color: #000000;
    transition: all 0.2s ease;
    text-decoration: none;
}

.header-contact-link {
    width: auto;
    min-width: 132px;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    color: #1E3A2B;
    font-weight: 800;
}

.header-contact-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.header-contact-label {
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.icon-circle-account {
    width: auto;
    min-width: 156px;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    color: #1E3A2B;
    font-weight: 800;
}

.icon-circle-account svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.icon-circle-label {
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.account-label-short {
    display: none;
}

.icon-circle:hover {
    border-color: #A8C8A0; /* Цвет при наведении */
}

/* Золотая монета бонусов */
.bonus-coin {
    background-color: #A8C8A0;
    color: #1E3A2B;
    border: none;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

/* Бейдж корзины */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #1E3A2B;
    color: #FFFFFF;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.cart-badge.is-empty {
    opacity: 0;
    transform: scale(0.75);
}

@media (max-width: 768px) {
    .header-flex {
        display: flex;
        flex-wrap: wrap;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        order: 2;
    }

    .search-wrapper {
        order: 4;
        width: 100%;
        max-width: none;
    }

    .header-actions {
        margin-left: auto;
        order: 3;
        gap: 10px;
        justify-self: auto;
    }

    .header-cart-link {
        min-width: 184px;
    }
}

@media (max-width: 640px) {
    .main-header {
        padding: 10px 0;
    }

    .logo img {
        height: 44px;
    }

    .header-flex {
        gap: 12px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .icon-group {
        gap: 8px;
    }

    .icon-circle {
        width: 38px;
        height: 38px;
    }

    .icon-circle-account {
        min-width: 52px;
        gap: 3px;
        padding: 0 8px;
        flex-direction: column;
    }

    .icon-circle-account svg {
        width: 16px;
        height: 16px;
    }

    .icon-circle-label {
        font-size: 10px;
    }

    .account-label-full {
        display: none;
    }

    .account-label-short {
        display: inline;
    }

    .header-contact-link {
        min-width: 106px;
        padding: 0 11px;
    }

    .header-cart-link {
        min-width: 0;
        flex: 1;
        justify-content: center;
    }

    .header-cart-meta {
        gap: 6px;
    }

    .header-cart-meta span[data-cart-count-label] {
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* contact-icons-unified-v2 */
.contact-card__icon,
.contact-method__icon,
.contact-channel__icon,
.contact-icon,
.contacts-page .contact-card [class*="icon"],
.contact-page .contact-card [class*="icon"],
.contacts-section .contact-card [class*="icon"],
.contact-section .contact-card [class*="icon"],
.contact-card > [class*="icon"]:first-child {
  width: 58px !important;
  min-width: 58px !important;
  height: 58px !important;
  min-height: 58px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--color-primary, var(--green-dark, #183f2c)) !important;
  border: 1px solid var(--color-primary, var(--green-dark, #183f2c)) !important;
  color: var(--color-white, #fff) !important;
  box-shadow: 0 12px 26px rgba(24, 63, 44, 0.16) !important;
  font-weight: 800 !important;
  font-size: 14px !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  overflow: hidden !important;
}

.contact-card__icon svg,
.contact-method__icon svg,
.contact-channel__icon svg,
.contact-icon svg,
.contacts-page .contact-card [class*="icon"] svg,
.contact-page .contact-card [class*="icon"] svg,
.contacts-section .contact-card [class*="icon"] svg,
.contact-section .contact-card [class*="icon"] svg,
.contact-card > [class*="icon"]:first-child svg {
  width: 26px !important;
  height: 26px !important;
  color: currentColor !important;
  stroke: currentColor !important;
}

.contact-card__icon svg *:not([fill="none"]),
.contact-method__icon svg *:not([fill="none"]),
.contact-channel__icon svg *:not([fill="none"]),
.contact-icon svg *:not([fill="none"]),
.contacts-page .contact-card [class*="icon"] svg *:not([fill="none"]),
.contact-page .contact-card [class*="icon"] svg *:not([fill="none"]),
.contacts-section .contact-card [class*="icon"] svg *:not([fill="none"]),
.contact-section .contact-card [class*="icon"] svg *:not([fill="none"]),
.contact-card > [class*="icon"]:first-child svg *:not([fill="none"]) {
  fill: currentColor !important;
}

.contact-card__icon img,
.contact-method__icon img,
.contact-channel__icon img,
.contact-icon img,
.contacts-page .contact-card [class*="icon"] img,
.contact-page .contact-card [class*="icon"] img,
.contacts-section .contact-card [class*="icon"] img,
.contact-section .contact-card [class*="icon"] img,
.contact-card > [class*="icon"]:first-child img {
  width: 26px !important;
  height: 26px !important;
  object-fit: contain !important;
  filter: brightness(0) invert(1) !important;
}

/* contact-icons-unified-v3 */
.contact-card__icon,
.contact-method__icon,
.contact-channel__icon,
.contact-icon,
.contacts-page .contact-card [class*="icon"],
.contact-page .contact-card [class*="icon"],
.contacts-section .contact-card [class*="icon"],
.contact-section .contact-card [class*="icon"],
.contact-card > [class*="icon"]:first-child {
  width: 58px !important;
  min-width: 58px !important;
  height: 58px !important;
  min-height: 58px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--color-primary, var(--green-dark, #183f2c)) !important;
  border: 1px solid var(--color-primary, var(--green-dark, #183f2c)) !important;
  color: var(--color-white, #fff) !important;
  box-shadow: 0 12px 26px rgba(24, 63, 44, 0.16) !important;
  font-weight: 800 !important;
  font-size: 14px !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  overflow: hidden !important;
}

.contact-card__icon svg,
.contact-method__icon svg,
.contact-channel__icon svg,
.contact-icon svg,
.contacts-page .contact-card [class*="icon"] svg,
.contact-page .contact-card [class*="icon"] svg,
.contacts-section .contact-card [class*="icon"] svg,
.contact-section .contact-card [class*="icon"] svg {
  width: 26px !important;
  height: 26px !important;
  color: currentColor !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.2 !important;
}

.contact-card__icon img,
.contact-method__icon img,
.contact-channel__icon img,
.contact-icon img,
.contacts-page .contact-card [class*="icon"] img,
.contact-page .contact-card [class*="icon"] img,
.contacts-section .contact-card [class*="icon"] img,
.contact-section .contact-card [class*="icon"] img {
  width: 27px !important;
  height: 27px !important;
  object-fit: contain !important;
  filter: brightness(0) invert(1) !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
}

.contact-card__icon::before,
.contact-method__icon::before,
.contact-channel__icon::before,
.contact-icon::before,
.contacts-page .contact-card [class*="icon"]::before,
.contact-page .contact-card [class*="icon"]::before,
.contacts-section .contact-card [class*="icon"]::before,
.contact-section .contact-card [class*="icon"]::before {
  color: currentColor !important;
}

/* contact-icons-unified-v4 */
.contact-card [class*="icon"],
.contact-card [class*="logo"],
.contacts-card [class*="icon"],
.contacts-card [class*="logo"],
.contact-method [class*="icon"],
.contact-method [class*="logo"],
.contacts-method [class*="icon"],
.contacts-method [class*="logo"],
.contacts-grid [class*="icon"],
.contacts-grid [class*="logo"],
.contacts-list [class*="icon"],
.contacts-list [class*="logo"],
.contact-links [class*="icon"],
.contact-links [class*="logo"] {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    min-height: 58px !important;
    border-radius: 999px !important;
    display: inline-grid !important;
    place-items: center !important;
    background: #1b4330 !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 14px 28px rgba(27, 67, 48, 0.16) !important;
    overflow: hidden !important;
}

.contact-card [class*="icon"]::before,
.contact-card [class*="icon"]::after,
.contact-card [class*="logo"]::before,
.contact-card [class*="logo"]::after,
.contacts-card [class*="icon"]::before,
.contacts-card [class*="icon"]::after,
.contacts-card [class*="logo"]::before,
.contacts-card [class*="logo"]::after,
.contact-method [class*="icon"]::before,
.contact-method [class*="icon"]::after,
.contact-method [class*="logo"]::before,
.contact-method [class*="logo"]::after,
.contacts-method [class*="icon"]::before,
.contacts-method [class*="icon"]::after,
.contacts-method [class*="logo"]::before,
.contacts-method [class*="logo"]::after {
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.contact-card [class*="icon"] svg,
.contact-card [class*="logo"] svg,
.contacts-card [class*="icon"] svg,
.contacts-card [class*="logo"] svg,
.contact-method [class*="icon"] svg,
.contact-method [class*="logo"] svg,
.contacts-method [class*="icon"] svg,
.contacts-method [class*="logo"] svg,
.contacts-grid [class*="icon"] svg,
.contacts-grid [class*="logo"] svg,
.contacts-list [class*="icon"] svg,
.contacts-list [class*="logo"] svg,
.contact-links [class*="icon"] svg,
.contact-links [class*="logo"] svg {
    width: 28px !important;
    height: 28px !important;
    color: #ffffff !important;
    stroke: currentColor !important;
}

.contact-card [class*="icon"] svg [stroke],
.contact-card [class*="logo"] svg [stroke],
.contacts-card [class*="icon"] svg [stroke],
.contacts-card [class*="logo"] svg [stroke],
.contact-method [class*="icon"] svg [stroke],
.contact-method [class*="logo"] svg [stroke],
.contacts-method [class*="icon"] svg [stroke],
.contacts-method [class*="logo"] svg [stroke],
.contacts-grid [class*="icon"] svg [stroke],
.contacts-grid [class*="logo"] svg [stroke],
.contacts-list [class*="icon"] svg [stroke],
.contacts-list [class*="logo"] svg [stroke],
.contact-links [class*="icon"] svg [stroke],
.contact-links [class*="logo"] svg [stroke] {
    stroke: currentColor !important;
}

.contact-card [class*="icon"] svg [fill]:not([fill="none"]),
.contact-card [class*="logo"] svg [fill]:not([fill="none"]),
.contacts-card [class*="icon"] svg [fill]:not([fill="none"]),
.contacts-card [class*="logo"] svg [fill]:not([fill="none"]),
.contact-method [class*="icon"] svg [fill]:not([fill="none"]),
.contact-method [class*="logo"] svg [fill]:not([fill="none"]),
.contacts-method [class*="icon"] svg [fill]:not([fill="none"]),
.contacts-method [class*="logo"] svg [fill]:not([fill="none"]),
.contacts-grid [class*="icon"] svg [fill]:not([fill="none"]),
.contacts-grid [class*="logo"] svg [fill]:not([fill="none"]),
.contacts-list [class*="icon"] svg [fill]:not([fill="none"]),
.contacts-list [class*="logo"] svg [fill]:not([fill="none"]),
.contact-links [class*="icon"] svg [fill]:not([fill="none"]),
.contact-links [class*="logo"] svg [fill]:not([fill="none"]) {
    fill: currentColor !important;
}

.contact-card [class*="icon"] img,
.contact-card [class*="logo"] img,
.contacts-card [class*="icon"] img,
.contacts-card [class*="logo"] img,
.contact-method [class*="icon"] img,
.contact-method [class*="logo"] img,
.contacts-method [class*="icon"] img,
.contacts-method [class*="logo"] img,
.contacts-grid [class*="icon"] img,
.contacts-grid [class*="logo"] img,
.contacts-list [class*="icon"] img,
.contacts-list [class*="logo"] img,
.contact-links [class*="icon"] img,
.contact-links [class*="logo"] img {
    width: 28px !important;
    height: 28px !important;
    object-fit: contain !important;
    filter: brightness(0) invert(1) !important;
    mix-blend-mode: normal !important;
}
/* end-contact-icons-unified-v4 */

