/* Core header layout so pages do not depend on base.css */
.main-header {
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 5%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3000;
  min-height: 88px;
}

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

.logo img {
  width: 150px;
  height: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.main-header .nav-links a {
  text-decoration: none;
  color: #000;
  font-family: "Vesper Libre", serif;
  font-size: 18px;
  font-weight: 600;
  transition: color 0.25s ease;
}

.main-header .nav-links a:hover {
  color: #71b247;
}

.main-header .nav-link,
.main-header .dropdown-toggle {
  color: #111;
  font-weight: 600 !important;
}

.main-header .nav-link.is-active,
.main-header .dropdown-toggle.is-active,
.main-header .nav-link[aria-current="page"] {
  color: #71b247 !important;
}

.main-header .nav-link.is-active .dropdown-label,
.main-header .dropdown-toggle.is-active .dropdown-label {
  color: inherit;
}

body {
  padding-top: 100px;
}

body.mobile-nav-open {
  overflow: hidden;
}

/* Shared header styles (nav + auth + dropdown) */
.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.dropdown-label {
  display: inline-block;
}

.nav-dropdown-arrow {
  transform: rotate(135deg);
  transition: transform 0.25s ease;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 190px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all .25s ease;
  z-index: 999;
}

.services-mega-menu {
  min-width: 240px;
}

.dropdown-menu a {
  display: block;
  padding: 10px 18px;
  color: #222;
  text-decoration: none;
  font-weight: 500;
}

.dropdown-menu a:hover {
  background: #f2f7fa;
  color: #00a3c8;
}

.dropdown-submenu {
  position: relative;
}

.submenu-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.submenu-arrow {
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  flex: 0 0 auto;
}

.submenu-menu {
  position: absolute;
  top: 0;
  left: calc(100% - 6px);
  min-width: 240px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  padding: 8px 0;
  max-height: 420px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: all .25s ease;
  z-index: 1000;
}

.services-branch-link {
  min-width: 230px;
  font-weight: 700 !important;
}

.services-categories-menu {
  min-width: 720px;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  max-height: min(68vh, 520px);
}

.services-category-link {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 100%;
  padding: 14px 18px !important;
  border-radius: 0;
}

.services-categories-list {
  background: #fbfdff;
  border-right: 1px solid rgba(0, 163, 200, 0.12);
  padding: 10px 0;
  max-height: min(68vh, 520px);
  overflow-y: auto;
}

.services-all-link {
  margin-bottom: 4px;
}

.services-preview-pane {
  background: #fff;
  padding: 14px 0;
  max-height: min(68vh, 520px);
  overflow-y: auto;
}

.services-preview-group {
  display: none;
}

.services-preview-group.is-active {
  display: block;
}

.services-preview-title {
  display: inline-flex;
  align-items: center;
  margin: 0 18px 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #00a3c8, #71b247);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 20px rgba(0, 163, 200, 0.18);
}

.services-category-link.is-active,
.services-category-link:hover,
.services-category-link:focus-visible {
  background: #f2f7fa;
  color: #00a3c8;
}

.services-empty-state {
  display: block;
  padding: 12px 18px;
  color: #6b7280;
  font-weight: 600;
}

.submenu-menu::-webkit-scrollbar {
  width: 8px;
}

.submenu-menu::-webkit-scrollbar-thumb {
  background: rgba(0, 163, 200, 0.32);
  border-radius: 999px;
}

.submenu-all {
  font-weight: 700 !important;
  color: #00a3c8 !important;
}

.dropdown-submenu:hover .submenu-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-feedback {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #111;
  text-decoration: none;
}

.nav-feedback:hover {
  color: #71b247;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.45);
  box-shadow: 0 0 0 0 rgba(113, 178, 71, 0.35);
  animation: navPulse 1.8s ease-in-out infinite;
}

.nav-feedback.is-active .nav-dot {
  background: #71b247;
}

@keyframes navPulse {
  0% { box-shadow: 0 0 0 0 rgba(113,178,71,0.28); }
  70% { box-shadow: 0 0 0 10px rgba(113,178,71,0); }
  100% { box-shadow: 0 0 0 0 rgba(113,178,71,0); }
}

.nav-mobile-auth {
  display: none;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  align-items: center;
}

.nav-mobile-auth a,
.nav-mobile-auth button {
  font-weight: 700;
  font-size: 16px;
  color: #00a3c8;
  text-decoration: none;
  background: transparent;
  border: 2px solid rgba(0, 163, 200, 0.25);
  padding: 10px 18px;
  border-radius: 999px;
  width: min(260px, 90%);
  text-align: center;
}

.nav-mobile-auth button {
  cursor: pointer;
}

.nav-mobile-logout {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-dropdown {
  position: relative;
}

.lang-form {
  position: relative;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 163, 200, 0.25);
  background: #f5fcff;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lang-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 163, 200, 0.18);
}

.lang-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all .25s ease;
  z-index: 999;
}

.lang-form:hover .lang-menu,
.lang-form:focus-within .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  color: #1f2937;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.lang-option:hover {
  background: #f2f7fa;
  color: #00a3c8;
}

.lang-option.is-active {
  color: #00a3c8;
  background: #eef9fc;
}

.lang-code {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
  text-decoration: none;
  color: #00a3c8;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 163, 200, 0.2);
  background: #f5fcff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 163, 200, 0.18);
}

.cart-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  background-image: var(--cart-icon-url);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.cart-count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #00a3c8;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.btn-auth {
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  background: #00a3c8;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 163, 200, 0.2);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #00a3c8;
  width: 36px;
  height: 28px;
  padding: 0;
  cursor: pointer;
}

