/* =========================================================
   KFH Pletin — modern glass header
   /assets/css/header-modern.css
========================================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --head-ink: #12231a;
  --head-text: #24372c;
  --head-muted: #69786c;
  --head-paper: #fffdf8;
  --head-soft: #f3f8f0;
  --head-green: #245b39;
  --head-green-dark: #1c4a2f;
  --head-green-2: #6ca56b;
  --head-gold: #d99a3d;
  --head-gold-light: #f1b75b;
  --head-line: rgba(18, 35, 26, 0.1);
  --head-shadow: 0 18px 55px rgba(32, 63, 43, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  padding-top: 94px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--head-paper);
  color: var(--head-ink);
}

body.home-template {
  padding-top: 0;
}

/* Links reset */
a {
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

a:focus {
  outline: none;
}

/* =========================================================
   Header base
========================================================= */

.glass-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 88px;
  z-index: 1000;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
  transform: translateZ(0);
  will-change: transform;
  pointer-events: none;
}

.header-container {
  width: min(1180px, calc(100% - 32px));
  max-width: 1180px;
  height: 68px;
  margin: 12px auto 0;
  padding: 0 14px 0 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;

  border: 1px solid rgba(18, 35, 26, 0.1);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--head-shadow);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);

  pointer-events: auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 74px;
  height: 100%;
  flex-shrink: 0;
}

.logo img {
  display: block;
  max-height: 50px;
  max-width: 150px;
  object-fit: contain;
}

/* =========================================================
   Desktop nav
========================================================= */

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;

  border: 1px solid rgba(18, 35, 26, 0.08);
  border-radius: 999px;
  background: rgba(244, 248, 242, 0.82);
}

.nav-item {
  position: relative;
}

