/* ============================================
   FEILIKE — Mega Menu + Mobile Panel
   ============================================ */

/* Hide old dropdown style (no longer used) */
.dropdown { display: none !important; }

/* ===== Header layout adjustment ===== */
.header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Burger hidden on desktop */
.header__burger {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: var(--transition);
}
.header__burger:hover { border-color: var(--brand); }
.header__burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--steel);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Desktop nav list (refined) ===== */
.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__list > li { position: static; }  /* mega is full-width, anchored to header */
.nav__list > li > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  color: var(--steel);
  font-weight: 500;
  font-size: 15px;
  border-radius: var(--radius);
  transition: var(--transition);
}
.nav__list > li > a:hover,
.nav__list > li > a.active {
  color: var(--brand);
  background: var(--bg-light);
}
.nav__list .caret { font-size: 10px; opacity: 0.6; transition: transform var(--transition); }
.has-mega:hover > a .caret,
.has-mega.is-open > a .caret { transform: rotate(180deg); }

/* ===== Full-width Mega Menu ===== */
.mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 20px 40px -10px rgba(6, 60, 123, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
  z-index: 99;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}
.has-mega:hover > .mega,
.has-mega.is-open > .mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega__inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 36px 24px;
}

.mega__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.mega__head h4 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.mega__viewall {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.mega__viewall:hover { color: var(--accent-hover); }

.mega__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 36px;
}

.mega-col__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-light);
  color: var(--steel);
}
.mega-col__head:hover { color: var(--brand); border-bottom-color: var(--brand); }
.mega-col__img {
  width: 36px;
  height: 36px;
  background: var(--bg-light);
  border-radius: var(--radius);
  flex-shrink: 0;
  overflow: hidden;
}
.mega-col__img img { width: 100%; height: 100%; object-fit: cover; }
.mega-col__head strong {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: inherit;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.mega-col__list {
  margin-bottom: 10px;
}
.mega-col__list li { margin: 0; }
.mega-col__list a {
  display: block;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  transition: var(--transition);
}
.mega-col__list a:hover {
  color: var(--brand);
  padding-left: 4px;
}

.mega-col__more {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.mega-col__more:hover { color: var(--accent); }

/* Mega Aside (promo) */
.mega__aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mega__promo {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.mega__promo::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px;
  height: 120px;
  background: rgba(255, 106, 19, 0.15);
  border-radius: 50%;
}
.mega__promo-eyebrow {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  position: relative;
}
.mega__promo h4 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.25;
  letter-spacing: -0.3px;
  position: relative;
}
.mega__promo p {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  margin-bottom: 16px;
  position: relative;
}
.mega__promo .btn { width: 100%; position: relative; }

.mega__perks {
  background: var(--bg-light);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
}
.mega__perks li {
  font-size: 13px;
  color: var(--text);
  padding: 5px 0;
  font-weight: 500;
}

/* ===== Mobile Panel (off-canvas slide-in) ===== */
.mobile-panel {
  position: fixed;
  top: 0; right: 0;
  width: 92%;
  max-width: 380px;
  height: 100dvh;
  background: #fff;
  z-index: 1001;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 40px rgba(6, 60, 123, 0.18);
}
.mobile-panel.is-open { transform: translateX(0); }
.mobile-panel__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 41, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 240ms;
}
.mobile-panel__backdrop.is-open { opacity: 1; visibility: visible; }
.mobile-panel__inner {
  padding: 70px 24px 32px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.mobile-panel__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  background: var(--bg-light);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  color: var(--steel);
  display: grid;
  place-items: center;
  line-height: 1;
  transition: var(--transition);
}
.mobile-panel__close:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

body.no-scroll { overflow: hidden; }

/* Mobile nav list */
.mnav { display: flex; flex-direction: column; }
.mnav > li {
  border-bottom: 1px solid var(--line);
}
.mnav > li > a,
.mnav__row > a {
  display: block;
  padding: 16px 4px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--steel);
  letter-spacing: -0.2px;
}
.mnav > li > a:hover,
.mnav__row > a:hover { color: var(--brand); }

.mnav__accordion .mnav__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mnav__row > a { flex: 1; }
.mnav__toggle {
  width: 36px;
  height: 36px;
  background: var(--bg-light);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 20px;
  color: var(--brand);
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  transition: var(--transition);
}
.mnav__toggle:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.mnav__accordion.is-open .mnav__toggle { background: var(--brand); color: #fff; border-color: var(--brand); }

.mnav__sub {
  display: none;
  padding: 8px 0 16px;
}
.mnav__accordion.is-open .mnav__sub { display: block; }

.mnav__sub-all {
  display: block;
  padding: 10px 14px;
  background: var(--bg-light);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 14px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mnav__group {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.mnav__group:last-child { border-bottom: none; margin-bottom: 0; }
.mnav__group-title {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--brand);
  margin-bottom: 6px;
  padding: 4px 0;
}
.mnav__group ul {
  padding-left: 12px;
  border-left: 2px solid var(--bg-light);
}
.mnav__group ul li a {
  display: block;
  padding: 6px 10px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  border-radius: var(--radius);
}
.mnav__group ul li a:hover {
  background: var(--bg-light);
  color: var(--brand);
}

.mobile-panel__cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .mega__grid { grid-template-columns: repeat(3, 1fr); }
  .mega__inner { grid-template-columns: 1fr 280px; gap: 28px; }
}

@media (max-width: 980px) {
  /* Hide desktop nav + desktop CTA, show burger */
  .nav { display: none; }
  .header__cta { display: none; }
  .header__burger { display: inline-flex; }
}

@media (max-width: 600px) {
  .mobile-panel { width: 100%; max-width: none; }
  .mobile-panel__inner { padding: 64px 18px 28px; }
}

/* Align mobile-bar breakpoint with burger menu (980px) */
@media (max-width: 980px) {
  .mobile-bar { display: flex; }
  body { padding-bottom: 64px; }
  .float-actions { display: none; }
}
