/**
 * PC site header top bar — Figma 1440 (Frame 5, 124, 251, 17, logo 11/12)
 * Applies inside .site-header__desktop from 1024px+
 */

@media (min-width: 1024px) {
  .site-header {
    top: 0;
  }

  .site-header__desktop {
    --header-inline-pad: var(--gutter);
    box-sizing: border-box;
    width: 100%;
    max-width: 1492px;
    margin-inline: auto;
    padding-inline: var(--header-inline-pad);
  }

  .site-header__desktop .header-main.container {
    position: relative;
    display: grid;
    /* 1fr spacer absorbs extra width — do not use space-between (it inflates track gaps) */
    grid-template-columns: 332px 1fr;
    grid-template-rows: 53px auto;
    grid-template-areas:
      "logo ."
      "subline .";
    align-items: start;
    justify-content: start;
    column-gap: 16px;
    row-gap: 8px;
    max-width: none;
    width: 100%;
    margin-inline: 0;
    padding: 74px 0 10px;
    box-sizing: border-box;
  }

  .site-header__desktop .logo {
    grid-area: logo;
    display: flex;
    align-items: center;
    gap: 7px;
    width: 332px;
    box-sizing: border-box;
    text-decoration: none;
    align-self: start;
    anchor-name: --header-logo;
  }

  .site-header__desktop .logo-icon {
    width: 53px;
    height: 53px;
    object-fit: contain;
  }

  .site-header__desktop .logo-word {
    width: 272px;
    height: 53px;
    object-fit: contain;
  }

  .site-header__desktop .logo-subline {
    grid-area: subline;
    margin: 0;
    max-width: 280px;
    font-family: var(--font-family-base);
    font-weight: 300;
    font-size: 15px;
    line-height: 18px;
    color: #000;
    anchor-name: --header-subline;
  }

  /* Toggle: viewport top 93px; left = logo right + 84px */
  .site-header__desktop .city-line.city-dropdown-home {
    position: absolute;
    top: 93px;
    left: calc(332px + 84px);
    width: auto;
    min-width: 0;
    margin: 0;
    grid-area: unset;
    z-index: 120;
  }

  @supports (left: anchor(right)) {
    .site-header__desktop .city-line.city-dropdown-home {
      position-anchor: --header-logo;
      left: calc(anchor(right) + 84px);
    }
  }

  .site-header__desktop .city-dropdown-home__toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
    font-weight: 300;
    font-size: 15px;
    line-height: 18px;
    color: #000;
    padding: 10px 12px 10px 28px;
    gap: 10px;
  }

  .site-header__desktop .city-dropdown-home__toggle::before {
    width: 15px;
    height: 19px;
    background: var(--kp-city-spot-icon) no-repeat center / contain;
  }

  .site-header__desktop .header-phone {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0;
    width: auto;
    max-width: 299px;
    box-sizing: border-box;
    text-decoration: none;
    color: #000;
  }

  .site-header__desktop .header-main__cta .header-phone {
    position: static;
    top: auto;
    right: auto;
    margin: 0;
    flex: 0 0 auto;
    width: auto;
    max-width: 299px;
    grid-area: unset;
    anchor-name: --header-phone;
  }

  .site-header__desktop .header-main__phone-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 299px;
    width: 299px;
    margin: 17px 0 0;
  }

  /* Vertical center aligned with logo-subline; right edge aligned with header-phone */
  .site-header__desktop .header-hours {
    position: absolute;
    top: calc(74px + 53px + 8px + (18px / 2));
    right: calc(32px + 29px + 10px + 28px + 29px + 210px);
    transform: translateY(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 0;
    padding: 0;
    width: 225px;
    max-width: 225px;
    box-sizing: border-box;
    font-family: var(--font-family-base);
    font-weight: 300;
    font-size: 15px;
    line-height: 18px;
    color: #000;
    grid-area: unset;
  }

  @supports (right: anchor(right)) {
    .site-header__desktop .header-hours {
      position-anchor: --header-phone;
      right: anchor(right);
    }
  }

  .site-header__desktop .header-phone__icon {
    flex: none;
    width: 26px;
    height: 26px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M21 15.5l-4.3-1.7a1 1 0 00-1.1.2l-1.8 1.8a14 14 0 01-6.6-6.6L8.9 7.4a1 1 0 00.2-1.1L7.5 2.1A1 1 0 006.5 1.5L3.2 2.4A1 1 0 002.5 3.4 18 18 0 0020.6 21.5a1 1 0 001-.7l.9-3.3a1 1 0 00-.5-1.1z' fill='url(%23g)'/%3E%3Cdefs%3E%3ClinearGradient id='g' x1='12' y1='2' x2='12' y2='22' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23FB1600'/%3E%3Cstop offset='1' stop-color='%23D30200'/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E") no-repeat center / contain;
  }

  .site-header__desktop .header-phone__number {
    flex: none;
    font-family: var(--font-family-base);
    font-weight: 600;
    font-size: 25px;
    line-height: 30px;
    white-space: nowrap;
  }

  .site-header__desktop .header-hours__icon {
    flex: none;
    width: 23px;
    height: 23px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='9' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M12 7v5l3 2' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
  }

  /* phone ↔ Max 32px; Telegram ↔ call 29px; phone top 91px; socials top 97px */
  .site-header__desktop .header-main__cta {
    position: absolute;
    top: 74px;
    right: 0;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 32px;
    margin: 0;
  }

  .site-header__desktop .header-main__cta-group {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 29px;
    flex: 0 0 auto;
  }

  .site-header__desktop .header-main__cta-group .socials {
    position: static;
    top: auto;
    right: auto;
    margin: 23px 0 0;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    flex: 0 0 auto;
    grid-area: unset;
  }

  .site-header__desktop .header-main__cta-group .socials a {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
  }

  .site-header__desktop .header-main__cta-group .socials img:first-child {
    width: 29px;
    height: 28px;
    max-width: none;
    object-fit: contain;
  }

  .site-header__desktop .header-main__cta-group .socials img:last-child {
    width: 28px;
    height: 28px;
    max-width: none;
    object-fit: contain;
  }

  .site-header__desktop .header-main__cta-group .call-link {
    position: static;
    top: auto;
    right: auto;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 10px;
    width: 210px;
    height: 70px;
    flex: 0 0 210px;
    box-sizing: border-box;
    border: 0;
    border-radius: 23px;
    background: linear-gradient(180deg, #fb1600 21.55%, #d30200 68.97%);
    font-family: var(--font-family-base);
    font-weight: 600;
    font-size: 20px;
    line-height: 24px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    margin: 0;
    grid-area: unset;
  }

  .site-header__desktop .header-main__cta-group .call-link:hover {
    opacity: 0.96;
  }

  .site-header__desktop .header-main__cta-group .call-link img {
    display: none;
  }

  .site-header__desktop .phone-line,
  .site-header__desktop .time-line {
    display: none;
  }

  .site-header__desktop .nav-row.container {
    position: relative;
    max-width: none;
    width: 100%;
    margin-inline: 0;
    padding-inline: 0;
    box-sizing: border-box;
  }

  /* Fixed gaps; Контакты stays last in flex, right edge aligns with call-link */
  .site-header__desktop .nav-row .main-nav {
    justify-content: flex-start;
    gap: 16px;
    width: 100%;
    overflow-x: visible;
  }

  .site-header__desktop .nav-row .main-nav > a[href="/kontakty/"] {
    margin-left: auto;
  }

  /* styles.css (<=1200px) sets width:auto !important — restore Figma widths on desktop */
  .site-header__desktop .nav-row .main-nav .w-101 {
    width: 101px !important;
  }

  .site-header__desktop .nav-row .main-nav .w-104 {
    width: 104px !important;
  }

  .site-header__desktop .nav-row .main-nav .w-124 {
    width: 124px !important;
  }

  .site-header__desktop .nav-row .main-nav .w-125 {
    width: 125px !important;
  }

  .site-header__desktop .nav-row .main-nav .w-174 {
    width: 174px !important;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .site-header__desktop .header-main.container {
    grid-template-columns: 332px 1fr;
    column-gap: 12px;
  }

  .site-header__desktop .header-phone__number {
    font-size: clamp(18px, 1.8vw, 25px);
  }

  .site-header__desktop .logo-word {
    width: min(272px, 32vw);
    height: auto;
  }
}
