/* ===========================================
   MEDCOPY — Header & Footer Components
   =========================================== */

/* ---- HEADER (PC) ---- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.site-header {
  background-color: var(--color-surface);
  border: 1px solid transparent;
  border-bottom-color: #e0e3dc;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  will-change: width, transform, background-color, border-radius;
  backface-visibility: hidden;
  -webkit-font-smoothing: subpixel-antialiased;
}

header.scrolled .site-header {
  background-color: rgba(255, 255, 255, 0.55); /* Полупрозрачный фон 65% */
  backdrop-filter: blur(12px); /* Размытие заднего фона */
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px; /* border-radius: 16px */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05); /* Элегантная мягкая тень */
  border-color: rgba(255,255,255,0.3);
  width: 90%; /* Ширина должна уменьшиться до 90% */
  min-width: fit-content;
  transform: translateY(15px); /* Плавно сдвигаем вниз без перестроения макета (вместо margin-top) */
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 clamp(16px, 3vw, 40px);
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-logo img {
  width: clamp(180px, 20vw, 241px);
  height: auto;
}

/* Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3.5vw, 51px);
}

.header-nav a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(14px, 1.5vw, 18px);
  color: var(--color-text);
  transition: color var(--transition-fast);
  position: relative;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
.header-nav a:hover {
  color: var(--color-primary);
}
}

.header-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: var(--color-secondary);
  transition: width var(--transition-base);
}
@media (hover: hover) and (pointer: fine) {
.header-nav a:hover::after {
  width: 100%;
}
}

/* Header CTA Button */
.header-cta .btn {
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 500;
  padding: 10px clamp(12px, 2vw, 20px);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

/* Анимация блика */
.header-cta .btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  animation: btn-glare 6s infinite;
}

@keyframes btn-glare {
  0% { left: -100%; }
  15% { left: 200%; }
  100% { left: 200%; }
}

/* Hamburger — скрыт на десктопе */
.header-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.header-hamburger img {
  width: 25px;
  height: 19px;
}

/* ---- MOBILE MENU OVERLAY ---- */
.mobile-menu-overlay {
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(63, 65, 62, 0.5);
  z-index: 1999;
  opacity: 0;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.mobile-menu-overlay.active {
  visibility: visible;
  opacity: 1;
}

.mobile-menu {
  display: flex;
  visibility: hidden;
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(100%);
  width: 80%;
  max-width: 360px;
  height: max-content;
  max-height: 100vh;
  overflow-y: auto;
  background-color: var(--color-bg);
  z-index: 2000;
  padding: 20px;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.4s;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  border-radius: 16px 0 0 16px;
}

.mobile-menu.active {
  visibility: visible;
  transform: translateX(0);
}

.mobile-menu-close {
  align-self: flex-end;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin-top: 10px;
  margin-right: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-close img {
  width: 24px;
  height: 24px;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.mobile-menu-nav a {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 26px;
  color: #506251;
  padding: 0;
  border-bottom: none;
  transition: none;
}

.mobile-menu-contacts {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-menu-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: #506251;
}

.mobile-menu-contact-item img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ---- FOOTER (PC) ---- */
.site-footer {
  background-color: #2C3B2B;
  background-image:
    radial-gradient(ellipse 800px 900px at -10% 20%, rgba(224, 201, 161, 0.06) 0%, rgba(224, 201, 161, 0.02) 30%, transparent 60%),
    radial-gradient(ellipse 600px 700px at 5% 100%, rgba(224, 201, 161, 0.05) 0%, rgba(224, 201, 161, 0.015) 35%, transparent 60%);
  color: #FFFFFF;
  padding: 80px 120px 40px;
  position: relative;
  overflow: hidden;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 60px;
}

/* Footer — Left column */
.footer-left {
  max-width: 420px;
  text-align: center;
}

.footer-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 54px;
  line-height: 1.15;
  color: #FFFFFF;
  margin-bottom: 16px;
}

.footer-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}

/* Footer — Right column */
.footer-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
  text-align: center;
}

.footer-contact-item {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 32px;
  color: #FFFFFF;
  transition: opacity var(--transition-fast);
}
@media (hover: hover) and (pointer: fine) {
.footer-contact-item:hover {
  opacity: 0.85;
}
}

.footer-contact-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 32px;
  color: #FFFFFF;
}

.footer-contact-secondary {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

/* Footer — Divider */
.footer-divider {
  width: 100%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.25);
  margin: 46px -50px;
  width: calc(100% + 100px);
  border: none;
}

/* Footer — Copyright */
.footer-copyright {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.27);
  text-align: center;
}

/* ===========================================
   RESPONSIVE — Mobile Header & Footer
   =========================================== */
@media (max-width: 1024px) {

  /* Header mobile */
  .header-inner {
    height: 60px;
  }

  .header-logo img {
    width: auto;
    height: 44px;
  }

  .header-nav {
    display: none;
  }

  .header-cta {
    display: none;
  }

  .header-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Footer mobile */
  .site-footer {
    padding: 40px 0;
    background-color: #2D3C2C;
  }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }

  .footer-heading {
    display: none;
  }

  .footer-subtitle {
    display: none;
  }

  .footer-right {
    gap: 8px;
    padding-top: 0;
  }

  /* Mobile footer — Logo */
  .footer-mobile-logo {
    display: block;
    margin-bottom: 24px;
  }

  .footer-mobile-logo img {
    height: 50px;
    width: auto;
  }

  /* Mobile footer — Contact items with icons */
  .footer-mobile-contact {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .footer-mobile-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    color: #FFFFFF;
  }

  .footer-mobile-contact-item img {
    width: 21px;
    height: auto;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
  }

  .footer-contact-item,
  .footer-contact-label {
    font-size: 20px;
  }

  .footer-divider {
    margin: 32px 0 24px;
  }

  .footer-copyright {
    text-align: left;
    font-size: 14px;
  }
}

/* Hide on desktop, show on mobile */
.mobile-only {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }
}

/* --- Toast Notification --- */
#toast-container {
  position: fixed;
  top: 40px;
  left: 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.copy-toast {
  position: relative;
  left: -300px;
  /* Hidden state */
  opacity: 0;
  background-color: var(--color-primary);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease-in-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-toast::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
}

.copy-toast.show {
  left: 0;
  opacity: 1;
}

/* ===========================================
   Scroll to Top Button (Desktop Only)
   =========================================== */
.scroll-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  z-index: 99;
  border: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (hover: hover) and (pointer: fine) {
.scroll-to-top:hover {
  transform: translateY(-2px);
  background-color: #355637;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}
}

@media (max-width: 1024px) {
  .scroll-to-top {
    width: 44px;
    height: 44px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 1024px) {
  #toast-container {
    top: 20px;
    left: 20px;
    right: 20px;
    width: auto;
  }

  .header-inner {
    padding: 0 18px;
  }
}

/* ===========================================
   Custom Toast Notification
   =========================================== */
.toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background-color: #333333;
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9999;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  text-align: center;
  min-width: 300px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error {
  background-color: #d9534f;
}

.toast.success {
  background-color: var(--color-primary);
}