/* ============================================================
Path: assets/css/header-section.css
Purpose: Styles for header and horizontal mobile menu (991px and below), ensuring 
banner and subsequent sections are pushed directly below with no spacing.
============================================================ */

/* ============================================================
   SECTION: HEADER
============================================================ */
.header-wrapper {
  display: flex; /* Flexbox for layout */
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  transition: all 0.9s;
  width: 100%;
  position: relative;
}
.header-wrapper .logo__menuadjust {
  display: flex; /* Flexbox for layout */
  align-items: center;
  gap: 150px;
}
@media (max-width: 1199px) {
  .header-wrapper .logo__menuadjust {
    gap: 50px;
  }
}
.header-wrapper .menu__components {
  display: flex; /* Flexbox for layout */
  align-items: center;
  gap: 20px;
}
.header-wrapper .menu__components i {
  color: #ffffff; /* replaced var(--white) */
}
.header-wrapper .menu__components .fa-bars {
  font-size: 28px;
  cursor: pointer;
  display: inline-block;
}
@media (max-width: 991px) {
  .header-wrapper .menu__components .fa-bars {
    display: none;
  }
}
.header-wrapper .main__logo .logo {
  display: block;
  width: 200px;
}
.header-wrapper .main__logo .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.header-wrapper .main-menu {
  display: flex; /* Flexbox for layout */
  align-items: center;
}
.header-wrapper .main-menu li {
  transition: all 0.4s;
  position: relative;
}
.header-wrapper .main-menu li a {
  color: #ffffff; /* replaced var(--white) */
  font-size: 16px;
  font-style: normal;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  line-height: 120%;
  text-transform: capitalize;
  padding: 40px 16px;
}
.header-wrapper .main-menu li a i {
  margin-left: 2px;
  font-size: 16px !important;
  color: #ffffff; /* replaced var(--white) */
}
.header-wrapper .main-menu li .sub-menu {
  position: relative;
  padding: 5px 5px 5px 5px;
  transition: all 0.4s;
}
@media (min-width: 992px) {
  .header-wrapper .main-menu li .sub-menu .sub-menutwo ul {
    position: absolute;
    top: -31px;
    left: 100%;
    width: 250px;
    z-index: 999;
    transition: all 0.3s;
    background: #ffffff; /* replaced var(--white) */
    box-shadow: rgba(0, 0, 0, 0.15) 0px -1px 34px 0px; /* Black with 15% opacity */
    justify-content: center;
    opacity: 0;
    gap: 5px;
    transform: translateY(55px);
    visibility: hidden;
    display: block !important;
  }
  .header-wrapper .main-menu li .sub-menu .sub-menutwo ul li a {
    color: #222222; /* replaced var(--black) */
  }
  .header-wrapper .main-menu li .sub-menu .sub-menutwo ul li:hover a {
    color: #4baf47; /* replaced var(--base) */
    padding-left: 10px;
  }
  .header-wrapper .main-menu li .sub-menu .sub-menutwo:hover ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(25px);
  }
  .header-wrapper .main-menu li .sub-menu .sub-menutwo:hover ul li a::before {
    display: none;
  }
}
@media (min-width: 992px) {
  .header-wrapper .main-menu li .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 250px;
    z-index: 999;
    transition: all 0.3s;
    background: #ffffff; /* replaced var(--white) */
    box-shadow: rgba(0, 0, 0, 0.15) 0px -1px 34px 0px; /* Black with 15% opacity */
    justify-content: center;
    opacity: 0;
    gap: 5px;
    transform: translateY(55px);
    visibility: hidden;
    display: block !important;
  }
  .header-wrapper .main-menu li .sub-menu ul {
    display: block !important;
  }
}
.header-wrapper .main-menu li .sub-menu li {
  transition: all 0.4s !important;
}
.header-wrapper .main-menu li .sub-menu li a {
  color: #222222; /* replaced var(--black) */
  text-transform: capitalize;
  font-weight: 400;
  font-size: 16px;
  width: 100%;
  display: block;
  padding: 5px 8px;
  margin: 1px;
  border-radius: 8px;
  transition: all 0.4s;
}
.header-wrapper .main-menu li .sub-menu li a::before {
  position: absolute;
  content: "";
  left: 20px;
  bottom: 10px;
  background: #4baf47; /* replaced var(--base) */
  width: 10px;
  height: 2px;
  transition: all 0.4s;
  opacity: 0;
}
.header-wrapper .main-menu li .sub-menu li a i {
  font-size: 14px !important;
}
@media (max-width: 991px) {
  .header-wrapper .main-menu li .sub-menu li a {
    font-size: 14px;
    font-weight: 500;
  }
}
@media (min-width: 992px) {
  .header-wrapper .main-menu li .sub-menu li:not(:last-child) {
    border-bottom: 1px solid #e0e0e0; /* replaced var(--border) */
  }
  .header-wrapper .main-menu li .sub-menu li a {
    padding: 10px 10px;
  }
}
.header-wrapper .main-menu li .sub-menu li:hover a {
  color: #4baf47; /* replaced var(--base) */
  padding-left: 20px;
}
.header-wrapper .main-menu li .sub-menu li:hover a::before {
  position: absolute;
  content: "";
  left: 7px;
  bottom: 18px;
  background: #4baf47; /* replaced var(--base) */
  width: 10px;
  height: 2px;
  transition: all 0.4s;
  opacity: 1;
}
@media (min-width: 992px) {
  .header-wrapper .main-menu li:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(25px);
  }
  .header-wrapper .main-menu li:hover .sub-menu::before {
    position: absolute;
    content: "";
    top: -18px;
    left: 26px;
    width: 28px;
    height: 20px;
    background: #ffffff; /* replaced #fff */
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    box-shadow: rgba(0, 0, 0, 0.15) 0px 5px 15px 0px; /* Black with 15% opacity */
  }
}
@media (max-width: 1199px) {
  .header-wrapper .main-menu {
    gap: 0 20px;
  }
  .header-wrapper .main-menu li a {
    padding: 40px 2px;
  }
}
@media (max-width: 991px) {
  .header-wrapper .main-menu {
    gap: 0 20px;
  }
  .header-wrapper .main-menu li a {
    padding: 16px 10px;
    color: #222222; /* replaced var(--black) */
  }
}
.header-wrapper .menu__right__components {
  gap: 15px;
}
@media (max-width: 500px) {
  .header-wrapper .menu__right__components {
    gap: 10px;
  }
}
@media (max-width: 1600px) {
  .header-wrapper .buttonsearch__area {
    gap: 20px;
  }
} /* FIX: Added missing closing brace */


