/* ==========================================================================
   Changan Elements – Hamburger Nav Drawer
   ========================================================================== */

/* ── Reset / base ──────────────────────────────────────────────────────── */
.changan-hamburger-nav *,
.changan-hamburger-nav *::before,
.changan-hamburger-nav *::after {
  box-sizing: border-box;
}

/* ── Trigger button ────────────────────────────────────────────────────── */
.changan-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 8px;
  line-height: 1;
  position: relative;
  z-index: 10;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.changan-trigger:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

.changan-trigger i,
.changan-trigger svg {
  display: block;
  pointer-events: none;
}

/* ── Overlay ───────────────────────────────────────────────────────────── */
.changan-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 320ms ease;
  cursor: pointer;
}

.changan-drawer-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* ── Drawer ────────────────────────────────────────────────────────────── */
.changan-drawer {
  position: fixed;
  top: 0;
  width: 380px;
  height: 100%;
  max-height: 100dvh;
  background-color: #0f0f0f;
  z-index: 99999;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1),
              visibility 320ms ease;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.changan-drawer::-webkit-scrollbar {
  width: 4px;
}

.changan-drawer::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

/* Right-side drawer */
.changan-drawer--right {
  right: 0;
  left: auto;
  transform: translateX(100%);
  visibility: hidden;
}

/* Left-side drawer */
.changan-drawer--left {
  left: 0;
  right: auto;
  transform: translateX(-100%);
  visibility: hidden;
}

/* Open state */
.changan-drawer--right.is-open,
.changan-drawer--left.is-open {
  transform: translateX(0);
  visibility: visible;
}

/* ── Drawer inner ──────────────────────────────────────────────────────── */
.changan-drawer__inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 40px;
}

/* ── Drawer header (logo + close) ──────────────────────────────────────── */
.changan-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  flex-shrink: 0;
}

.changan-drawer__logo {
  flex: 1;
}

.changan-drawer__logo a {
  display: inline-block;
}

.changan-drawer__logo img {
  display: block;
  width: 140px;
  height: auto;
  max-height: 60px;
  object-fit: contain;
}

/* ── Close button ──────────────────────────────────────────────────────── */
.changan-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #ffffff;
  line-height: 1;
  flex-shrink: 0;
  margin-left: auto;
  transition: color 0.2s ease, opacity 0.2s ease;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
}

.changan-drawer__close:hover,
.changan-drawer__close:focus,
.changan-drawer__close:active {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.6);
  opacity: 1;
}

.changan-drawer__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.changan-drawer__close i,
.changan-drawer__close svg {
  display: block;
  pointer-events: none;
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.changan-nav {
  flex: 1;
}

.changan-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Top-level items ───────────────────────────────────────────────────── */
.changan-nav__item {
  margin: 0;
}

.changan-nav__item--divider + .changan-nav__item--divider {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.changan-nav__top-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 0;
  line-height: 1.3;
  cursor: pointer;
  transition: color 0.2s ease;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.changan-nav__top-link:hover,
.changan-nav__item.is-open > .changan-nav__top-link {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
}

/* ── Label with left-to-right underline animation ──────────────────────── */
.changan-nav__label {
  width: fit-content;
  position: relative;
  display: inline-block;
}

.changan-nav__label::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.changan-nav__top-link:hover .changan-nav__label::after,
.changan-nav__item.is-open > .changan-nav__top-link .changan-nav__label::after {
  transform: scaleX(1);
}

/* Arrow icon */
.changan-nav__arrow {
  display: inline-flex;
  align-items: center;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.changan-nav__arrow svg {
  display: block;
}

.changan-nav__item.is-open > .changan-nav__top-link .changan-nav__arrow {
  transform: rotate(180deg);
}

/* ── Sub-menu ──────────────────────────────────────────────────────────── */
.changan-nav__sub {
  list-style: none;
  margin: 0;
  padding: 0 0 10px 16px;
  overflow: hidden;
  /* Animation via max-height trick */
  max-height: 0;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.changan-nav__sub[hidden] {
  display: block; /* override browser [hidden] so CSS animation works */
  max-height: 0;
  padding-bottom: 0;
  visibility: hidden;
}

.changan-nav__item.is-open > .changan-nav__sub {
  max-height: 800px; /* large enough */
  visibility: visible;
}

.changan-nav__sub-item {
  margin: 0;
}

.changan-nav__sub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 8px 0;
  transition: color 0.2s ease;
}

.changan-nav__sub-link:hover {
  color: #ffffff;
  text-decoration: none;
}



/* ── Contact info ──────────────────────────────────────────────────────── */
.changan-drawer__contact {
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.changan-drawer__contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  /* Make the whole row the hover zone */
  cursor: pointer;
}

.changan-drawer__contact-item:last-child {
  margin-bottom: 0;
}

.changan-drawer__contact-icon {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.changan-drawer__contact-icon i,
.changan-drawer__contact-icon svg {
  font-size: 14px;
  width: 14px;
  display: block;
}

.changan-drawer__contact a,
.changan-drawer__contact span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.changan-drawer__contact-icon svg path {
  transition: fill 0.2s ease, color 0.2s ease;
}

/* Hovering anywhere on the row (icon OR text) changes both */
.changan-drawer__contact-item:hover .changan-drawer__contact-icon svg path {
  color: #ffffff !important;
  fill: #ffffff !important;
}

.changan-drawer__contact-item:hover a,
.changan-drawer__contact-item:hover span {
  color: #ffffff;
  text-decoration: underline;
}

/* ── Accessibility: focus ring inside drawer ───────────────────────────── */
.changan-drawer a:focus-visible,
.changan-drawer button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Body scroll lock ──────────────────────────────────────────────────── */
body.changan-drawer-open {
  overflow: hidden;
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .changan-drawer,
  .changan-drawer-overlay,
  .changan-nav__arrow,
  .changan-nav__sub {
    transition: none !important;
  }
}

/* ── Mobile adjustments ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .changan-drawer {
    width: 100% !important;
  }

  .changan-drawer__inner {
    padding: 28px 24px;
  }
}
