/* ==============================================
   FARIZON THEME — Header & Footer Styles
   farizon.css
   ============================================== */

/* -----------------------------------------------
   CSS VARIABLES
----------------------------------------------- */
:root {
  --fz-bg:        #191919;
  --fz-bg-2:      #222222;
  --fz-gold:      #dfb66f;
  --fz-white:     #ffffff;
  --fz-white-80:  rgba(255, 255, 255, 0.8);
  --fz-divider:   rgba(255, 255, 255, 0.12);
  --fz-transition: 0.22s ease;
}

/* -----------------------------------------------
   BASE RESET (scoped to header/footer)
----------------------------------------------- */
.site-header *,
.mobile-header *,
.mobile-menu *,
.site-footer * {
  box-sizing: border-box;
}

/* -----------------------------------------------
   DESKTOP HEADER
----------------------------------------------- */
.site-header {
  background: var(--fz-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 58px;
  padding: 12px 120px;
  height: 64px;
  max-width: 1512px;
  margin: 0 auto;
}

/* Logo */
.header-logo {
  flex-shrink: 0;
  height: 40px;
  width: 292px;
  display: block;
}
.header-logo img,
.header-logo .header-logo__img {
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: left center;
}

/* Desktop Nav */
.header-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 4px 8px;
  font-family: 'Roboto Flex', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--fz-white);
  white-space: nowrap;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--fz-transition);
}
.nav-item:hover,
.nav-item.active { color: var(--fz-gold); }

.nav-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform var(--fz-transition);
}
.nav-item--dropdown.open .nav-chevron { transform: rotate(180deg); }

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* CTA Button */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--fz-white);
  color: var(--fz-bg);
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 25px;
  padding: 7.5px 20px;
  border-radius: 31px;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--fz-transition), color var(--fz-transition);
}
.btn-cta:hover {
  background: var(--fz-gold);
  color: var(--fz-bg);
}

/* Language Switcher */
.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}
.lang-switcher__label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 25px;
  color: var(--fz-gold);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.lang-switcher__arrow {
  width: 18px;
  height: 18px;
  color: var(--fz-gold);
  transition: transform var(--fz-transition);
}
.lang-switcher.open .lang-switcher__arrow { transform: rotate(180deg); }

.lang-switcher__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: -11px;
  background: var(--fz-white);
  border: 1px solid rgba(25, 25, 25, 0.1);
  border-radius: 4px;
  box-shadow: 0 0 4px rgba(0,0,0,.04), 0 4px 8px rgba(0,0,0,.06);
  width: 85px;
  overflow: hidden;
  display: none;
  z-index: 110;
}
.lang-switcher.open .lang-switcher__dropdown { display: block; }

.lang-option {
  display: block;
  padding: 8px 16px;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 25px;
  color: var(--fz-bg);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.lang-option.active { color: var(--fz-gold); }
.lang-option:hover  { background: rgba(25,25,25,.06); }

/* -----------------------------------------------
   MEGA MENU (Desktop Dropdown)
----------------------------------------------- */
.mega-menu {
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  background: var(--fz-bg);
  display: none;
  justify-content: center;
  padding: 57.5px 120px;
  z-index: 99;
  border-top: 1px solid rgba(255,255,255,.06);
}
.mega-menu.open { display: flex; }

.mega-menu__grid {
  display: flex;
  gap: 50px;
  align-items: flex-start;
}

.mega-menu__item {
  width: 242px;
  flex-shrink: 0;
  text-decoration: none;
  display: block;
}
.mega-menu__item-img {
  width: 100%;
  aspect-ratio: 600 / 400;
  border-radius: 4px;
  overflow: hidden;
}
.mega-menu__item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.mega-menu__item:hover .mega-menu__item-img img { transform: scale(1.03); }
.mega-menu__item-img--placeholder { background: var(--fz-bg-2); }

.mega-menu__item-name {
  font-family: 'Roboto Flex', sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: normal;
  color: var(--fz-white);
  margin-top: 8px;
  padding-left: 8px;
  transition: color var(--fz-transition);
  text-align: center;
}
.mega-menu__item:hover .mega-menu__item-name { color: var(--fz-gold); }

/* -----------------------------------------------
   MOBILE HEADER
----------------------------------------------- */
.mobile-header {
  display: none;
  background: var(--fz-bg);
  height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-logo {
  display: block;
  height: 36px;
}
.mobile-logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: left;
}

.burger-btn {
  width: 24px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.burger-btn span {
  display: block;
  height: 2px;
  background: #E3E3E3;
  border-radius: 1px;
  transition: all var(--fz-transition);
}

/* -----------------------------------------------
   MOBILE MENU OVERLAY
----------------------------------------------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--fz-bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  height: 64px;
  flex-shrink: 0;
}

.close-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.close-btn img,
.close-btn svg { width: 24px; height: 24px; display: block; }

.mobile-menu__body {
  display: flex;
  flex-direction: column;
  gap: 45px;
  padding: 50px 16px;
  flex: 1;
}

/* Mobile lang */
.mobile-lang {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 0 8px;
  height: 40px;
}
.mobile-lang a {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 25px;
  color: var(--fz-white);
  text-decoration: none;
}
.mobile-lang a.active { color: var(--fz-gold); }

/* Mobile nav list */
.mobile-nav { display: flex; flex-direction: column; gap: 16px; }

/* Plain nav item */
.mobile-nav__item {
  display: flex;
  align-items: center;
  padding: 0 8px;
  height: 40px;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 25px;
  color: var(--fz-white);
  text-decoration: none;
  transition: color var(--fz-transition);
}
.mobile-nav__item:hover,
.mobile-nav__item.active { color: var(--fz-gold); }

/* Accordion */
.mobile-accordion {
  background: var(--fz-bg-2);
  border-radius: 8px;
  overflow: visible; /* НЕ hidden — щоб картинки не обрізались */
}

.mobile-accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  height: 40px;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 25px;
  color: var(--fz-white);
  cursor: pointer;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
}

.accordion-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--fz-white);
  transition: transform var(--fz-transition);
}
.mobile-accordion.open .accordion-chevron { transform: rotate(180deg); }