/* Added styles for .main-menu.active container */
.header-wrapper .main-menu.active {
  background-color: #2e0c5e; /* Purple background for active menu */
  color: #ffffff; /* White font color */
  font-size: 16px; /* Font size consistent with menu items */
  transition: background-color 0.4s ease;
  z-index: 1000; /* Ensure it overlays other content */
}

/* Font color and size for active menu links */
.header-wrapper .main-menu.active > li > a {
  color: #ffffff; /* White font color */
  font-size: 16px;
  font-weight: 600;
}

/* Dropdown menu items colors inside active menu */
.header-wrapper .main-menu.active li .sub-menu {
  background-color: #3a146b; /* Slightly darker purple for dropdown background */
  color: #f0e6ff; /* Light purple text */
  box-shadow: 0 4px 10px rgba(72, 27, 130, 0.5); /* Purple tinted shadow */
}

/* Dropdown menu item links */
.header-wrapper .main-menu.active li .sub-menu li a {
  color: #f0e6ff; /* Light purple text */
  font-size: 14px;
  font-weight: 400;
  padding: 8px 12px;
  transition: color 0.3s ease;
}

/* Dropdown menu item hover */
.header-wrapper .main-menu.active li .sub-menu li:hover a {
  color: #facc15; /* Yellow highlight on hover */
  background-color: transparent;
  padding-left: 20px;
}

