/*
 * Thiqah Tech Oman - custom header with mega menu
 * Colors are taken from the ThiqahTech logo (navy + maroon) rather than
 * the theme's default purple, so the header matches the brand mark.
 */

.thiqah-header {
  --thiqah-ink: #12233F;                        /* navy - ThiqahTech logo */
  --thiqah-accent: #7C1F2E;                      /* maroon - ThiqahTech logo */
  --thiqah-muted: var(--body-color, #737887);
  --thiqah-bg: var(--white-color, #ffffff);
  --thiqah-surface: #F4F5F8;
  --thiqah-border: #ECEEF3;
  --thiqah-accent-soft: rgba(124, 31, 46, 0.10);

  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--thiqah-bg);
  border-bottom: 1px solid var(--thiqah-border);
  transition: box-shadow .25s ease, padding .25s ease;
}

.thiqah-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(20, 29, 56, 0.08);
}

.thiqah-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  transition: padding .25s ease;
}

.thiqah-header.is-scrolled .thiqah-header__inner {
  padding: 12px 0;
}

.thiqah-header__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.thiqah-header__logo img {
  display: block;
  max-height: 42px;
  width: auto;
}

.thiqah-header__logo h2 {
  margin: 0;
}

.thiqah-header__logo a {
  text-decoration: none;
  color: var(--thiqah-ink);
}

/* Primary nav (desktop) */
.thiqah-header__nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.thiqah-header__menu {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Top-level links share the same look whether they're a plain <a>
   or a <button> mega-menu trigger. */
.thiqah-header__menu > li > a,
.thiqah-header__menu > li > .thiqah-mega-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--thiqah-ink);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
  white-space: nowrap;
}

.thiqah-header__menu > li > a i,
.thiqah-header__menu > li > .thiqah-mega-toggle i {
  font-size: 14px;
  color: var(--thiqah-muted);
  transition: color .2s ease, transform .2s ease;
}

.thiqah-header__menu > li > a:hover,
.thiqah-header__menu > li > a:focus-visible,
.thiqah-header__menu > li > .thiqah-mega-toggle:hover,
.thiqah-header__menu > li > .thiqah-mega-toggle:focus-visible {
  background: var(--thiqah-surface);
  color: var(--thiqah-accent);
}

.thiqah-header__menu > li > a:hover i,
.thiqah-header__menu > li > a:focus-visible i,
.thiqah-header__menu > li > a.is-active i,
.thiqah-header__menu > li > .thiqah-mega-toggle:hover i,
.thiqah-header__menu > li > .thiqah-mega-toggle:focus-visible i,
.thiqah-header__menu > li > .thiqah-mega-toggle.is-active i {
  color: var(--thiqah-accent);
}

.thiqah-header__menu > li > a.is-active,
.thiqah-header__menu > li > .thiqah-mega-toggle.is-active {
  background: var(--thiqah-surface);
  color: var(--thiqah-accent);
}

.thiqah-mega-toggle__caret {
  font-size: 10px !important;
  margin-left: -2px;
}

.thiqah-header__has-mega.is-open .thiqah-mega-toggle__caret {
  transform: rotate(180deg);
}

/* Mega menu panel.
   Deliberately no `position: relative` on .thiqah-header__has-mega: the
   panel is positioned against .thiqah-header (position: sticky) so it
   stays centered under the whole header regardless of which trigger
   opened it, matching the reference design. */
.thiqah-header__has-mega {
  position: static;
}

.thiqah-mega {
  position: absolute;
  top: 100%;
  left: 50%;
  width: min(900px, 92vw);
  margin-top: 14px;
  padding: 28px;
  background: var(--thiqah-bg);
  border: 1px solid var(--thiqah-border);
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(20, 29, 56, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  z-index: 998;
}

.thiqah-header__has-mega.is-open > .thiqah-mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.thiqah-mega__columns {
  display: grid;
  gap: 32px;
  text-align: left;
}

.thiqah-mega__columns--1 {
  grid-template-columns: 1fr;
}

.thiqah-mega__columns--2 {
  grid-template-columns: repeat(2, 1fr);
}

.thiqah-mega__columns--3 {
  grid-template-columns: 1.15fr 1fr 1fr;
}

.thiqah-mega__heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--thiqah-muted);
}

/* Plain link list (Consulting & Support / Company columns) */
.thiqah-mega__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thiqah-mega__list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--thiqah-ink);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
}

.thiqah-mega__list a i {
  width: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--thiqah-muted);
}

.thiqah-mega__list a:hover,
.thiqah-mega__list a.is-active {
  background: var(--thiqah-surface);
  color: var(--thiqah-accent);
}

.thiqah-mega__list a:hover i,
.thiqah-mega__list a.is-active i {
  color: var(--thiqah-accent);
}

/* Feature cards: icon box + title + short description, 2-up grid */
.thiqah-mega__cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  align-items: start;
}

.thiqah-mega__cards a {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  text-decoration: none;
  transition: background-color .15s ease;
}

.thiqah-mega__cards a:hover,
.thiqah-mega__cards a.is-active {
  background: var(--thiqah-surface);
}

.thiqah-mega__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--thiqah-accent-soft);
  color: var(--thiqah-accent);
  font-size: 16px;
}

.thiqah-mega__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thiqah-mega__title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--thiqah-ink);
}

