/* ============================================================
   Fonts
   ============================================================ */
/*-------------------------------------------*/
html, body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}
/*-------------------------------------------*/

@font-face {
  font-family: 'Fact';
  src: url('../fonts/Fact-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   Variables (CSS custom properties)
   ============================================================ */

:root {
  --color-white:    #ffffff;
  --color-orange:   #f96332;
  --color-black:    #221f1f;
  --color-gray:     #555770;
  --color-dark:     #1e1e1e;
  --color-promo:    #020203;
  --color-input-bg: #f2f4f8;
  --font:           'Fact', sans-serif;
}

/* ============================================================
   Base reset
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
}

img {
  display: block;
  max-width: 100%;
}

/* ============================================================
   Header — base
   ============================================================ */

.header {
  font-family: var(--font);
  position: relative;
  z-index: 100;
}

.header__container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================================
   1. Promo bar
   ============================================================ */

.header__promo {
  background-color: var(--color-promo);
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.header__promo-img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

/* ============================================================
   2. Utility bar
   ============================================================ */

.header__utility {
  background-color: var(--color-dark);
  height: 36px;
}

.header__utility .header__container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Обгортка lang dropdown */
.header__lang-wrap {
  position: relative;
}

.header__lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  list-style: none;
  background-color: var(--color-white);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 100%;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.30),
              0 2px 6px 2px rgba(0, 0, 0, 0.15);
}

.header__lang-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  text-align: left;
  color: var(--color-black);
  font-size: 14px;
  font-weight: 500;
  text-transform: capitalize;
  font-family: var(--font);
  transition: background-color 0.15s ease;
}

.header__lang-item:hover {
  background-color: var(--color-input-bg);
}

/* Поворот стрілки lang */
.header__lang-wrap .header__lang img {
  transition: transform 0.2s ease;
}

.header__lang-wrap.is-open .header__lang img {
  transform: rotate(180deg);
}

/* Обгортка contact dropdown */
.header__contact-wrap {
  position: relative;
}

.header__contact-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  width: 217px;
  background-color: var(--color-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.30),
              0 2px 6px 2px rgba(0, 0, 0, 0.15);
}

.header__contact-dropdown-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.header__contact-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #74777c;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  font-family: var(--font);
}

.header__contact-link img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.header__contact-link:hover span {
  text-decoration: underline;
}

.header__contact-info {
  color: #74777c;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  font-family: var(--font);
  margin: 0;
}

/* Поворот стрілки contact */
.header__contact-wrap .header__arrow {
  transition: transform 0.2s ease;
}

.header__contact-wrap.is-open .header__arrow {
  transform: rotate(180deg);
}

/* Обгортка для dropdown */
.header__location-wrap {
  position: relative;
}

/* Dropdown список міст */
.header__location-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  list-style: none;
  background-color: var(--color-white);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 100%;
  white-space: nowrap;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.30),
              0 2px 6px 2px rgba(0, 0, 0, 0.15);
}

.header__location-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  text-align: left;
  color: var(--color-black);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  font-family: var(--font);
  transition: background-color 0.15s ease;
}

.header__location-item:hover {
  background-color: var(--color-input-bg);
}

/* Поворот стрілки коли dropdown відкритий */
.header__location-wrap .header__arrow {
  transition: transform 0.2s ease;
}

.header__location-wrap.is-open .header__arrow {
  transform: rotate(180deg);
}

.header__location,
.header__contact {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-white);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  font-family: var(--font);
}

.header__location span,
.header__contact span {
  transition: color 0.2s ease;
}

.header__location-wrap:hover .header__location span,
.header__contact-wrap:hover .header__contact span {
  color: #f96332;
}

.header__location > img:first-child,
.header__contact > img:first-child {
  transition: filter 0.2s ease;
}

.header__location-wrap:hover .header__location > img:first-child,
.header__contact-wrap:hover .header__contact > img:first-child {
  filter: invert(52%) sepia(97%) saturate(512%) hue-rotate(337deg) brightness(101%);
}

