/* ============================================================
   Fonts
============================================================ */

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

/* ============================================================
   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: 'Fact', sans-serif;
}

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

/* ============================================================
   Footer
============================================================ */

.footer {
  font-family: 'Fact', sans-serif;
  background-color: #ffffff;
  margin: 0;
  padding: 0;
}

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

/* ============================================================
   1. TOP — соцмережі / контакти / підписка
============================================================ */

.footer__top {
  border-bottom: 32px solid #f5f5f4;
}

.footer__top .footer__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  padding-bottom: 32px;
}

.footer__group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100px;
}

.footer__section-head {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 40px;
}

.footer__section-title {
  font-size: 16px;
  font-weight: 700;
  color: #221f1f;
  line-height: 1;
  margin: 0;
}

.footer__section-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: #555770;
  line-height: 1;
}

.footer__social-list {
  display: flex;
  gap: 16px;
  align-items: center;
  height: 60px;
  list-style: none;
}

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.footer__social-link img {
  width: 40px;
  height: 40px;
  transition: filter 0.2s ease;
}

.footer__social-link:hover img {
  filter: brightness(0) saturate(0) brightness(0.13); /* → #221f1f */
}

.footer__phone-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 60px;
}

.footer__phone-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.footer__phone-numbers {
  font-size: 18px;
  font-weight: 400;
  color: #221f1f;
  line-height: 1;
  white-space: nowrap;
}
.footer__phone-numbers:hover {
    color: #221f1f;
}

.footer__subscribe-form {
  display: flex;
  gap: 16px;
  align-items: center;
  height: 60px;
}

.footer__input {
  flex: 0 0 294px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  font-family: 'Fact', sans-serif;
  font-size: 14px;
  color: #766f6e;
  outline: none;
  transition: border-color 0.2s ease;
}

