/*==================================================
    MiGaRa Care
    HEADER STYLES
    Top Announcement + Main Navigation + Referral CTA
==================================================*/

/*==================================================
                MAIN HEADER
==================================================*/

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

.header-wrapper {
  display: flex;

  align-items: center;

  min-height: 82px;

  gap: 30px;
}

/*=========================
        LOGO
==========================*/

.logo {
  display: flex;

  align-items: center;

  flex-shrink: 0;
}

.logo img {
  display: block;

  width: auto;

  height: 72px;

  max-height: 72px;
}

/*=========================
        NAVIGATION
==========================*/

.navbar {
  margin-left: auto;
}

.nav-menu {
  display: flex;

  align-items: center;

  gap: 28px;
}

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  display: flex;

  align-items: center;

  gap: 6px;

  padding: 28px 0;

  color: var(--heading);

  font-family: "Poppins", sans-serif;

  font-size: 15px;

  font-weight: 600;

  line-height: 1;

  white-space: nowrap;

  transition: color 0.25s ease;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
  color: var(--primary);
}

.nav-menu > li > a i {
  font-size: 10px;

  transition: transform 0.25s ease;
}

.dropdown:hover > a i {
  transform: rotate(180deg);
}

/*=========================
        DROPDOWN
==========================*/

.dropdown-menu {
  position: absolute;

  top: calc(100% - 2px);

  left: 0;

  width: 300px;

  padding: 8px 0;

  background: #ffffff;

  border: 1px solid #eeeeee;

  border-radius: 10px;

  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1);

  opacity: 0;

  visibility: hidden;

  transform: translateY(8px);

  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease;

  overflow: hidden;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;

  visibility: visible;

  transform: translateY(0);
}

.dropdown-menu li {
  border-bottom: 1px solid #f1f1f1;
}

.dropdown-menu li:last-child {
  border-bottom: none;
}

.dropdown-menu a {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 12px;

  width: 100%;

  padding: 13px 18px;

  color: var(--heading);

  font-size: 14px;

  font-weight: 500;

  line-height: 1.4;

  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    padding-left 0.25s ease;
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
  background: #fffaf0;

  color: var(--primary);

  padding-left: 22px;
}

/*=========================
        MOBILE MENU
==========================*/

.menu-toggle {
  display: none;

  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  margin-left: auto;

  flex-shrink: 0;

  padding: 0;

  background: var(--primary);
  color: #ffffff;

  border: none;
  border-radius: 9px;

  font-size: 19px;

  line-height: 1;

  cursor: pointer;

  transition:
    background-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.menu-toggle:hover {
  background: var(--primary-dark);

  transform: translateY(-1px);

  box-shadow: 0 6px 15px rgba(184, 138, 27, 0.2);
}

.menu-toggle:focus-visible {
  outline: 3px solid rgba(184, 138, 27, 0.3);

  outline-offset: 3px;
}

/*==================================================
                    MENU BADGE
==================================================*/

.menu-badge {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  flex-shrink: 0;

  padding: 3px 7px;

  background: var(--primary);

  color: #ffffff;

  border-radius: 20px;

  font-size: 9px;

  font-weight: 700;

  letter-spacing: 0.5px;

  line-height: 1;
}

/*=========================
        RESPONSIVE
==========================*/

@media (max-width: 1100px) {
  .menu-toggle {
    display: flex;
  }

  .navbar {
    position: absolute;

    top: 100%;

    left: 0;

    width: 100%;

    background: #fff;

    max-height: 0;

    overflow: hidden;

    transition: 0.35s;

    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
  }

  .navbar.active {
    max-height: 900px;
  }

  .nav-menu {
    flex-direction: column;

    align-items: flex-start;

    gap: 0;

    padding: 20px;
  }

  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid #f1f1f1;
  }

  .nav-menu li a {
    width: 100%;
    padding: 10px 0;
  }

  .dropdown-menu {
    position: static;

    width: 100%;

    opacity: 1;

    visibility: visible;

    display: none;

    box-shadow: none;

    border-radius: 0;

    margin-top: 8px;
  }

  .dropdown.active .dropdown-menu {
    display: block;
  }
}

