/* ==========================================================================
   ALFATOUR — site header
   Keeps the existing two-tier structure (utility bar + main bar) and the
   same menu order. Only the look, spacing and interaction are refreshed.
   ========================================================================== */

.site-header {
  position: relative;
  z-index: 1040;
  font-family: var(--af-font);
}

/* The legacy stylesheet underlines every link on hover; the header uses the
   animated rule under the active item instead, so drop the old underline. */
.site-header a,
.site-header a:hover,
.site-header a:focus {
  text-decoration: none;
}

/* ---- Utility bar -------------------------------------------------------- */

.ah-topbar {
  background-color: var(--af-ink);
  color: rgba(255, 255, 255, .78);
  font-size: 12.5px;
}

.ah-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
}

.ah-meta,
.ah-social {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ah-meta {
  flex-wrap: wrap;
}

.ah-meta a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 6px;
  color: rgba(255, 255, 255, .8);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--af-ease), background-color var(--af-ease);
}

.ah-meta a:hover,
.ah-meta a:focus {
  color: #fff;
  background-color: rgba(255, 255, 255, .07);
}

.ah-meta .bi {
  color: var(--af-red);
  font-size: 13px;
}

.ah-social {
  gap: 4px;
}

.ah-social a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: rgba(255, 255, 255, .75);
  text-decoration: none;
  transition: color var(--af-ease), background-color var(--af-ease);
}

.ah-social a:hover,
.ah-social a:focus {
  color: #fff;
  background-color: var(--af-red);
}

.ah-social .bi {
  font-size: 14px !important;
}

/* ---- Main bar ----------------------------------------------------------- */

.ah-bar {
  position: sticky;
  top: 0;
  z-index: 1035;
  background-color: #fff;
  border-bottom: 1px solid var(--af-line);
  box-shadow: 0 2px 12px rgba(16, 24, 40, .04);
}

.ah-navbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: 72px;
  padding: 0;
}

@media (min-width: 992px) {
  .ah-navbar {
    min-height: 78px;
  }
}

.ah-logo {
  display: flex;
  align-items: center;
  flex: none;
  padding: 0;
  margin: 0;
}

.ah-logo img {
  display: block;
  width: auto;
  height: 46px;
}

.ah-nav {
  flex: 1 1 auto;
  justify-content: flex-end;
}

.ah-menu {
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.ah-item {
  display: flex;
  align-items: center;
}

.ah-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px !important;
  border: 0;
  border-radius: 8px;
  color: var(--af-ink) !important;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: color var(--af-ease);
}

.ah-link::before {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--af-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}

.ah-link:hover,
.ah-link:focus,
.ah-item.active > .ah-link,
.ah-item.is-open > .ah-link,
.ah-item.show > .ah-link {
  color: var(--af-red) !important;
  text-decoration: none;
}

.ah-link:hover::before,
.ah-item.active > .ah-link::before,
.ah-item.is-open > .ah-link::before,
.ah-item.show > .ah-link::before {
  transform: scaleX(1);
}

.ah-link.dropdown-toggle::after {
  margin-left: 4px;
  border-top-color: currentColor;
  transition: transform .18s ease;
}

.ah-item.is-open > .ah-link.dropdown-toggle::after,
.ah-item.show > .ah-link.dropdown-toggle::after {
  transform: rotate(180deg);
}

/* ---- Dropdowns ---------------------------------------------------------- */

.ah-item.dropdown {
  position: relative;
}

.ah-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  display: none;
  min-width: 240px;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  background-color: #fff;
  box-shadow: var(--af-shadow-lg);
}

.ah-item.is-open > .ah-dropdown {
  display: block;
}

.ah-menu > .ah-item:last-child .ah-dropdown {
  left: auto;
  right: 0;
}

/* Invisible bridge: moving the pointer from the link into the panel keeps
   the hover state, so the panel never closes in the gap. */
@media (min-width: 992px) {
  .ah-dropdown::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -17px;
    height: 17px;
  }
}

.ah-dropdown ul {
  margin: 0;
  padding: 0;
}

.ah-dropdown a,
.ah-dropdown .dropdown-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--af-ink-soft);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: normal;
  transition: background-color var(--af-ease), color var(--af-ease);
}

.ah-dropdown a:hover,
.ah-dropdown a:focus,
.ah-dropdown .dropdown-item:hover,
.ah-dropdown .dropdown-item:focus {
  background-color: var(--af-red-soft);
  color: var(--af-red);
}

/* ---- Burger ------------------------------------------------------------- */

.ah-navbar .navbar-toggler {
  margin-left: auto;
  padding: 8px 10px;
  border: 1px solid var(--af-line);
  border-radius: 8px;
  background-color: #fff;
}

.ah-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(var(--af-red-rgb), .18);
}

.ah-navbar .navbar-toggler-icon {
  width: 22px;
  height: 22px;
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 1199.98px) {
  .ah-link {
    padding: 10px 11px !important;
    font-size: 14px;
  }

  .ah-link::before {
    left: 11px;
    right: 11px;
  }
}

@media (max-width: 991.98px) {
  .ah-navbar {
    min-height: 68px;
  }

  .ah-logo img {
    height: 40px;
  }

  .ah-nav {
    flex-basis: 100%;
    margin-top: 6px;
    padding: 6px 0 16px;
    border-top: 1px solid var(--af-line);
  }

  .ah-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin-left: 0;
  }

  .ah-item {
    display: block;
    width: 100%;
    border-bottom: 1px solid var(--af-line);
  }

  .ah-item:last-child {
    border-bottom: 0;
  }

  .ah-link {
    width: 100%;
    justify-content: space-between;
    padding: 14px 4px !important;
    border-radius: 0;
    font-size: 15px;
  }

  .ah-link::before {
    display: none;
  }

  .ah-dropdown {
    position: static !important;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 0 10px 14px;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    transform: none !important;
  }

  .ah-dropdown a,
  .ah-dropdown .dropdown-item {
    padding: 8px 4px;
  }
}

@media (max-width: 767.98px) {
  .ah-topbar__inner {
    justify-content: center;
    min-height: 34px;
  }

  .ah-meta {
    justify-content: center;
    gap: 0;
  }

  .ah-meta li:nth-child(2),
  .ah-meta li:nth-child(3) {
    display: none;
  }

  .ah-meta a {
    padding: 5px 8px;
    font-size: 12px;
  }

  .ah-social {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .ah-logo img {
    height: 36px;
  }

  .ah-meta a {
    padding: 5px 6px;
  }

  .ah-meta li:last-child {
    display: none;
  }
}