.menu-toggle .menu-icon {
  position: relative;
  width: 24px;
  height: 16px;
  display: inline-block;
}

.menu-toggle .menu-icon::before,
.menu-toggle .menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.menu-toggle .menu-icon::before { top: 0; }
.menu-toggle .menu-icon::after { bottom: 0; }
.menu-toggle .menu-icon { box-shadow: 0 7px 0 0 currentColor; }

.mobile-nav-overlay {
  position: fixed;
  top: 70px;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 2990;
}

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

.services-category-view-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 8px 18px 0;
  padding: 10px 16px !important;
  border-radius: 999px;
  border: 1px solid rgba(0, 163, 200, 0.2);
  background: #f5fcff;
  color: #00a3c8 !important;
  font-weight: 700 !important;
}

.btn-auth:hover {
  background: #0089a8;
  color: #fff;
  transform: translateY(-1px);
}

.btn-auth.outline {
  background: transparent;
  color: #00a3c8;
  border: 2px solid #00a3c8;
  box-shadow: none;
}

.btn-auth.outline:hover {
  background: #00a3c8;
  color: #fff;
}

.btn-auth.logout {
  background: #ff4f4f;
  box-shadow: 0 10px 20px rgba(255, 79, 79, 0.2);
}

.btn-auth.logout:hover {
  background: #e63e3e;
}

.lang-switch {
  display: flex;
  justify-content: flex-end;
  padding: 8px 5%;
  background: #fff;
}

.lang-switch form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lang-switch select {
  border: 1px solid rgba(0, 163, 200, 0.25);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  font-weight: 600;
  color: #0f172a;
}

.lang-switch button {
  border: 1px solid rgba(0, 163, 200, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  background: #f5fcff;
  color: #00a3c8;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 768px) {
  .main-header {
    gap: 10px;
    z-index: 3000;
    padding: 10px 5%;
    min-height: 70px;
  }
  .auth-buttons {
    display: none;
  }

  .cart-link {
    margin-right: 0;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 3;
  }

  .cart-link {
    order: 2;
  }

  .nav-links {
    order: 4;
    z-index: 3110;
    display: flex;
    position: fixed;
    top: 70px;
    right: 0;
    left: auto;
    width: min(88vw, 380px);
    height: calc(100dvh - 70px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 18px 0 24px;
    background:
      linear-gradient(180deg, rgba(245, 252, 255, 0.98) 0%, rgba(255, 255, 255, 0.99) 32%),
      #fff;
    box-shadow: -16px 0 36px rgba(15, 23, 42, 0.18);
    transform: translateX(104%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-links > a,
  .nav-links > .nav-dropdown {
    width: 100%;
  }

  .nav-links > a,
  .nav-links > .nav-dropdown > .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    font-size: 17px;
  }

  .nav-dropdown {
    border-top: 1px solid rgba(0, 163, 200, 0.08);
  }

  .nav-links > a:first-child {
    border-top: 1px solid rgba(0, 163, 200, 0.08);
  }

  .nav-links > a,
  .nav-links > .nav-dropdown > .dropdown-toggle {
    border-bottom: 1px solid rgba(0, 163, 200, 0.08);
  }

  .services-mega-menu,
  .services-categories-menu,
  .submenu-menu {
    position: static;
    width: 100%;
    min-width: 100%;
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding: 8px 0 0;
    display: none;
    background: transparent;
    border-radius: 0;
  }

  .services-branch-link,
  .services-category-link {
    min-width: 100%;
  }

  .services-categories-menu {
    grid-template-columns: 1fr;
    padding-bottom: 14px;
  }

  .services-categories-list {
    border-right: none;
    border-bottom: none;
    background: transparent;
    padding: 10px 14px 0;
  }

  .services-preview-group {
    display: none;
  }

  .services-preview-group.is-active {
    display: block;
  }

  .nav-dropdown.is-open > .dropdown-menu,
  .dropdown-submenu.is-open > .submenu-menu {
    display: block;
  }

  .nav-dropdown.is-open > .dropdown-toggle .nav-dropdown-arrow,
  .dropdown-submenu.is-open > .submenu-toggle .submenu-arrow {
    transform: rotate(135deg);
  }

  .dropdown-submenu {
    border-top: 1px solid rgba(0, 163, 200, 0.08);
  }

  .dropdown-submenu:first-child {
    border-top: none;
  }

  .submenu-toggle {
    padding: 16px 24px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
  }

  .submenu-all {
    margin: 0 10px 10px;
    padding: 14px 16px !important;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  }

  .services-category-link {
    margin: 0 10px 10px;
    padding: 16px !important;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  }

  .services-preview-pane {
    padding: 8px 0 10px;
    background: transparent;
  }

  .services-preview-title {
    margin: 2px 0 12px;
  }

  .services-preview-group {
    margin: 0 10px 10px;
    padding: 16px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  }

  .services-preview-pane a {
    padding: 12px 0 !important;
    border-bottom: 1px solid rgba(0, 163, 200, 0.08);
  }

  .services-preview-pane a:last-of-type {
    border-bottom: none;
  }

  .services-category-view-link {
    margin: 14px 0 0;
    width: 100%;
  }

  .nav-mobile-auth {
    padding: 20px 18px 0;
    border-top: 1px solid rgba(0, 163, 200, 0.08);
  }

  .auth-buttons {
    order: 5;
  }

  .nav-links.active .nav-mobile-auth {
    display: flex;
    margin-top: 6px;
  }

  .logo img {
    width: 100px;
  }

  body {
    padding-top: 82px;
  }
}