/*==================================================
                    MOBILE MENU
==================================================*/

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;

  display: none;

  padding: 24px 0 28px;

  background: #ffffff;

  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);

  z-index: 998;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu > .container > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-menu li {
  margin: 0;
  border-bottom: 1px solid #eeeeee;
}

.mobile-menu li:last-child {
  border-bottom: none;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;

  width: 100%;
  padding: 13px 0;

  color: var(--heading);

  font-family: "Poppins", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;

  text-decoration: none;
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--primary);
}

/*==================================================
                MOBILE SERVICES TOGGLE
==================================================*/
.mobile-services {
  position: relative;
}

.mobile-services-toggle {
  display: flex;

  align-items: center;
  justify-content: space-between;

  width: 100%;

  padding: 13px 0;

  background: transparent;
  color: var(--heading);

  border: none;

  font-family: "Poppins", sans-serif;

  font-size: 15px;
  font-weight: 600;

  line-height: 1.4;

  text-align: left;

  cursor: pointer;
}

.mobile-services-toggle span {
  pointer-events: none;
}

.mobile-services-toggle i {
  font-size: 11px;

  transition: transform 0.25s ease;
}

.mobile-services.active .mobile-services-toggle i {
  transform: rotate(180deg);
}

.mobile-services-menu {
  display: none;

  margin: 0;
  padding: 4px 0 10px;

  list-style: none;
}

.mobile-services.active .mobile-services-menu {
  display: block;
}

.mobile-services-menu li {
  border: none;
}

.mobile-services-menu a {
  display: flex;

  align-items: center;

  width: 100%;

  padding: 11px 15px;

  background: #fafafa;

  color: var(--heading);

  font-size: 14px;
  font-weight: 500;

  line-height: 1.4;

  border-left: 2px solid transparent;
}

.mobile-services-menu a:hover,
.mobile-services-menu a.active {
  background: #fffaf0;

  color: var(--primary);

  border-left-color: var(--primary);
}

/*==================================================
        MOBILE REFERRAL BUTTON - FINAL OVERRIDE
==================================================*/