.mobile-accordion__content { display: none; }
.mobile-accordion.open .mobile-accordion__content { display: block; }

/* Car items inside accordion */
.mobile-car-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px;
  min-height: 89px;
  text-decoration: none;
  transition: background var(--fz-transition);
  border-radius: 6px;
}
.mobile-car-item:hover { background: rgba(255,255,255,.04); }

/* Розміри задаються inline зі сторони PHP Walker — ці стилі як підстраховка */
.mobile-car-img {
  width: 101px;
  min-width: 101px;
  max-width: 101px;
  height: 73px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.mobile-car-img--placeholder {
  display: block;
  background: var(--fz-bg);
}

.mobile-car-name {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 25px;
  color: var(--fz-white);
  flex: 1;
}

/* Mobile CTA */
.mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fz-white);
  color: var(--fz-bg);
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 25px;
  padding: 7.5px 20px;
  border-radius: 31px;
  text-decoration: none;
  text-align: center;
  transition: background var(--fz-transition);
}
.mobile-cta:hover { background: var(--fz-gold); }

/* Mobile contacts */
.mobile-contacts { display: flex; flex-direction: column; gap: 25px; }
.mobile-contacts__title {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 25px;
  color: var(--fz-white);
}
.mobile-contacts__info { display: flex; flex-direction: column; gap: 16px; }
.mobile-contacts__info a {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 25px;
  color: var(--fz-white);
  text-decoration: none;
  transition: color var(--fz-transition);
}
.mobile-contacts__info a:hover { color: var(--fz-gold); }

/* -----------------------------------------------
   FOOTER
----------------------------------------------- */
.site-footer {
  background: var(--fz-bg);
  position: relative;
  /* overflow: hidden прибрано — він обрізав .footer-bg-lines */
}

/* Background decorative lines — верхній лівий кут футера */
.footer-bg-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 536px;
  height: 308px;
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}
.footer-bg-lines img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Footer top area */
.footer-top {
  max-width: 1512px;
  margin: 0 auto;
  padding: 100px 120px 60px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 0 40px;
  align-items: start;
  position: relative;
  z-index: 1;
}

/* Brand col */
.footer-brand__logo {
  display: block;
  height: 40px;
  margin-bottom: 25px;
  text-decoration: none;
}
.footer-brand__logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
  object-position: left center;
}
.footer-brand__text {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 25px;
  color: var(--fz-white);
  max-width: 395px;
}

/* Footer sections */
.footer-section__title {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 25px;
  color: var(--fz-white);
  margin-bottom: 25px;
  margin-top: 0;
}
.footer-section__links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-link {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 25px;
  color: var(--fz-white);
  text-decoration: none;
  transition: color var(--fz-transition);
  display: block;
}
.footer-link:hover,
.footer-link.active { color: var(--fz-gold); }

/* Footer bottom */
.footer-bottom {
  max-width: 1512px;
  margin: 0 auto;
  padding: 0 120px 0;
  position: relative;
  z-index: 1;
}
.footer-divider {
  height: 1px;
  background: var(--fz-bg-2);
}
.footer-copy {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 25px;
  color: var(--fz-white-80);
  padding: 9px 0;
  margin: 0;
}

/* -----------------------------------------------
   RESPONSIVE
----------------------------------------------- */

/* 1400px — компактніший десктоп хедер */
@media (max-width: 1400px) {
  .header-inner { padding: 12px 40px; gap: 24px; }
  .header-logo  { width: 200px; }
  .nav-item     { font-size: 14px; padding: 4px 6px; }
  .btn-cta      { font-size: 14px; padding: 7px 14px; }
}

/* 1100px — перехід на мобільне меню */
@media (max-width: 1100px) {
  .site-header   { display: none; }
  .mobile-header { display: flex; }
  .mega-menu     { display: none !important; }
}

/* Footer — планшет */
@media (max-width: 1100px) {
  .footer-top    { padding: 80px 40px 50px; }
  .footer-bottom { padding: 0 40px; }
}

/* Footer — мобільний */
@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    padding: 80px 24px 50px;
    gap: 40px;
  }
  .footer-bottom { padding: 0 24px; }
  .footer-bg-lines { display: none; }
  .footer-brand__text { max-width: 100%; }
}
