/* ══════════════════════════════════════════════════════════
   ABE AUTO – header.css
   ヘッダー・ナビゲーション専用スタイル
   index.php で _next/static/chunks/tailwind.css と
   併用するため、body / h2 / page-specific ルールは含まない
══════════════════════════════════════════════════════════ */

/* ── Design Tokens (ヘッダーで使う分のみ) ───────────────── */
:root {
  --gold:        #D4AF37;
  --gold-bright: #e6c34a;
  --gold-dim:    rgba(212,175,55,0.18);
  --platinum:    #EDECEB;
  --platinum-bright: #F5F4F3;
  --pt50:        rgba(237,236,235,0.65);
  --glass:       rgba(16,16,16,0.75);
  --glass-solid: rgba(16,16,16,0.97);
  --header-h:    68px;
}

/* ── Header / Glassmorphism ────────────────────────────── */
.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--gold-dim);
  transition: background 0.4s ease;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.site-header.scrolled {
  background: var(--glass-solid);
}

.site-header .container {
  display: grid !important;
  grid-template-columns: 200px 1fr 200px !important;
  align-items: center !important;
  max-width: 1200px !important;
  width: 95% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  height: 100%;
}

/* ── Logo ──────────────────────────────────────────────── */
.site-logo-link {
  grid-column: 1;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-main {
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(212,175,55,0.2);
}

.logo-sub {
  font-size: 0.52rem;
  letter-spacing: 0.45em;
  color: var(--platinum);
  opacity: 0.38;
  text-transform: uppercase;
}

/* ── Desktop Nav ───────────────────────────────────────── */
.global-nav {
  grid-column: 2 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.global-nav ul {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 1.2rem;
  white-space: nowrap;
}

.megamenu-wrapper {
  display: flex;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--platinum);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 0;
  position: relative;
  transition: color 0.2s ease, text-shadow 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(212,175,55,0.25);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: var(--gold);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after { width: 100%; }
.nav-link.active {
  color: var(--gold);
  text-shadow: 0 0 12px rgba(212,175,55,0.2);
}

.megamenu-trigger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--platinum);
  font-size: 11px;
  padding: 4px;
  margin-left: 2px;
  line-height: 1;
  transition: color 0.2s;
}
.megamenu-trigger:hover { color: var(--gold); }

/* ── Mega Menu ─────────────────────────────────────────── */
.has-megamenu { position: relative; }

.megamenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(18,18,18,0.97);
  border: 1px solid rgba(212,175,55,0.22);
  border-radius: 12px;
  padding: 20px 22px 22px;
  z-index: 110;
  width: 680px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,175,55,0.08) inset;
}

.megamenu[hidden] { display: block; }

.megamenu.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.megamenu-heading {
  font-size: 0.6rem;
  letter-spacing: 0.45em;
  color: rgba(212,175,55,0.5);
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(212,175,55,0.10);
}

.megamenu-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.megamenu-item {
  display: flex;
  flex-direction: column;
  padding: 13px 15px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--platinum);
  border: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
  min-width: 0;
}

.megamenu-item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}
.megamenu-item:last-child:nth-child(odd) strong {
  white-space: nowrap;
  margin-bottom: 0;
  flex-shrink: 0;
}
.megamenu-item:last-child:nth-child(odd) span {
  border-left: 1px solid rgba(212,175,55,0.14);
  padding-left: 16px;
}

.megamenu-item:hover {
  border-color: rgba(212,175,55,0.25);
  background: rgba(212,175,55,0.055);
}

.megamenu-item strong {
  font-size: 0.82rem;
  color: var(--gold);
  margin-bottom: 5px;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.megamenu-item span {
  font-size: 0.74rem;
  color: var(--pt50);
  line-height: 1.55;
}

/* ── Header CTA ────────────────────────────────────────── */
.header-cta {
  grid-column: 3;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

/* ── Buttons (ヘッダー内で使用) ─────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #b8922e 100%);
  color: #050505;
  box-shadow: 0 4px 16px rgba(212,175,55,0.25);
}
.btn-primary:hover {
  box-shadow: 0 0 28px rgba(212,175,55,0.55), 0 4px 20px rgba(212,175,55,0.3);
  background: linear-gradient(135deg, var(--gold) 0%, #b8922e 100%);
  color: #050505;
  transform: translateY(-1px);
}

.header-stock-btn {
  font-size: 0.7rem;
  padding: 8px 18px;
  letter-spacing: 0.18em;
}

.btn-logout {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--pt50);
  border: 1px solid rgba(237,236,235,.2);
  border-radius: 100px;
  padding: 6px 14px;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.btn-logout:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.nav-link--search {
  color: var(--gold) !important;
}
.nav-link--search::after { background-color: var(--gold); }

/* ── Mobile Hamburger ──────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn .icon-bar {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--platinum-bright);
  transition: all 0.3s ease-in-out;
}

.mobile-menu-btn.is-active .icon-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.mobile-menu-btn.is-active .icon-bar:nth-child(2) { opacity: 0; }
.mobile-menu-btn.is-active .icon-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ── Focus ─────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header { height: 56px; }

  .site-header .container {
    display: flex !important;
    grid-template-columns: none !important;
    justify-content: space-between;
    width: 100% !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .site-logo-link { grid-column: auto; }
  .global-nav     { grid-column: auto; }
  .header-cta     { grid-column: auto; }

  .global-nav {
    position: static;
  }

  .global-nav ul {
    position: fixed;
    top: 56px;
    inset-x: 0;
    max-height: 0;
    overflow: hidden;
    background: rgba(22,22,22,0.99);
    flex-direction: column;
    flex-wrap: wrap;
    white-space: normal;
    padding: 0;
    gap: 0;
    border-top: 1px solid transparent;
    transition: max-height 0.3s ease, border-color 0.3s ease;
    z-index: 90;
  }

  .global-nav ul.show {
    max-height: 480px;
    border-top-color: var(--gold-dim);
  }

  .global-nav ul li { width: 100%; }

  .global-nav ul .nav-link {
    display: block;
    padding: 15px 24px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(212,175,55,0.07);
  }

  .megamenu-wrapper { width: 100%; }
  .megamenu-trigger,
  .megamenu { display: none; }

  .mobile-menu-btn { display: flex; }
  .header-cta { display: none; }
}