/* Last dropdown button arrow color */
.header-wrapper .main-menu.active li:last-child > a i {
  color: #facc15; /* Yellow arrow color */
  transition: color 0.3s ease;
}

/* Optional: Hover effect on last dropdown arrow */
.header-wrapper .main-menu.active li:last-child > a:hover i {
  color: #ffffff; /* White on hover */
}


.header-bar {
  position: relative;
  width: 31px;
  height: 20px;
}
.header-bar span {
  position: absolute;
  width: 100%;
  height: 2px;
  display: inline-block;
  transition: all 0.3s;
  left: 0;
  background: #ffffff; /* replaced var(--white) */
}
.header-bar span:first-child {
  top: 0;
  background: #ffffff; /* replaced var(--white) */
}
.header-bar span:nth-child(2) {
  top: 44%;
  background: #ffffff; /* replaced var(--white) */
}
.header-bar span:last-child {
  bottom: 0;
  background: #ffffff; /* replaced var(--white) */
}
.header-bar.active span:first-child {
  transform: rotate(45deg) translate(3px, 9px);
}
.header-bar.active span:nth-child(2) {
  opacity: 0;
}
.header-bar.active span:last-child {
  transform: rotate(-45deg) translate(3px, -9px);
}
.header-bar:hover {
  cursor: pointer;
}

/* ============================================================
   SECTION: Straddling Logo Layout Styles
   PURPOSE: Positions the main logo over the header and menu.
============================================================ */
.header-section {
  position: relative;
  display: flex; /* Use Flexbox for responsive layout */
  flex-direction: column;
  align-items: center;
  background-color: #ffffff; /* replaced var(--white) */
}
.straddle-logo {
  position: absolute;
  top: 160%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(0); /* Add translateZ for GPU acceleration */
  z-index: 20;
  transition: top 0.3s ease-in-out; /* Optimized transition */
}
.straddle-logo img {
  height: 230px;
  width: auto;
  max-width: none;
  transition: height 0.3s ease-in-out;
}
@media (min-width: 992px) {
  .header-wrapper .main__logo {
    display: none;
  }
  .header-wrapper .logo__menuadjust {
    flex-grow: 1;
    justify-content: center;
  }
  .header-wrapper .main-menu {
    justify-content: center;
    width: 100%;
  }
  .header-wrapper .main-menu > li:nth-child(3) {
    margin-right: 180px;
  }
  .header-wrapper .main-menu > li:nth-child(4) {
    margin-left: 180px;
  }
}

/* ============================================================
   SECTION: Sticky Header
============================================================ */
/* Sticky Header with Scroll Transition */
.header-section.sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #ffffff; /* replaced var(--white) */
  transition: transform 0.3s ease-in-out; /* Optimized transition */
  will-change: transform; /* Optimize for animation */
}
.header-section.sticky-header.hide {
  transform: translateY(-100%);
}

/* Minimize Logo on Scroll (Sticky) */
.header-section.sticky-header .straddle-logo img {
  height: 100px; /* Minimized size */
}
.header-section.sticky-header .straddle-logo {
  top: 50%; /* Adjust vertical centering for smaller logo */
}

/* ============================================================
   SECTION: Miscellaneous Image Sizing
============================================================ */
.footer__widget .widget__head img {
  max-width: 30%;
  height: auto;
}
.side_bar .logo img {
  max-width: 80%;
  height: auto;
}

