/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.topbar {
  background: var(--color-primary-dark);
  color: var(--color-white);
  font-size: var(--font-size-sm);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  min-height: var(--topbar-height);
  padding: 0.35rem var(--space-md);
}

.topbar__contacts {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.topbar__link,
.topbar__book {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 400;
  white-space: nowrap;
}

.topbar__link:hover,
.topbar__book:hover {
  opacity: 0.92;
  text-decoration: none;
}

.topbar__sep {
  opacity: 0.45;
  user-select: none;
}

.btn--header-cta {
  font-family: "Arimo", var(--font-sans);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.btn__text-mobile {
  display: none;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-height);
  padding: 0.5rem var(--space-md);
  max-width: var(--container-max);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.92;
}

.logo__img {
  display: block;
  width: auto;
  max-width: 200px;
  height: auto;
  max-height: 56px;
  object-fit: contain;
}

.logo__img--footer {
  max-width: 160px;
  max-height: 48px;
}

.nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__item {
  position: relative;
}

.nav__link {
  display: block;
  padding: 0.65rem 0.9rem;
  color: var(--color-dark);
  font-weight: 500;
  font-size: var(--font-size-sm);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.nav__link:hover,
.nav__item.is-active > .nav__link {
  background: rgba(10, 96, 118, 0.08);
  color: var(--color-primary);
  text-decoration: none;
}

.nav__sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  z-index: 100;
}

.nav__item:hover .nav__sub,
.nav__item.is-open .nav__sub {
  display: block;
}

.nav__sub a {
  display: block;
  padding: 0.6rem 0.75rem;
  color: var(--color-dark);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  text-decoration: none;
}

.nav__sub a:hover {
  background: rgba(10, 96, 118, 0.08);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  cursor: pointer;
  position: relative;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-dark);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle span::before {
  content: "";
  top: 14px;
}

.menu-toggle span::after {
  content: "";
  bottom: 14px;
}

.site-header.is-open .menu-toggle span {
  background: transparent;
}

.site-header.is-open .menu-toggle span::before {
  top: 21px;
  transform: translateX(-50%) rotate(45deg);
}

.site-header.is-open .menu-toggle span::after {
  bottom: 21px;
  transform: translateX(-50%) rotate(-45deg);
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

.site-header.is-open .mobile-nav {
  display: block;
}

.mobile-nav .nav__list {
  flex-direction: column;
  align-items: stretch;
}

.mobile-nav .nav__sub {
  position: static;
  box-shadow: none;
  padding-left: var(--space-sm);
  display: none;
}

.mobile-nav .nav__item.is-open .nav__sub {
  display: block;
}

@media (max-width: 1024px) {
  .nav { display: none; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
}

@media (max-width: 768px) {
  .site-header {
    box-shadow: 0 1px 0 rgba(10, 96, 118, 0.06), 0 4px 20px rgba(10, 96, 118, 0.06);
  }

  .topbar {
    background: linear-gradient(180deg, #0a6076 0%, #0b647a 100%);
  }

  .topbar__inner {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.65rem;
    min-height: auto;
    padding: 0.45rem 0.75rem;
  }

  .topbar__contacts {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.65rem;
    width: auto;
  }

  .topbar__sep,
  .topbar__label,
  .topbar__book {
    display: none;
  }

  .topbar__link {
    font-size: 0.6875rem;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0.95;
  }

  .topbar__link--email {
    max-width: 11.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar__link--email::before {
    content: "·";
    margin-right: 0.5rem;
    opacity: 0.55;
  }

  .header-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 56px;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    max-width: none;
  }

  .logo {
    min-width: 0;
  }

  .logo__img {
    max-width: 108px;
    max-height: 38px;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
  }

  .btn__text-full {
    display: none;
  }

  .btn__text-mobile {
    display: inline;
  }

  .btn--header-cta {
    padding: 0 0.875rem;
    height: 36px;
    min-width: 0;
    min-height: 36px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.06em;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(10, 96, 118, 0.22);
  }

  .btn--header-cta:hover {
    transform: none;
    box-shadow: 0 4px 14px rgba(10, 96, 118, 0.26);
  }

  .menu-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid #e8ecef;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    flex-shrink: 0;
  }

  .menu-toggle span::before {
    top: 12px;
  }

  .menu-toggle span::after {
    bottom: 12px;
  }

  .site-header.is-open .menu-toggle span::before {
    top: 1px;
  }

  .site-header.is-open .menu-toggle span::after {
    bottom: 0px;
  }

  .mobile-nav {
    padding: 0.75rem;
    background: #fafbfc;
    border-top: 1px solid #eef2f5;
  }

  .mobile-nav .nav__link {
    padding: 0.85rem 0.75rem;
    font-size: 0.9375rem;
    border-radius: 8px;
  }
}

@media (max-width: 380px) {
  .logo__img {
    max-width: 96px;
    max-height: 34px;
  }

  .topbar__link--email {
    max-width: 9.5rem;
  }

  .btn--header-cta {
    padding: 0 0.7rem;
    font-size: 0.625rem;
  }
}

/* Footer */
.site-footer {
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
}

.footer-main {
  background-color: #08596f;
  background-image: url("../images/footer/e22-2.png");
  background-position: bottom left;
  background-repeat: no-repeat;
  padding: 70px 0 95px;
}

.footer-main__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-left: auto;
  max-width: 920px;
}

.footer-main__col h3 {
  color: var(--color-white);
  font-size: 24px;
  line-height: 24px;
  font-weight: 300;
  margin: 45px 0 50px;
}

.footer-main__col p {
  margin: 0 0 0.15rem;
  font-size: 20px;
  line-height: 30px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.92);
}

.footer-main__col a {
  color: inherit;
  text-decoration: none;
}

.footer-main__col a:hover {
  text-decoration: underline;
}

.footer-bar {
  background: #05313d;
  padding: 63px 0 55px;
}

.footer-bar__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
}

.footer-bar__brand {
  flex: 0 1 35%;
}

.footer-bar__logo {
  display: inline-block;
  line-height: 0;
}

.footer-bar__logo img {
  width: 74px;
  height: auto;
  max-height: none;
}

.footer-bar__copy {
  margin: 30px 0 0;
  font-size: var(--font-size-sm);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.footer-bar__copy a {
  color: inherit;
  text-decoration: none;
}

.footer-bar__copy a:hover {
  text-decoration: underline;
}

.footer-bar__nav {
  flex: 0 1 65%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 30px;
  padding-top: 35px;
}

.footer-bar__nav a {
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--font-size-sm);
  text-decoration: none;
}

.footer-bar__nav a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .footer-main {
    padding: 30px 0;
  }

  .footer-main__grid {
    max-width: none;
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .footer-main__grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-main__col h3 {
    margin: 20px 0 24px;
    font-size: 20px;
  }

  .footer-main__col p {
    font-size: 17px;
    line-height: 26px;
  }

  .footer-bar__inner {
    flex-direction: column;
  }

  .footer-bar__brand,
  .footer-bar__nav {
    flex: 1 1 100%;
    width: 100%;
  }

  .footer-bar__nav {
    justify-content: flex-start;
    padding-top: var(--space-md);
  }
}

@media (max-width: 480px) {
  .footer-main__grid {
    grid-template-columns: 1fr;
  }
}

/* Grid utilities */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
}