.mobile-menu .mobile-referral-btn {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 9px;

  width: auto;
  min-width: 210px;
  max-width: 240px;

  margin: 22px auto 0;

  padding: 12px 20px;

  background: var(--primary);
  color: #ffffff !important;

  border: 2px solid var(--primary);
  border-radius: 9px;

  font-family: "Poppins", sans-serif;

  font-size: 14px;
  font-weight: 700;

  line-height: 1;

  text-align: center;
  text-decoration: none;

  box-shadow: 0 6px 18px rgba(184, 138, 27, 0.12);

  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.mobile-menu .mobile-referral-btn i {
  font-size: 12px;

  flex-shrink: 0;

  transition: transform 0.25s ease;
}

.mobile-menu .mobile-referral-btn:hover {
  background: var(--primary-dark);

  border-color: var(--primary-dark);

  color: #ffffff !important;

  transform: translateY(-1px);

  box-shadow: 0 8px 20px rgba(184, 138, 27, 0.2);
}

.mobile-menu .mobile-referral-btn:hover i {
  transform: translate(2px, -2px);
}

/*==================================================
                MOBILE REFERRAL BUTTON
==================================================*/

.mobile-referral-btn {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 9px;

  width: auto;
  min-width: 210px;

  min-height: 48px;

  margin: 22px auto 0;

  padding: 12px 20px;

  background: var(--primary);
  color: #ffffff !important;

  border: 2px solid var(--primary);
  border-radius: 9px;

  font-family: "Poppins", sans-serif;

  font-size: 14px;
  font-weight: 700;

  line-height: 1;

  text-align: center;
  text-decoration: none;

  box-shadow: 0 6px 18px rgba(184, 138, 27, 0.12);

  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.mobile-referral-btn i {
  font-size: 12px;

  transition: transform 0.25s ease;
}

.mobile-referral-btn:hover {
  background: var(--primary-dark);

  border-color: var(--primary-dark);

  color: #ffffff !important;

  transform: translateY(-1px);

  box-shadow: 0 8px 20px rgba(184, 138, 27, 0.2);
}

.mobile-referral-btn:hover i {
  transform: translate(2px, -2px);
}

/*==================================================
        HEADER REFERRAL DROPDOWN
==================================================*/

.header-referral-dropdown {
  position: relative;

  flex-shrink: 0;
}

/* Main Button */

.header-referral-btn {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 9px;

  min-height: 44px;

  padding: 11px 18px;

  background: var(--primary);
  color: #ffffff;

  border: 2px solid var(--primary);
  border-radius: 8px;

  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 700;

  line-height: 1;

  white-space: nowrap;

  cursor: pointer;

  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.header-referral-btn i {
  font-size: 10px;

  transition: transform 0.25s ease;
}

.header-referral-dropdown.active .header-referral-btn i {
  transform: rotate(180deg);
}

.header-referral-btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);

  transform: translateY(-1px);
}

/* Dropdown */

.referral-dropdown-menu {
  position: absolute;

  top: calc(100% + 8px);

  right: 0;

  width: 235px;

  padding: 7px;

  background: #ffffff;

  border: 1px solid #eeeeee;
  border-radius: 9px;

  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);

  opacity: 0;
  visibility: hidden;

  transform: translateY(8px);

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;

  z-index: 1000;
}

.header-referral-dropdown.active .referral-dropdown-menu {
  opacity: 1;

  visibility: visible;

  transform: translateY(0);
}

/* Dropdown links */

.referral-dropdown-menu a {
  display: block;

  width: 100%;

  padding: 12px 13px;

  color: var(--heading);

  font-family: "Poppins", sans-serif;

  font-size: 13px;

  font-weight: 600;

  line-height: 1.4;

  text-decoration: none;

  border-radius: 6px;

  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.referral-dropdown-menu a:hover {
  background: #fff8e8;

  color: var(--primary);
}

/*==================================================
        MOBILE REFERRAL DROPDOWN
==================================================*/

.mobile-menu .header-referral-dropdown {
  width: 100%;

  margin-top: 20px;

  text-align: center;
}

.mobile-menu .header-referral-btn {
  min-width: 205px;

  min-height: 46px;
}

.mobile-menu .referral-dropdown-menu {
  position: static;

  width: 100%;

  margin-top: 8px;

  text-align: left;

  transform: none;
}

.mobile-menu .header-referral-dropdown.active .referral-dropdown-menu {
  transform: none;
}

/*==================================================
            HEADER RESPONSIVE ADJUSTMENTS
==================================================*/

@media (max-width: 1200px) {
  .header-wrapper {
    gap: 20px;
  }

  .nav-menu {
    gap: 20px;
  }

  .nav-menu > li > a {
    font-size: 14px;
  }

  .header-referral-btn {
    padding: 10px 15px;
    font-size: 12px;
  }
}

@media (max-width: 1050px) {
  .navbar {
    display: none;
  }

  .header-wrapper > .header-referral-dropdown {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .header-wrapper {
    min-height: 76px;
  }

  .logo img {
    height: 66px;
    max-height: 66px;
  }

  .mobile-menu {
    display: none;
  }

  .mobile-menu.active {
    display: block;
  }
}

@media (max-width: 576px) {
  .header-wrapper {
    min-height: 70px;
  }

  .logo img {
    height: 58px;
    max-height: 58px;
  }

  .top-announcement-bar {
    height: 36px;
    padding: 0 10px;
    font-size: 9px;
    letter-spacing: 1.5px;
  }

  .menu-toggle {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
}