.nav-link {
  min-height: 42px;
  padding: 0 13px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  border-radius: 999px;
  color: var(--head-text);
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;

  transition:
    background 0.22s ease,
    color 0.22s ease,
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.nav-link:visited,
.nav-link:active,
.nav-link:focus {
  color: var(--head-text);
}

.nav-link:hover {
  color: var(--head-green);
  background: rgba(108, 165, 107, 0.14);
  transform: translateY(-1px);
}

.nav-link.active,
.nav-link.active:visited,
.nav-link.active:active,
.nav-link.active:focus {
  color: #fff;
  background: var(--head-green);
  font-weight: 800;
  box-shadow:
    0 12px 28px rgba(36, 91, 57, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.nav-link.active i:first-child {
  color: var(--head-gold-light);
}

.nav-link.active::after {
  display: none;
}

.nav-link i:first-child {
  color: var(--head-green);
  font-size: 14px;
}

.dropdown-arrow {
  margin-left: 2px;
  font-size: 11px;
  opacity: 0.72;
  transition: transform 0.25s ease;
}

.nav-item:hover .dropdown-arrow {
  transform: rotate(180deg);
}

/* =========================================================
   Desktop dropdown
========================================================= */

.dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 230px;
  padding: 8px;

  border: 1px solid rgba(18, 35, 26, 0.1);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 24px 60px rgba(32, 63, 43, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.24s ease,
    visibility 0.24s ease,
    transform 0.24s ease;

  z-index: 1000;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  min-height: 42px;
  padding: 0 12px;

  display: flex;
  align-items: center;
  gap: 9px;

  border-radius: 10px;
  color: var(--head-text);
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  font-weight: 700;

  transition:
    background 0.22s ease,
    color 0.22s ease;
}

.dropdown-item:visited,
.dropdown-item:active,
.dropdown-item:focus {
  color: var(--head-text);
}

.dropdown-item i {
  width: 18px;
  text-align: center;
  color: var(--head-green);
  font-size: 14px;
  flex-shrink: 0;
}

.dropdown-item span {
  flex: 1;
}

.dropdown-item:hover,
.dropdown-item.active {
  background: rgba(108, 165, 107, 0.14);
  color: var(--head-green);
}

/* =========================================================
   Mobile button
========================================================= */

.mobile-menu-btn {
  display: none;
}

/* =========================================================
   Overlay
========================================================= */

.overlay {
  display: none;
}

/* =========================================================
   Page loading bar
========================================================= */

.page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: transparent;
  z-index: 9999;
  overflow: hidden;
  display: none;
}

.page-loading-bar.active {
  display: block;
}

.page-loading-bar::before {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2b542c, #3d8b40, #4caf50);
  animation: loading 1.5s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(75, 175, 80, 0.5);
}

@keyframes loading {
  0% {
    width: 0;
    left: 0;
  }

  50% {
    width: 70%;
    left: 0;
  }

  100% {
    width: 0;
    left: 100%;
  }
}

/* =========================================================
   Scroll top button
========================================================= */

.scroll-top-button,
#scrollTop {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 999;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 50px;
  height: 50px;

  border-radius: 50%;
  background: var(--head-green) !important;
  color: #fff;
  cursor: pointer;
  opacity: 0;

  box-shadow: 0 16px 42px rgba(36, 91, 57, 0.22);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.scroll-top-button:hover,
#scrollTop:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 52px rgba(36, 91, 57, 0.28);
}

/* =========================================================
   Mobile header
========================================================= */

@media (max-width: 980px) {
  body {
    padding-top: 82px;
  }

  body.home-template {
    padding-top: 0;
  }

  .glass-header {
    height: 78px;
    padding: 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
  }

  .header-container {
    width: calc(100% - 24px);
    height: 58px;
    margin: 10px auto 0;
    padding: 0 8px 0 12px;

    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 20px;
    background: rgba(255, 253, 248, 0.88);
    box-shadow:
      0 18px 50px rgba(18, 35, 26, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);

    pointer-events: auto;
  }

  .logo {
    min-width: auto;
    height: 100%;
  }

  .logo img {
    max-height: 38px;
    max-width: 126px;
  }

  .mobile-menu-btn {
    display: inline-grid;
    place-items: center;

    width: 42px;
    height: 42px;
    padding: 0;

    border: 1px solid rgba(217, 154, 61, 0.65);
    border-radius: 15px;
    background: rgba(255, 253, 248, 0.95);
    color: var(--head-green);

    font-size: 18px;
    cursor: pointer;
    z-index: 1002;

    box-shadow:
      0 12px 28px rgba(32, 63, 43, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.85);

    transition:
      transform 0.22s ease,
      background 0.22s ease,
      color 0.22s ease,
      border-color 0.22s ease,
      box-shadow 0.22s ease;
  }

  .mobile-menu-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(217, 154, 61, 0.95);
    box-shadow:
      0 16px 34px rgba(32, 63, 43, 0.15),
      0 0 0 4px rgba(217, 154, 61, 0.12);
  }

  body.mobile-menu-open .mobile-menu-btn {
    background: #fffdf8;
    color: var(--head-green);
    border-color: rgba(217, 154, 61, 0.95);
    box-shadow:
      0 16px 36px rgba(32, 63, 43, 0.16),
      0 0 0 4px rgba(217, 154, 61, 0.14);
  }

  .nav {
    position: fixed;
    top: 76px;
    left: 16px;
    right: 16px;
    width: auto;
    height: auto;
    max-height: calc(100svh - 96px);

    padding: 10px;

    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    background: linear-gradient(
      180deg,
      rgba(255, 253, 248, 0.98),
      rgba(248, 246, 238, 0.96)
    );
    box-shadow:
      0 28px 80px rgba(18, 35, 26, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(22px) saturate(1.08);
    -webkit-backdrop-filter: blur(22px) saturate(1.08);

    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;

    overflow-y: auto;
    z-index: 1001;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top center;

    transition:
      opacity 0.24s ease,
      transform 0.24s ease,
      visibility 0.24s ease;
  }

  .nav.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .nav::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 22px;

    width: 16px;
    height: 16px;

    border-left: 1px solid rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 253, 248, 0.98);
    transform: rotate(45deg);
    border-radius: 4px 0 0 0;
  }

  .nav-item {
    width: 100%;
    position: relative;
    z-index: 2;
  }

  .nav-link {
    justify-content: flex-start;

    width: 100%;
    min-height: 50px;
    padding: 0 14px;

    border: 0;
    border-radius: 14px;

    color: var(--head-text);
    background: transparent;

    font-size: 15px;
    font-weight: 800;
    gap: 12px;

    transition:
      transform 0.2s ease,
      background 0.2s ease,
      color 0.2s ease,
      box-shadow 0.2s ease;
  }

  .nav-link:visited,
  .nav-link:active,
  .nav-link:focus {
    color: var(--head-text);
  }

  .nav-link:hover {
    transform: none;
    color: var(--head-green);
    background: rgba(36, 91, 57, 0.08);
  }

  .nav-link.active,
  .nav-link.active:visited,
  .nav-link.active:active,
  .nav-link.active:focus {
    color: #fff;
    background: var(--head-green);
    box-shadow:
      0 14px 30px rgba(36, 91, 57, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  .nav-link.active i:first-child {
    color: var(--head-gold-light);
  }

  .nav-link.active::after {
    display: none;
  }

  .nav-link i:first-child {
    width: 20px;
    padding: 0;
    color: var(--head-green);
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
  }

  .nav-link span {
    flex: 1;
    padding: 0;
  }

  .dropdown-arrow {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.75;
    transform: rotate(0deg);
    transition: transform 0.22s ease;
  }

  .dropdown-arrow.rotated {
    transform: rotate(180deg);
  }

  .nav-item:hover .dropdown-arrow {
    transform: rotate(0deg);
  }

  .nav-item:hover .dropdown-arrow.rotated {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    position: static;
    display: none;

    min-width: 0;
    margin: 4px 0 8px 34px;
    padding: 6px;

    opacity: 1;
    visibility: visible;
    transform: none;

    border: 1px solid rgba(18, 35, 26, 0.08);
    border-radius: 14px;
    box-shadow: none;
    background: rgba(36, 91, 57, 0.055);

    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .dropdown-menu.active {
    display: grid;
    gap: 3px;
  }

  .dropdown-item {
    min-height: 42px;
    padding: 0 12px;

    border: 0;
    border-radius: 11px;

    color: var(--head-text);
    font-weight: 750;
    gap: 9px;
  }

  .dropdown-item:visited,
  .dropdown-item:active,
  .dropdown-item:focus {
    color: var(--head-text);
  }

  .dropdown-item:hover,
  .dropdown-item.active {
    background: rgba(36, 91, 57, 0.1);
    color: var(--head-green);
  }

  .dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--head-green);
    font-size: 14px;
    flex-shrink: 0;
  }

  .dropdown-item span {
    flex: 1;
  }

  .overlay {
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100svh;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
      opacity 0.24s ease,
      visibility 0.24s ease;
  }

  .overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .scroll-top-button,
  #scrollTop {
    right: 18px;
    bottom: 18px;
  }
}

@media (max-width: 480px) {
  .header-container {
    width: calc(100% - 20px);
    height: 56px;
    margin-top: 9px;
    padding-left: 10px;
    border-radius: 18px;
  }

  .logo img {
    max-height: 36px;
    max-width: 118px;
  }

  .mobile-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 17px;
  }

  .nav {
    top: 72px;
    left: 14px;
    right: 14px;
    max-height: calc(100svh - 90px);
    border-radius: 20px;
    padding: 9px;
  }

  .nav-link {
    min-height: 48px;
    padding: 0 13px;
    font-size: 14px;
  }

  .dropdown-menu {
    margin-left: 30px;
  }
}

/* =========================================================
   Accessibility motion
========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