/* ============================================================
   SECTION: Mobile Logo Size Fix
   PURPOSE: Reduce and align logo size in mobile top navbar only
============================================================ */
@media (max-width: 991px) {
  .header-wrapper {
    position: relative; /* Needed for absolute positioning of logo */
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  /* Logo container */
  .header-wrapper .main__logo {
    position: absolute; /* Position absolutely inside header-wrapper */
    left: 50%; /* Center horizontally */
    bottom: -90px; /* Straddle bottom edge by 25px */
    transform: translateX(-50%); /* Center exactly */
    z-index: 50; /* Above other elements */
    width: 120px !important; /* Double size */
    height: auto;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .header-wrapper .main__logo .logo {
    width: 100% !important;
    height: auto !important;
  }

  .header-wrapper .main__logo .logo img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
  }

  /* Keep search and hamburger menu in place */
  .header-wrapper .menu__components {
    position: relative; /* Keep normal flow */
    z-index: 10; /* Below logo */
  }
}

/* ============================================================
   SECTION: Sticky Small Logo Styling on Scroll
   PURPOSE: Adjust size and position of logo-small.png when scrolling
============================================================ */
.header-wrapper .main__logo.logo-small-active {
  /* Adjust width and height as needed */
  width: 80px !important; /* Example smaller width */
  height: auto !important;

  /* Adjust position as needed */
  bottom: -40px !important; /* Example: move logo up/down */
  left: 50% !important;
  transform: translateX(-50%) !important;

  /* Optional: add transition for smooth movement */
  transition: all 0.3s ease-in-out;
}

.header-wrapper .main__logo.logo-small-active .logo img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}

/* ------------------------------------------------------------
   MOBILE-SIDEBAR MENU COLOR OVERRIDE
   Ensures all links inside the off-canvas <ul class="mobile-main-menu">
   render in white, including submenu items and icons.
------------------------------------------------------------ */
@media (max-width: 991px) {
  /* Top-level links */
  .side_bar .mobile-main-menu > li > a,
  .mobile-main-menu > li > a {
    color: #ffffff !important;
  }

  /* Sub-menu links */
  .side_bar .mobile-main-menu .mobile-sub-menu li > a,
  .mobile-main-menu .mobile-sub-menu li > a {
    color: #ffffff !important;
  }

  /* Font-Awesome chevrons / any icons inside links */
  .side_bar .mobile-main-menu i,
  .mobile-main-menu i {
    color: #ffffff !important;
  }
}

/* ------------------------------------------------------------
   MOBILE-SIDEBAR ACCORDION
   Hides sub-menus until their parent link is tapped.
------------------------------------------------------------ */
@media (max-width: 991px) {
  /* hide by default */
  .mobile-sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  /* reveal when JS gives it the .open class */
  .mobile-sub-menu.open {
    max-height: 1000px;          /* large enough for any list */
  }
}

