/* =========================================================
   LOCO Header — v1.0.2
   ========================================================= */

/* fix scroll-jump when opening mobile overlay */
html{ scrollbar-gutter: stable; }

/* Токени доступні всім елементам (шапка, мобільний оверлей, майбутні модулі) */
:root{
  --loco-primary:   var(--ltk-blue-500, #1F65E9);
  --loco-secondary: var(--ltk-blue-600, #1E56C3);
  --loco-text:      var(--ltk-neutral-600, #415170);
  --loco-accent:    var(--ltk-neutral-900, #1E1E1E);
  --loco-blue-muted:#B5CBF2;
  --loco-border:    #DCE7F8;
  --loco-grad:      var(--ltk-grad-header, linear-gradient(90deg,#034DCF 55%,#3074F9 96%));
}

.loco-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 999;
  color: #fff !important;
  background: var(--loco-grad);
  font-family: 'Gilroy','Inter',system-ui,sans-serif !important;
  transition: transform .35s cubic-bezier(.4,0,.2,1),
              box-shadow .35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.loco-header__spacer{
  height: 104px;
  transition: height .35s cubic-bezier(.4,0,.2,1);
}

.loco-header__inner{
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 20px 48px;
  min-height: 104px;
  max-width: 1760px;
  margin: 0 auto;
  transition: min-height .35s cubic-bezier(.4,0,.2,1),
              padding    .35s cubic-bezier(.4,0,.2,1);
}

.loco-header.is-condensed{ box-shadow: 0 4px 20px rgba(3,42,120,.25); }
.loco-header.is-condensed .loco-header__inner{
  min-height: 76px;
  padding-top: 14px; padding-bottom: 14px;
}
.loco-header.is-condensed + .loco-header__spacer,
.loco-header.is-condensed ~ .loco-header__spacer{ height: 76px; }
.loco-header.is-hidden{ transform: translateY(-100%); }

/* Logo */
.loco-header__logo{
  display: inline-flex; align-items: center;
  flex: 0 0 auto;
  text-decoration: none !important;
  color: #fff !important;
}
.loco-header__logo img{
  display: block;
  height: 40px;
  width: auto;
  transition: height .35s cubic-bezier(.4,0,.2,1);
}
.loco-header.is-condensed .loco-header__logo img{ height: 32px; }
.loco-header__logo--text{
  font-weight: 800; font-size: 22px; color: #fff; letter-spacing: -0.02em;
}

/* =========================================================
   NAV — PILL ITEMS
   ========================================================= */
.loco-nav{
  display: flex;
  gap: 4px;
  flex: 1;
  align-items: center;
}
.loco-nav__item{
  position: relative;
  padding: 10px 18px;
  color: #fff !important;
  font-weight: 400 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1.5px solid transparent;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
  text-decoration: none !important;
}
.loco-nav__item:hover,
.loco-nav__item:focus,
.loco-nav__item.is-open{
  border-color: rgba(255,255,255,.85);
  color: #fff !important;
}
.loco-nav__caret{
  width: 12px; height: 12px;
  display: inline-flex;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.loco-nav__caret svg{ width: 12px; height: 12px; }
.loco-nav__item.is-open .loco-nav__caret{ transform: rotate(180deg); }

/* =========================================================
   HEADER ACTIONS
   ========================================================= */
.loco-header__actions{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex: 0 0 auto;
}

/* Lang switcher */
.loco-lang{ position: relative; }
.loco-lang__btn{
  padding: 10px 16px;
  border: 1.5px solid var(--loco-border) !important;
  border-radius: 999px;
  background: transparent;
  color: #fff !important;
  font-weight: 500; font-size: 14px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit !important;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
  text-decoration: none !important;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.loco-lang__btn:hover,
.loco-lang__btn:focus,
.loco-lang__btn:active,
.loco-lang.is-open .loco-lang__btn{
  background: var(--loco-border) !important;
  color: var(--loco-secondary) !important;
  border-color: var(--loco-border) !important;
}
.loco-lang__caret svg{ width: 12px; height: 12px; transition: transform .22s ease; }
.loco-lang.is-open .loco-lang__caret svg{ transform: rotate(180deg); }
.loco-lang__menu{
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--loco-border);
  border-radius: 16px;
  padding: 6px;
  display: none;
  flex-direction: column;
  min-width: 72px;
  box-shadow: 0 8px 24px rgba(3,42,120,.25);
  z-index: 100;
}
.loco-lang.is-open .loco-lang__menu{ display: flex; }
.loco-lang__opt{
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--loco-secondary) !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  text-align: center;
  text-decoration: none !important;
  transition: background .18s ease;
}
.loco-lang__opt:hover,
.loco-lang__opt:focus,
.loco-lang__opt:visited{
  background: #fff;
  color: var(--loco-primary) !important;
}

/* Burger */
.loco-burger{
  display: none;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: transparent;
  color: #fff !important;
  cursor: pointer;
  border: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  transition: background .18s ease;
}
.loco-burger:hover{ background: rgba(255,255,255,.1); }
.loco-burger svg{ width: 26px; height: 26px; display: block; }

.loco-hide-tablet{ display: inline-flex; }
.loco-show-tablet{ display: none !important; }

/* =========================================================
   MEGA MENU
   ========================================================= */
.loco-mega{
  /* Mega panel: burst out of the header container to full viewport width.
     Trick: absolutely positioned relative to the header wrapper, but left is
     pulled to viewport edge via calc(50% - 50vw), and width is 100vw.
     Content inside .loco-mega__grid is re-centered with max-width + padding. */
  position: absolute;
  top: 100%;
  left: calc(50% - 50vw);
  right: auto;
  width: 100vw;
  max-width: 100vw;
  background: var(--loco-grad);
  padding: 20px 0 32px;
  border-radius: 0 0 32px 32px;
  box-shadow: 0 20px 40px rgba(3,42,120,.28);

  opacity: 0;
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
  transition:
    opacity    .32s cubic-bezier(.4,0,.2,1),
    max-height .38s cubic-bezier(.4,0,.2,1),
    padding    .32s cubic-bezier(.4,0,.2,1),
    visibility 0s linear .38s;
  pointer-events: none;
  z-index: 99;
}
.loco-mega.is-open{
  opacity: 1;
  visibility: visible;
  max-height: 600px;
  padding-top: 24px;
  padding-bottom: 36px;
  pointer-events: auto;
  transition:
    opacity    .32s cubic-bezier(.4,0,.2,1),
    max-height .40s cubic-bezier(.4,0,.2,1),
    padding    .32s cubic-bezier(.4,0,.2,1),
    visibility 0s;
}

.loco-mega__grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 40px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 80px;
}
.loco-mega__item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 8px;
  border-radius: 8px;
  color: #fff !important;
  text-decoration: none !important;
  transition: background .2s ease, padding-left .2s ease;
  opacity: 0;
  transform: translateY(8px);
}
.loco-mega.is-open .loco-mega__item{
  opacity: 1;
  transform: translateY(0);
  transition:
    background .2s ease,
    padding-left .2s ease,
    opacity   .32s cubic-bezier(.4,0,.2,1),
    transform .32s cubic-bezier(.4,0,.2,1);
}
.loco-mega.is-open .loco-mega__item:nth-child(1){ transition-delay: .05s; }
.loco-mega.is-open .loco-mega__item:nth-child(2){ transition-delay: .07s; }
.loco-mega.is-open .loco-mega__item:nth-child(3){ transition-delay: .09s; }
.loco-mega.is-open .loco-mega__item:nth-child(4){ transition-delay: .11s; }
.loco-mega.is-open .loco-mega__item:nth-child(5){ transition-delay: .13s; }
.loco-mega.is-open .loco-mega__item:nth-child(6){ transition-delay: .15s; }
.loco-mega.is-open .loco-mega__item:nth-child(7){ transition-delay: .17s; }
.loco-mega.is-open .loco-mega__item:nth-child(8){ transition-delay: .19s; }
.loco-mega.is-open .loco-mega__item:nth-child(9){ transition-delay: .21s; }

.loco-mega__item:hover{
  background: rgba(255,255,255,.08);
  padding-left: 16px;
}
.loco-mega__item:hover .loco-mega__arrow{ transform: translate(2px,-2px); color: #fff; }

.loco-mega__item-txt{ display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.loco-mega__cat{
  font-weight: 500 !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  color: #fff !important;
}
.loco-mega__name{
  font-weight: 400 !important;
  font-size: 16px !important;
  line-height: 1.3 !important;
  color: var(--loco-blue-muted) !important;
}
.loco-mega__arrow{
  width: 24px; height: 24px;
  display: inline-grid; place-items: center;
  color: rgba(255,255,255,.85) !important;
  flex: 0 0 auto;
  transition: transform .22s ease, color .22s ease;
}
.loco-mega__arrow svg{ width: 22px; height: 22px; }

/* =========================================================
   MOBILE OVERLAY
   ========================================================= */
.loco-mobile{
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  background: var(--loco-grad);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity   .32s ease,
    transform .32s ease,
    visibility 0s linear .32s;
  font-family: 'Gilroy','Inter',system-ui,sans-serif !important;
  color: #fff !important;
}
.loco-mobile.is-open{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity   .32s ease,
    transform .32s ease,
    visibility 0s;
}

.loco-mobile__top{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  flex: 0 0 auto;
}
.loco-mobile__spacer{ flex: 1; }

.loco-mobile__body{
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 20px;
}

.loco-mobile__footer{
  flex: 0 0 auto;
  padding: 20px;
}

/* Accordion — фикс: border-radius не анимируется */
.loco-acc{
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 24px;
  padding: 16px 22px;
  margin-bottom: 12px;
  color: #fff !important;
  background: transparent;
  overflow: hidden;
  transition: padding .3s cubic-bezier(.4,0,.2,1);
}
.loco-acc.is-open{
  padding: 20px 22px;
}
.loco-acc__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 500 !important;
  font-size: 15px !important;
  color: #fff !important;
  user-select: none;
}
.loco-acc__head svg{
  width: 20px; height: 20px;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  flex: 0 0 auto;
}
.loco-acc.is-open .loco-acc__head svg{ transform: rotate(180deg); }
.loco-acc__body{
  max-height: 0;
  overflow: hidden;
  transition: max-height .38s cubic-bezier(.4,0,.2,1),
              margin-top .38s cubic-bezier(.4,0,.2,1);
}
.loco-acc.is-open .loco-acc__body{
  max-height: 1600px;
  margin-top: 16px;
}
.loco-acc__body-inner{
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
.loco-msvc{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: #fff !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.loco-msvc:last-child{ border-bottom: 0; }
.loco-msvc__txt{ display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.loco-msvc__cat{
  font-weight: 500 !important;
  font-size: 15px !important;
  color: #fff !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
}
.loco-msvc__name{
  font-weight: 400 !important;
  font-size: 13px !important;
  line-height: 17px !important;
  color: var(--loco-blue-muted) !important;
  max-width: 280px;
}
.loco-msvc__arr{ width: 22px; height: 22px; color: rgba(255,255,255,.85); flex: 0 0 auto; }
.loco-msvc__arr svg{ width: 22px; height: 22px; }

.loco-mlink{
  display: block;
  padding: 16px 4px;
  color: #fff !important;
  font-weight: 400 !important;
  font-size: 16px !important;
  border-bottom: 1px solid rgba(255,255,255,.15);
  text-decoration: none !important;
}
.loco-mlink:last-of-type{ border-bottom: 0; }

.loco-mobile__lang{ margin: 20px 0; }
.loco-lang.is-mobile{ display: block; }
.loco-lang.is-mobile .loco-lang__btn{
  width: 100%;
  justify-content: center;
  padding: 14px;
  border-radius: 16px;
  font-size: 14px !important;
}
.loco-lang.is-mobile .loco-lang__menu{
  position: static;
  margin-top: 8px;
  width: 100%;
  background: rgba(255,255,255,.1);
  border-radius: 16px;
}
.loco-lang.is-mobile .loco-lang__opt{
  color: #fff !important;
}
.loco-lang.is-mobile .loco-lang__opt:hover,
.loco-lang.is-mobile .loco-lang__opt:focus{
  background: rgba(255,255,255,.15);
  color: #fff !important;
}

.loco-mobile__cta{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: var(--loco-accent);
  color: #fff !important;
  border-radius: 16px;
  font-weight: 600 !important;
  font-size: 15px !important;
  text-decoration: none !important;
  width: 100%;
  transition: background .18s ease;
}
.loco-mobile__cta:hover{ background: #2E2E2E; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
/* Desktop-narrow 1025-1300 */
@media (max-width: 1300px) and (min-width: 1025px){
  .loco-header__inner{ padding: 18px 24px; gap: 16px; }
  .loco-nav{ gap: 0; }
  .loco-nav__item{ font-size: 14px; padding: 9px 14px; }
  .loco-header__actions{ gap: 8px; }
  .loco-btn--outlined-white{ padding: 12px 16px; font-size: 13px; }
  .loco-btn--dark{ padding: 12px 18px; font-size: 13px; }
  .loco-lang__btn{ padding: 8px 12px; font-size: 13px; }
}

/* Tablet + Mobile */
@media (max-width: 1024px){
  .loco-header__inner{ padding: 16px 24px; min-height: 80px; gap: 12px; }
  .loco-header__spacer{ height: 80px; }
  .loco-header.is-condensed .loco-header__inner{ min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
  .loco-header.is-condensed ~ .loco-header__spacer{ height: 64px; }
  .loco-nav{ display: none; }
  .loco-hide-tablet{ display: none !important; }
  .loco-show-tablet{ display: inline-flex !important; }
  .loco-burger{ display: inline-flex !important; }
  .loco-mega{ display: none !important; }
  /* Скрываем dark CTA на планшете и мобилке — она есть в оверлее */
  .loco-header .loco-btn--dark{ display: none !important; }
}
@media (max-width: 600px){
  .loco-header__inner{ padding: 14px 16px; gap: 8px; }
  .loco-header__spacer{ height: 72px; }
  .loco-header.is-condensed ~ .loco-header__spacer{ height: 60px; }
  .loco-header__actions{ gap: 8px; }
  .loco-header__actions .loco-btn--secondary-icon,
  .loco-header__actions .loco-btn--icon-white{ width: 44px; height: 44px; border-radius: 12px; }
  .loco-header__actions .loco-btn--secondary-icon svg,
  .loco-header__actions .loco-btn--icon-white svg{ width: 18px; height: 18px; }
  .loco-burger{ width: 44px; height: 44px; border-radius: 12px; }
  .loco-burger svg{ width: 22px; height: 22px; }
  .loco-header__logo img{ height: 32px; }
  .loco-header__logo--text{ font-size: 18px; }
}
