/* Unified header — container width, visible menu on all pages */
.site-header {
  width: 100%;
  max-width: 100vw;
  left: 0;
  right: 0;
  position: fixed;
  top: 0;
  z-index: 1000;
  background: rgba(15, 7, 23, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(90, 54, 140, 0.12);
  padding-top: 10px;
  padding-bottom: 6px;
  overflow: visible;
}

.site-header__container {
  max-width: 1200px;
}

body.purple-theme {
  padding-top: 88px;
}

body.purple-mode-home {
  padding-top: 0;
}

.header-top {
  direction: ltr;
  position: relative;
  z-index: 2;
  flex-direction: row-reverse;
}

.header-actions {
  display: flex;
  gap: 26px;
  align-items: center;
}

.header-actions img {
  width: 32px;
  height: 32px;
}

.logo img {
  width: 201px;
  height: 48px;
  object-fit: contain;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(90, 54, 140, 0.35);
  background: rgba(15, 7, 23, 0.55);
  cursor: pointer;
}

.nav-toggle-bars {
  position: relative;
  width: 20px;
  height: 14px;
}

.nav-toggle-bars span {
  position: absolute;
  inset-inline: 0;
  height: 2px;
  border-radius: 2px;
  background: #b4a3d6;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}

.nav-toggle-bars span:nth-child(1) { top: 0; }
.nav-toggle-bars span:nth-child(2) { top: 6px; }
.nav-toggle-bars span:nth-child(3) { top: 12px; }

.site-header.is-nav-open .nav-toggle-bars span:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}

.site-header.is-nav-open .nav-toggle-bars span:nth-child(2) {
  opacity: 0;
}

.site-header.is-nav-open .nav-toggle-bars span:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

.main-nav .nav-drop img {
  width: 24px;
  height: 24px;
}

.nav-backdrop {
  display: none;
}

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

.nav-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Search modal */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 20px 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.search-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 7, 23, 0.72);
  backdrop-filter: blur(4px);
}

.search-modal__panel {
  position: relative;
  width: min(640px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.search-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.search-modal__head h2 {
  font-size: 1.1rem;
  margin: 0;
  color: #2a1b45;
}

.search-modal__close {
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #5a368c;
}

.search-modal__input {
  width: 100%;
  border: 1px solid rgba(90, 54, 140, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
}

.search-results {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.search-results li a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: #2a1b45;
  text-decoration: none;
}

.search-results li a:hover {
  background: rgba(90, 54, 140, 0.08);
}

.search-empty {
  margin: 12px 0 0;
  color: #6b5b85;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  justify-content: flex-start;
  align-items: center;
  margin-top: 12px;
}

.main-nav a,
.main-nav .nav-drop {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff !important;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover,
.main-nav .nav-drop:hover,
.main-nav a.active,
.main-nav .nav-drop.active {
  color: #ffffff !important;
  opacity: 0.92;
}

.header-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.header-actions button:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.05);
}

.main-nav .nav-item {
  position: relative;
}
.site-header,
.site-header .container,
.main-nav {
  overflow: visible;
}
.main-nav .nav-drop img {
  transition: transform 0.25s ease;
}
.main-nav .nav-item.is-open .nav-drop img,
.main-nav .nav-item:hover .nav-drop img {
  transform: rotate(180deg);
}
.main-nav .nav-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav .nav-sub a {
  display: block;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

@media (min-width: 992px) {
  .main-nav .nav-item.is-open .nav-sub,
  .main-nav .nav-item:hover .nav-sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .main-nav .nav-sub {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    min-width: 220px;
    padding: 8px;
    padding-top: 14px;
    border-radius: 14px;
    background: rgba(15, 7, 23, 0.96);
    border: 1px solid rgba(90, 54, 140, 0.35);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
    z-index: 120;
  }
  .main-nav .nav-sub::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 14px;
    background: transparent;
  }
  .main-nav .nav-sub a {
    padding: 10px 14px;
    border-radius: 10px;
    color: #ffffff !important;
    font-size: 15px;
    white-space: normal;
  }
  .main-nav .nav-sub a:hover {
    background: rgba(90, 54, 140, 0.35);
    color: #ffffff !important;
  }
}

@media (max-width: 991.98px) {
  body.purple-theme {
    padding-top: 72px;
  }
  .site-header {
    padding: 12px 0;
  }
  .header-top {
    direction: rtl;
    flex-direction: row;
    gap: 12px;
  }
  .nav-toggle { display: grid; order: 1; }
  .logo { order: 2; margin-inline-end: auto; }
  .header-actions { order: 3; gap: 12px; }
  .header-actions img { width: 28px; height: 28px; }
  .logo img { width: 140px; height: 34px; object-fit: contain; }
  .main-nav {
    display: none;
    position: fixed;
    inset: 72px 0 0 0;
    margin: 0;
    padding: 24px 20px 40px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    background: linear-gradient(180deg, #f7f5fc 0%, #efeaf8 100%);
    overflow-y: auto;
    z-index: 41;
  }
  .site-header.is-nav-open .main-nav {
    display: flex;
    min-height: 85vh;
  }
  .main-nav a,
  .main-nav .nav-drop {
    font-size: 16px;
    line-height: 1.4;
    width: 100%;
    justify-content: space-between;
    flex-direction: row-reverse;
    padding: 14px 12px;
    border-radius: 10px;
    border-bottom: 1px solid rgba(90, 54, 140, 0.12);
    white-space: normal;
    color: #5a368c !important;
    background: none;
    border-inline: 0;
    border-top: 0;
    cursor: pointer;
    font-family: inherit;
  }
  .main-nav a:hover,
  .main-nav .nav-drop:hover {
    background: rgba(90, 54, 140, 0.08);
    color: #45256e !important;
  }
  .main-nav .nav-sub {
    display: none;
    padding: 0 8px 8px;
  }
  .main-nav .nav-item.is-open .nav-sub {
    display: block;
  }
  .main-nav .nav-sub a {
    padding: 10px 12px;
    color: #5a368c !important;
    font-size: 15px;
    border-bottom: 1px solid rgba(90, 54, 140, 0.08);
  }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 39;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s;
  }
  .site-header.is-nav-open + .nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (max-width: 991.98px) {
  .hdl-scroller .stats-inner {
    grid-template-columns: 1fr 1fr !important;
  }
  .hdl-scroller .stats-inner h3 {
    grid-column: 1 / -1;
  }
}
@media (max-width: 575.98px) {
  .hero-controls {
    flex-wrap: wrap;
  }
  .hdl-scroller .stats-inner {
    grid-template-columns: 1fr !important;
  }
  .hdl-scroller .team-grid {
    grid-template-columns: 1fr !important;
  }
  .cube-gallery #cg-cube {
    --s: min(72vw, 42vh, 300px);
  }
  .whatsapp-fab {
    left: 12px !important;
    bottom: 12px !important;
  }
}