.footer__input::placeholder { color: #766f6e; }
.footer__input:hover { border-color: #18181b; }
.footer__input:focus { border-color: #f96332; }

.footer__btn {
  flex: 1;
  height: 40px;
  padding: 8px 10px;
  background-color: #f96332;
  border-radius: 8px;
  font-family: 'Fact', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  line-height: 20px;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.footer__btn:hover { background-color: #fc9e75; }

/* ============================================================
   2. ORANGE DIVIDER
============================================================ */

.footer__divider {
  height: 12px;
  background-color: #f96332;
}

/* ============================================================
   3. NAV — 5 колонок посилань (desktop) / акордеон (tablet+mobile)
============================================================ */

.footer__nav-section .footer__container {
  display: flex;
  justify-content: space-between;
  padding-top: 32px;
  padding-bottom: 32px;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Заголовок колонки: на desktop — без кліків і без стрілки */
.footer__col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  font-family: 'Fact', sans-serif;
  text-align: left;
  cursor: default;
  pointer-events: none;
}

.footer__col-title {
  font-size: 20px;
  font-weight: 700;
  color: #221f1f;
  line-height: 1;
  flex: 1;
  margin: 0;
}

/* Стрілка — прихована на desktop */
.footer__col-arrow {
  display: none;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.footer__col-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  line-height: 1.85;
  margin: 0;
}

.footer__col-link {
  font-size: 16px;
  font-weight: 400;
  color: #555770;
  line-height: 1;
  transition: color 0.2s ease;
}

.footer__col-link:hover { color: #f96332; }

/* ============================================================
   4. BOTTOM — копірайт + міста
============================================================ */

.footer__copyright-bar {
  border-top: 2px solid #e3e3e3;
  border-bottom: 2px solid #e3e3e3;
}

.footer__copyright-bar .footer__container {
  padding-top: 16px;
  padding-bottom: 16px;
}

.footer__copyright-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.footer__logo-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.footer__logo-teplo { color: #ff8c00; }
.footer__logo-kram  { color: #008000; }

.footer__copyright-text {
  font-size: 14px;
  color: #555770;
  line-height: 20px;
}

.footer__partner-link {
  font-size: 14px;
  color: #f96332;
  line-height: 20px;
  transition: opacity 0.2s ease;
}

.footer__partner-link:hover {
  opacity: 0.8;
  color: #f96332;
}

.footer__partner-caption {
  font-size: 14px;
  color: #555770;
  line-height: 20px;
}

.footer__cities-wrap .footer__container {
  position: relative;
  padding-top: 8px;
  padding-bottom: 32px;
}

.footer__cities-text {
  font-size: 14px;
  color: #555770;
  line-height: 20px;
  padding-right: 24px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}

.footer__cities-text.is-expanded {
  display: block;
  overflow: visible;
}

.footer__cities-toggle {
  position: absolute;
  right: 32px;
  top: 16px;
  width: 9px;
  height: 5px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.footer__cities-toggle img { width: 9px; height: 5px; display: block; }
.footer__cities-toggle.is-expanded { transform: rotate(180deg); }

/* ============================================================
   Responsive — Tablet (768px – 1199px)
============================================================ */

@media (max-width: 1199px) {

  .footer__container {
    padding: 0 24px;
  }

  /* --- TOP секція: Grid 2 колонки --- */

  .footer__top {
    border-bottom: 16px solid #f5f5f4;
  }

  .footer__top .footer__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "social contacts"
      "subscribe subscribe";
    gap: 16px 24px;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .footer__group {
    height: auto;
  }

  .footer__group--social {
    grid-area: social;
    justify-content: space-between;
    gap: 8px;
  }

  .footer__group--contacts {
    grid-area: contacts;
    justify-content: center;
    gap: 8px;
  }

  .footer__group--subscribe {
    grid-area: subscribe;
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .footer__section-head {
    height: auto;
    gap: 4px;
    justify-content: flex-start;
  }

  .footer__group--subscribe .footer__section-head {
    flex: 1;
  }

  .footer__group--subscribe .footer__subscribe-form {
    flex: 1;
  }

  .footer__social-list {
      height: auto;
      margin: 0;
  }

  .footer__phone-wrap {
    height: auto;
    gap: 8px;
  }

  .footer__phone-icon {
    width: 32px;
    height: 32px;
  }

  .footer__phone-numbers {
    font-size: 14px;
    white-space: normal;
  }

  .footer__subscribe-form {
    height: auto;
    gap: 8px;
  }

  .footer__input {
    flex: 1;
    min-width: 0;
  }

  /* --- NAV: акордеон --- */

  .footer__nav-section .footer__container {
    flex-direction: column;
    gap: 0;
    padding-top: 24px;
    padding-bottom: 0;
  }

  .footer__col {
    gap: 0;
    border-bottom: 1px solid #766f6e;
    padding: 16px 0;
  }

  .footer__col:first-child { padding-top: 0; }

  .footer__col:last-child {
    border-bottom: none;
    padding-bottom: 24px;
  }

  .footer__col-header {
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    pointer-events: auto;
  }

  .footer__col-arrow {
    display: block;
    transform: rotate(180deg); /* стрілка вниз = закрито */
  }

  .footer__col.is-open .footer__col-arrow {
    transform: rotate(0deg); /* стрілка вверх = відкрито */
  }

  .footer__col-list {
    display: none;
    padding-top: 16px;
  }

  .footer__col.is-open .footer__col-list {
    display: flex;
  }

  /* --- BOTTOM --- */

  .footer__copyright-bar {
    border-top: 1px solid #766f6e;
    border-bottom: 1px solid #766f6e;
  }

  .footer__copyright-text,
  .footer__partner-link,
  .footer__partner-caption {
    font-size: 12px;
  }

  .footer__cities-wrap .footer__container {
    padding-top: 8px;
    padding-bottom: 24px;
  }

  .footer__cities-text {
    font-size: 12px;
    line-height: 16px;
  }

  .footer__cities-toggle {
    right: 24px;
  }
}

/* ============================================================
   Responsive — Mobile (до 767px)
============================================================ */

@media (max-width: 767px) {

  .footer__container {
    padding: 0 16px;
  }

  /* --- TOP секція: flex-col, все стекується вертикально --- */

  .footer__top .footer__container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
  }

  .footer__group {
    gap: 8px;
    width: 100%;
  }

  .footer__group--subscribe {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 16px;
  }

  /* Заголовки секцій: gap-4px */
  .footer__section-head {
    gap: 4px;
  }

  /* Підпис стає коричневим на мобільному */
  .footer__section-subtitle {
    color: #766f6e;
    margin: 0;
  }

  /* Години роботи — два рядки в колонку */
  .footer__section-subtitle--hours {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  /* Підписка: label та форма — full width */
  .footer__group--subscribe .footer__section-head,
  .footer__group--subscribe .footer__subscribe-form {
    flex: none;
    width: 100%;
  }

  /* Форма залишається row: input фіксований + кнопка flex */
  .footer__subscribe-form {
    gap: 8px;
  }

  .footer__input {
    flex: 0 0 200px;
  }

  .footer__btn {
    flex: 1;
  }

  /* --- BOTTOM --- */

  .footer__copyright-bar {
    border-top-color: #8b8080;
    border-bottom-color: #8b8080;
  }

  .footer__cities-toggle {
    right: 16px;
  }
}