.thiqah-mega__desc {
  font-size: 12.5px;
  color: var(--thiqah-muted);
}

/* Compact grid (Products: 2-column icon cards) */
.thiqah-mega__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.thiqah-mega__grid a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--thiqah-surface);
  color: var(--thiqah-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: border-color .15s ease, background-color .15s ease;
}

.thiqah-mega__grid a i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  color: var(--thiqah-accent);
}

.thiqah-mega__grid a:hover,
.thiqah-mega__grid a.is-active {
  border-color: var(--thiqah-accent);
  background: var(--thiqah-bg);
}

/* Actions: CTA + mobile toggle */
.thiqah-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.thiqah-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--thiqah-ink);
  color: var(--thiqah-bg);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, transform .2s ease;
}

.thiqah-header__cta i {
  font-size: 13px;
  transition: transform .2s ease;
}

.thiqah-header__cta:hover,
.thiqah-header__cta:focus-visible {
  background: var(--thiqah-accent);
  color: var(--thiqah-bg);
  transform: translateY(-1px);
}

.thiqah-header__cta:hover i {
  transform: translateX(3px);
}

.thiqah-header__cta--block {
  display: flex;
  justify-content: center;
  margin-top: auto;
}

/* Hamburger toggle */
.thiqah-header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--thiqah-border);
  border-radius: 10px;
  background: var(--thiqah-bg);
  cursor: pointer;
  padding: 0;
}

.thiqah-header__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--thiqah-ink);
  transition: transform .25s ease, opacity .25s ease;
}

.thiqah-header__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.thiqah-header__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.thiqah-header__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile off-canvas menu */
.thiqah-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 29, 56, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 1000;
}

.thiqah-mobile-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.thiqah-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 88vw);
  background: var(--thiqah-bg);
  box-shadow: -12px 0 32px rgba(20, 29, 56, 0.12);
  display: flex;
  flex-direction: column;
  padding: 20px;
  transform: translateX(100%);
  transition: transform .3s ease;
  z-index: 1001;
}

.thiqah-mobile-menu.is-open {
  transform: translateX(0);
}

.thiqah-mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--thiqah-border);
}

.thiqah-mobile-menu__close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--thiqah-border);
  background: var(--thiqah-bg);
  color: var(--thiqah-ink);
  cursor: pointer;
}

.thiqah-mobile-menu__list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.thiqah-mobile-menu__list > li > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border-radius: 10px;
  color: var(--thiqah-ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}

.thiqah-mobile-menu__list > li > a i {
  width: 20px;
  text-align: center;
  color: var(--thiqah-muted);
}

.thiqah-mobile-menu__list > li > a:hover,
.thiqah-mobile-menu__list > li > a.is-active {
  background: var(--thiqah-surface);
  color: var(--thiqah-accent);
}

.thiqah-mobile-menu__list > li > a:hover i,
.thiqah-mobile-menu__list > li > a.is-active i {
  color: var(--thiqah-accent);
}

/* Mobile accordion (mega menu items collapse into groups) */
.thiqah-mobile-menu__accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 12px;
  border: none;
  background: none;
  border-radius: 10px;
  font-family: inherit;
  color: var(--thiqah-ink);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
}

.thiqah-mobile-menu__accordion-toggle:hover {
  background: var(--thiqah-surface);
}

.thiqah-mobile-menu__accordion-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

.thiqah-mobile-menu__accordion-label i {
  width: 20px;
  text-align: center;
  color: var(--thiqah-muted);
}

.thiqah-mobile-menu__accordion-toggle .fa-chevron-down {
  font-size: 11px;
  color: var(--thiqah-muted);
  transition: transform .2s ease;
}

.thiqah-mobile-menu__accordion.is-open .thiqah-mobile-menu__accordion-toggle .fa-chevron-down {
  transform: rotate(180deg);
}

.thiqah-mobile-menu__accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.thiqah-mobile-menu__group-heading {
  margin: 10px 0 6px;
  padding-left: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--thiqah-muted);
}

.thiqah-mobile-menu__accordion-panel ul {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
}

.thiqah-mobile-menu__accordion-panel ul a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--thiqah-ink);
  text-decoration: none;
  font-size: 14px;
}

.thiqah-mobile-menu__accordion-panel ul a i {
  width: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--thiqah-muted);
}

.thiqah-mobile-menu__accordion-panel ul a:hover,
.thiqah-mobile-menu__accordion-panel ul a.is-active {
  background: var(--thiqah-surface);
  color: var(--thiqah-accent);
}

.thiqah-mobile-menu__accordion-panel ul a:hover i,
.thiqah-mobile-menu__accordion-panel ul a.is-active i {
  color: var(--thiqah-accent);
}

body.thiqah-menu-open {
  overflow: hidden;
}

/* Breakpoints: collapse to the off-canvas menu below desktop (992px) */
@media (max-width: 991.98px) {
  .thiqah-header__nav {
    display: none;
  }

  .thiqah-header__actions .thiqah-header__cta {
    display: none;
  }

  .thiqah-header__toggle {
    display: inline-flex;
  }
}

@media (max-width: 575.98px) {
  .thiqah-header__logo img {
    max-height: 34px;
  }

  .thiqah-header__inner {
    padding: 14px 0;
  }

  .thiqah-mobile-menu {
    width: 100vw;
  }
}
