﻿/* Floating pill header — logo, nav, search in one row */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  max-width: 100vw;
  padding: 14px 16px 0;
  background: transparent;
  border: 0;
  overflow: visible;
  pointer-events: none;
}

.site-header__container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0;
  pointer-events: auto;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  direction: rtl;
  min-height: 64px;
  padding: 10px 22px 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(90, 54, 140, 0.96) 0%, rgba(69, 37, 110, 0.96) 55%, rgba(42, 27, 69, 0.96) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 4px 6px rgba(42, 27, 69, 0.08),
    0 14px 40px rgba(42, 27, 69, 0.22);
  overflow: visible;
}

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

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

.logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 0;
}

.logo img {
  width: 158px;
  height: 38px;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.header-actions img {
  width: 26px;
  height: 26px;
  filter: brightness(0) invert(1);
}

.header-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-actions button:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.05);
}

.nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  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: #fff;
  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 {
  flex: 1;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1.25rem;
  margin: 0;
  min-width: 0;
  overflow: visible;
}

.main-nav a,
.main-nav .nav-link,
.main-nav .nav-drop {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.86) !important;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.main-nav .nav-link--label {
  cursor: default;
}

.main-nav a:hover,
.main-nav .nav-link:hover,
.main-nav .nav-drop:hover,
.main-nav a.active,
.main-nav .nav-link.active,
.main-nav .nav-drop.active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.main-nav .nav-item__head {
  display: inline-flex;
  align-items: center;
  gap: 0;
  max-width: 100%;
}

.main-nav .nav-drop__chevron {
  width: 20px;
  height: 20px;
  transition: transform 0.25s ease;
  filter: brightness(0) invert(1);
}

.main-nav .nav-item.is-open .nav-drop__chevron {
  transform: rotate(180deg);
}

.main-nav .nav-drop__plus {
  display: none;
}

.main-nav .nav-link--dealer {
  background: rgba(255, 255, 255, 0.14) !important;
  font-weight: 600;
  color: #fff !important;
}

.main-nav .nav-link--dealer:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}

.main-nav .nav-item {
  position: relative;
}

.main-nav .nav-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.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;
}

@media (min-width: 992px) {
  .main-nav .nav-sub {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-start: 50%;
    transform: translateX(22%) translateY(12%);
    min-width: 220px;
    padding: 8px;
    border-radius: 16px;
    background: linear-gradient(160deg, #5a368c 0%, #45256e 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 14px 40px rgba(42, 27, 69, 0.28);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
    z-index: 120;
  }

  .main-nav .nav-item.is-open .nav-sub,
  .main-nav .nav-item:hover .nav-sub {
    opacity: 1;
    visibility: visible;
    transform: translateX(22%) translateY(6%);
    pointer-events: auto;
  }

  .main-nav .nav-sub a {
    display: flex;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.86) !important;
    font-size: 14px;
    white-space: normal;
  }

  .main-nav .nav-sub a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
  }
}

@media (max-width: 991.98px) {
  body.purple-theme {
    padding-top: 84px;
  }

  .site-header {
    padding: 10px 12px 0;
  }

  .site-header__bar {
    border-radius: 20px;
    min-height: 56px;
    padding: 8px 14px;
    flex-wrap: nowrap;
    /* backdrop-filter traps position:fixed descendants — disable on mobile drawer */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-toggle {
    display: grid;
    order: 1;
  }

  .logo {
    order: 2;
    margin-inline-end: auto;
  }

  .header-actions {
    order: 3;
  }

  .logo img {
    width: 130px;
    height: 32px;
  }

  .site-header.is-nav-open {
    z-index: 1100;
  }

  .site-header__bar {
    position: relative;
    z-index: 3;
  }

  /* Side drawer from right (RTL) — full viewport height */
  .main-nav {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(320px, 86vw);
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 88px 16px 28px;
    box-sizing: border-box;
    flex: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
    border-radius: 0;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    background-color: #2a1b45;
    background-image: linear-gradient(180deg, #5a368c 0%, #45256e 55%, #2a1b45 100%);
    box-shadow: -18px 0 48px rgba(15, 7, 23, 0.35);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1102;
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.32s;
  }

  body.is-nav-open .main-nav,
  .site-header.is-nav-open .main-nav {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .main-nav .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .main-nav .nav-item__head {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 4px;
  }

  .main-nav a,
  .main-nav .nav-link {
    font-size: 16px;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
    padding: 14px 10px;
    border-radius: 10px;
    white-space: normal;
    color: rgba(255, 255, 255, 0.92) !important;
  }

  .main-nav .nav-drop {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 4px 0;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
  }

  .main-nav .nav-drop__chevron {
    display: none;
  }

  .main-nav .nav-drop__plus {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    position: relative;
  }

  .main-nav .nav-drop__plus::before,
  .main-nav .nav-drop__plus::after {
    content: '';
    position: absolute;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  .main-nav .nav-drop__plus::before {
    width: 14px;
    height: 2px;
  }

  .main-nav .nav-drop__plus::after {
    width: 2px;
    height: 14px;
  }

  .main-nav .nav-item.is-open .nav-drop {
    background: rgba(255, 255, 255, 0.18);
  }

  .main-nav .nav-item.is-open .nav-drop__plus::after {
    transform: scaleY(0);
    opacity: 0;
  }

  .main-nav a:hover,
  .main-nav .nav-link:hover,
  .main-nav .nav-drop:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .main-nav .nav-sub {
    display: none;
    padding: 0 6px 10px 6px;
  }

  .main-nav .nav-item.is-open .nav-sub {
    display: block;
  }

  .main-nav .nav-sub a {
    padding: 11px 14px;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 15px;
    border-radius: 8px;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 7, 23, 0.48);
    z-index: 1090;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s;
  }

  body.is-nav-open .nav-backdrop,
  .nav-backdrop.is-visible {
    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;
  }
}