.header__location > img:first-child,
.header__contact > img:first-child {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.header__arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.header__utility-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__socials {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header__social-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header__social-link:hover .header__social-icon {
  filter: invert(50%) sepia(90%) saturate(800%) hue-rotate(340deg) brightness(110%); /* → #f96332 */
}

.header__social-link--lg .header__social-icon {
  width: 32px;
  height: 32px;
}

.header__social-icon {
  display: block;
  width: 24px;
  height: 24px;
  transition: filter 0.2s ease;
}

/* ============================================================
   3. Main header
   ============================================================ */

.header__main {
  background-color: var(--color-white);
  position: relative;
  z-index: 100; /* вище за cat-menu-overlay (99) */
}

/* Навігація (desktop, абсолютна) */
.header__nav {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  z-index: 1;
  pointer-events: none;
}

.header__nav-link {
  pointer-events: auto;
  color: var(--color-black);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.header__nav-link:hover {
  color: var(--color-orange);
}

/* Внутрішній flex-рядок */
.header__inner {
  display: flex;
  align-items: center;
  width: 100%;
}

/* Бургер (за замовчуванням прихований) */
.header__burger {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header__burger img {
  width: 24px;
  height: 24px;
}

/* Логотип */
.header__logo {
  display: block;
  flex-shrink: 0;
}

.header__logo-img {
  display: block;
}

/* Кнопка "Категорії" */
.header__categories {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--color-orange);
  border-radius: 8px;
  height: 48px;
  width: 200px;
  flex-shrink: 0;
  color: var(--color-white);
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font);
  transition: background-color 0.2s ease;
}

.header__categories img {
  width: 24px;
  height: 24px;
}

.header__categories:hover {
  background-color: #e0572c;
}

/* Пошук */
.header__search {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--color-input-bg);
  border-radius: 8px;
  padding: 0 16px;
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  transition: border-color 0.2s ease;
  margin-top: 10px;
}

.header__search:hover {
  border-color: #18181b;
}

.header__search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--color-gray);
}

.header__search-input::placeholder {
  color: var(--color-gray);
}

.header__search-input::-webkit-search-decoration,
.header__search-input::-webkit-search-cancel-button,
.header__search-input::-webkit-search-results-button,
.header__search-input::-webkit-search-results-decoration {
  display: none;
}

.header__search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header__search-btn img {
  width: 24px;
  height: 24px;
}

/* Група іконок */
.header__actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

/* Вибір мови */
.header__lang {
  display: flex;
  align-items: center;
  color: var(--color-black);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  font-family: var(--font);
}

.header__lang span {
  transition: color 0.2s ease;
}

.header__lang-wrap:hover .header__lang span {
  color: #f96332;
}

.header__lang img {
  width: 24px;
  height: 24px;
}

/* Іконки дій */
.header__action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.header__badge {
    position: absolute;
    top: -6px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    background: #F96332;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.header__action-btn:hover .header__action-icon {
  filter: invert(50%) sepia(90%) saturate(800%) hue-rotate(340deg) brightness(110%); /* → #f96332 */
}

.header__action-icon {
  display: block;
  width: 24px;
  height: 24px;
  transition: filter 0.2s ease;
}

/* ============================================================
   Desktop  ≥ 1200px
   ============================================================ */

@media (min-width: 1200px) {

  .header__main {
    height: 128px;
  }

  .header__main .header__container {
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-bottom: 16px;
  }

  .header__inner {
    gap: 32px;
  }

  .header__logo-img {
    width: 84px;
    height: 96px;
  }

  .header__search {
    height: 48px;
  }
}

/* ============================================================
   Tablet  ≤ 1199px
   ============================================================ */

@media (max-width: 1199px) {

  /* Прихований utility bar */
  .header__utility {
    display: none;
  }

  /* Прихована навігація */
  .header__nav {
    display: none;
  }

  /* Показуємо бургер */
  .header__burger {
    display: flex;
  }

  /* Ховаємо категорії */
  .header__categories {
    display: none;
  }

  .header__inner {
    gap: 16px;
  }

  .header__main .header__container {
    padding-top: 16px;
    padding-bottom: 16px;
    padding-left: 24px;
    padding-right: 24px;
  }

  .header__logo-img {
    width: 32px;
    height: 36px;
  }

  .header__search {
    height: 32px;
  }
}

/* ============================================================
   Mobile  ≤ 767px
   ============================================================ */

@media (max-width: 767px) {

  .header__promo {
    height: 24px;
  }

  .header__main .header__container {
    padding: 16px;
  }

  /* Фіксована ширина пошуку */
  .header__search {
    width: 223px;
  }

  /* Ховаємо мову */
  .header__lang {
    display: none;
  }

  /* Ховаємо акаунт, порівняти, збережені */
  .header__action-btn--no-mobile {
    display: none;
  }
}