/* ------------------------------------------------------------
   MOBILE-SIDEBAR  ►  Pill buttons with horizontal yellow→purple
------------------------------------------------------------ */
@media (max-width: 991px) {

  /* extra breathing room */
  .side_bar .mobile-main-menu > li,
  .side_bar .mobile-main-menu .mobile-sub-menu li {
    margin-bottom: 10px;
  }

  /* pill-shape base */
  .side_bar .mobile-main-menu > li > a,
  .side_bar .mobile-main-menu .mobile-sub-menu li > a {
    display: flex;                  /* keep icon & text on one line */
    justify-content: space-between; /* pushes chevron to the right */
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    background: rgba(255,255,255,0.08);
    border-radius: 9999px;          /* fully rounded ends */
    color: #ffffff;
    transition: background 0.45s ease, color 0.25s ease;
  }

  /* tidy icon spacing */
  .side_bar .mobile-main-menu i {
    margin-left: 8px;
  }

  /* horizontal gradient on hover / focus */
  .side_bar .mobile-main-menu > li > a:hover,
  .side_bar .mobile-main-menu > li > a:focus,
  .side_bar .mobile-main-menu .mobile-sub-menu li > a:hover,
  .side_bar .mobile-main-menu .mobile-sub-menu li > a:focus {
    color: #ffffff;
    background: linear-gradient(90deg, #facc15 0%, #6610f2 100%);
    background-size: 200% 100%;
    animation: pillGradient 0.8s forwards;
  }

  @keyframes pillGradient {
    from { background-position: 0% 0%; }
    to { background-position: 100% 0%; }
  }
}

/* ============================================================
   MOBILE-SIDEBAR  ►  Scrollable panel + “more-yellow” pills
============================================================ */
@media (max-width: 991px) {

  /* 1️⃣  Make the entire sidebar scrollable */
  .side_bar,
  #targetElement {                 /* both names used in your JS */
    max-height: 100vh;            /* never exceed viewport       */
    overflow-y: auto;             /* enable vertical scroll      */
    -webkit-overflow-scrolling: touch;  /* iOS momentum scroll   */
    touch-action: pan-y;          /* be sure touch scroll works  */
    padding-right: 8px;           /* a little room for scrollbar */
  }

  /* — Optional —
     If your sidebar has a fixed header/close button at the top
     and you’d rather only scroll the list itself, you can UN-comment
     this block.  Delete the /* … */ markers first.

  .side_bar .mobile-main-menu {
    max-height: calc(100vh - 60px);  /* 60 px ≈ header height   */
    overflow-y: auto;
  }
  */

  /* 2️⃣  Spacing between items */
  .side_bar .mobile-main-menu > li,
  .side_bar .mobile-main-menu .mobile-sub-menu li {
    margin-bottom: 10px;
  }

  /* 3️⃣  Pill-style links */
  .side_bar .mobile-main-menu > li > a,
  .side_bar .mobile-main-menu .mobile-sub-menu li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    background: rgba(255,255,255,0.08);
    border-radius: 9999px;        /* full pill shape */
    color: #ffffff;
    transition: background 0.45s ease, color 0.25s ease;
  }

  /* icon spacing */
  .side_bar .mobile-main-menu i {
    margin-left: 8px;
  }

  /* 60 % yellow ➜ 40 % purple hover / focus / active */
  .side_bar .mobile-main-menu > li > a:hover,
  .side_bar .mobile-main-menu > li > a:focus,
  .side_bar .mobile-main-menu > li > a:active,
  .side_bar .mobile-main-menu .mobile-sub-menu li > a:hover,
  .side_bar .mobile-main-menu .mobile-sub-menu li > a:focus,
  .side_bar .mobile-main-menu .mobile-sub-menu li > a:active {
    color: #ffffff;
    background: linear-gradient(90deg,
                #facc15 0%,
                #facc15 60%,
                #6610f2 100%);
    background-size: 200% 100%;
    animation: pillGradientYellow 0.8s forwards;
  }

  @keyframes pillGradientYellow {
    from { background-position: 0% 0%; }
    to { background-position: 100% 0%; }
  }
}

/* -----------------------------------------------------------------
   MOBILE-SIDEBAR — width, scroll, chevron-rotate
   (keep this in the same header-section.css file)
------------------------------------------------------------------*/
@media (max-width: 991px) {

  /* phone-size width override */
  .side_bar {
    width: 100% !important;
    max-width: 100vw;
  }
  /* keep it off-canvas when hidden */
  .side_bar:not(.active) {
    max-height: 0 !important;
  }

  /* chevron flips when the submenu is open */
  .mobile-main-menu li.submenu-open > a i {
    transform: rotate(180deg);
    transition: transform .3s ease;
  }
}

/* ⬆️ un-hide the same hamburger on desktop / laptop */
@media (min-width: 992px){
  .header-wrapper .menu__components .fa-bars{        /* existing icon */
    display:inline-block !important;
  }
}

/* ============================================================
   SECTION: Mobile Menu Push Effect
   PURPOSE: Horizontal mobile menu at top (991px and below) pushes banner and sections directly below with no spacing.
============================================================ */
@media (max-width: 991px) {
  .side_bar, #targetElement {
    position: relative !important;
    width: 100% !important;
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.5s ease-in-out !important;
    background: #2e0c5e !important; /* Changed from #222222 */
    padding: 0 20px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .side_bar.active {
    max-height: 2000px !important;
  }

  .side_bar.side_bar_hidden {
    max-height: 0 !important;
  }

  /* Removed this block to allow JS margin-top to work */
  /*
  .side_bar.active + .banner__section {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  */
}

.banner__section {
  transition: margin-top 0.3s ease-in-out !important;
}

.banner__section ~ * {
  transition: margin-top 0.4s ease-in-out;
}