/* ─── Eina Font ──────────────────────────────────────────────────────── */
@font-face {
  font-family: "Eina03";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/39993F_3_0.woff2") format("woff2");
}
@font-face {
  font-family: "Eina03";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("fonts/39993F_0_0.woff2") format("woff2");
}
@font-face {
  font-family: "Eina03";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("fonts/39993F_0_0.woff2") format("woff2");
}
@font-face {
  font-family: "Eina03";
  font-weight: 300;
  font-style: normal;
  font-display: swap;
  src: url("fonts/39993F_2_0.woff2") format("woff2");
}

/* ─── Design System Tokens ───────────────────────────────────────────── */
:root {
  --ds-red:           #E60012;
  --ds-red-hover:     #CC0010;
  --ds-black:         #181C26;
  --ds-gray-700:      #333333;
  --ds-gray-600:      #555555;
  --ds-gray-500:      #626D7E;
  --ds-gray-400:      #888888;
  --ds-gray-300:      #999999;
  --ds-gray-200:      #DCDCDC;
  --ds-gray-150:      #D4DBE5;
  --ds-gray-100:      #EEF1F5;
  --ds-white:         #FFFFFF;

  --ds-accent:        var(--ds-red);
  --ds-bg:            var(--ds-white);
  --ds-surface:       var(--ds-white);
  --ds-surface-soft:  var(--ds-gray-100);
  --ds-text:          var(--ds-black);
  --ds-text-muted:    var(--ds-gray-500);
  --ds-text-sub:      var(--ds-gray-300);
  --ds-border:        var(--ds-gray-200);
  --ds-border-strong: var(--ds-gray-150);

  --ds-font-heading: "Eina03", "Noto Sans JP", sans-serif;
  --ds-font-body:    "EinaLatin", "Noto Sans JP", sans-serif;

  --ds-text-xs:   12px;
  --ds-text-sm:   14px;
  --ds-text-base: 16px;

  --ds-leading-snug:   1.25;
  --ds-leading-normal: 1.5;

  --ds-space-1:  4px;
  --ds-space-2:  8px;
  --ds-space-3:  12px;
  --ds-space-4:  16px;
  --ds-space-5:  20px;
  --ds-space-6:  24px;
  --ds-space-8:  32px;
  --ds-space-10: 40px;
  --ds-space-12: 48px;

  --ds-radius-md:   8px;
  --ds-radius-full: 9999px;

  --ds-shadow-lg: 0 16px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.08);

  --ds-motion-fast: 180ms;
  --ds-motion-base: 260ms;
  --ds-ease-out:    cubic-bezier(.22,1,.36,1);

  --ds-max-width: 1440px;
  --ds-gutter:    24px;
}

/* ─── Global Header ──────────────────────────────────────────────────── */
.ds-header {
  background: var(--ds-white);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 99999;
}
.ds-header-inner {
  max-width: var(--ds-max-width);
  margin: 0 auto;
  padding: var(--ds-space-5) var(--ds-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ds-logo img { height: 28px; display: block; }
.ds-nav { display: flex; align-items: center; gap: var(--ds-space-8); }

.ds-nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.ds-nav-link {
  font-family: var(--ds-font-heading);
  font-size: var(--ds-text-sm);
  font-weight: 500;
  color: var(--ds-gray-600);
  transition: color var(--ds-motion-fast) var(--ds-ease-out);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--ds-space-5) 0;
  text-decoration: none;
}
.ds-nav-link:hover { color: var(--ds-black); text-decoration: none; }

.nav-caret {
  width: 10px;
  height: 10px;
  opacity: 0.5;
  transition: transform var(--ds-motion-fast) var(--ds-ease-out),
              opacity var(--ds-motion-fast) var(--ds-ease-out);
}
.ds-nav-item:hover .nav-caret { transform: rotate(180deg); opacity: 1; }

/* ─── CTA Button ─────────────────────────────────────────────────────── */
.ds-nav-actions { display: flex; align-items: center; }
.ds-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  font-family: var(--ds-font-heading);
  font-size: var(--ds-text-sm);
  font-weight: 600;
  padding: var(--ds-space-2) var(--ds-space-5);
  border-radius: var(--ds-radius-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--ds-motion-fast) var(--ds-ease-out);
  white-space: nowrap;
  background: var(--ds-accent);
  color: var(--ds-white);
  border-color: var(--ds-accent);
  text-decoration: none;
}
.ds-cta-btn:hover {
  background: var(--ds-red-hover);
  border-color: var(--ds-red-hover);
  color: var(--ds-white);
  text-decoration: none;
}

/* ─── Mega Menu ──────────────────────────────────────────────────────── */
.mega-menu {
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ds-white);
  border-top: 1px solid var(--ds-border);
  box-shadow: var(--ds-shadow-lg);
  z-index: 49;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  overflow-y: auto;
  transition: opacity var(--ds-motion-base) var(--ds-ease-out),
              transform var(--ds-motion-base) var(--ds-ease-out);
}
.ds-nav-item:hover .mega-menu,
.mega-menu:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mega-menu-inner {
  max-width: var(--ds-max-width);
  margin: 0 auto;
  padding: var(--ds-space-10) var(--ds-gutter) var(--ds-space-12);
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
}

/* ── Left pane ───────────────────────────────────────────────────────── */
.mega-pane-left {
  padding-right: var(--ds-space-12);
}

.mega-ce-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--ds-space-1) var(--ds-space-6);
}
.mega-ce-grid--flat { display: block; }
.mega-ce-grid--flat > .cat-label { display: none; }

.mega-ce-link-list--flat {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  flex-direction: unset !important;
  gap: 0 var(--ds-space-6) !important;
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-ce-cat-label {
  grid-column: 1 / -1;
  padding: var(--ds-space-4) 0 var(--ds-space-1);
  font-family: "Eina03", "Noto Sans JP", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-text-sub);
}
.mega-ce-cat-label:first-child { padding-top: 0; }

.mega-ce-section-label {
  font-family: "Eina03", "Noto Sans JP", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ds-text-muted);
  padding-bottom: var(--ds-space-3);
  margin-bottom: var(--ds-space-2);
  border-bottom: 1px solid var(--ds-border);
  display: block;
}
.mega-section-link {
  text-decoration: none;
  transition: color var(--ds-motion-fast) var(--ds-ease-out);
}
.mega-section-link:hover {
  color: var(--ds-accent);
  border-bottom-color: var(--ds-accent);
}

.mega-ce-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--ds-space-4);
  padding: 0;
}

.mega-ce-link {
  display: block;
  padding: 7px var(--ds-space-2);
  border-radius: var(--ds-radius-md);
  transition: background var(--ds-motion-fast) var(--ds-ease-out);
  text-decoration: none;
}
.mega-ce-link:hover { background: var(--ds-surface-soft); text-decoration: none; }

.mega-ce-link-name {
  font-family: var(--ds-font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--ds-text);
  display: block;
  line-height: var(--ds-leading-snug);
  transition: color var(--ds-motion-fast) var(--ds-ease-out);
}
.mega-ce-link:hover .mega-ce-link-name { color: var(--ds-accent); }

.mega-ce-link-desc {
  font-family: var(--ds-font-body);
  font-size: 13px;
  color: var(--ds-text-muted);
  line-height: 1;
  margin-top: 3px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Right pane ──────────────────────────────────────────────────────── */
.mega-pane-right {
  padding-left: 24px;
  margin-left: 24px;
  padding-top: 69px;
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-8);
  border-left: none;
  position: relative;
}
.mega-pane-right::before {
  content: '';
  position: absolute;
  left: 0;
  top: 69px;
  bottom: 0;
  width: 1px;
  background: var(--ds-border);
}

.mega-right-section-label {
  font-family: "Eina03", "Noto Sans JP", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ds-text-muted);
  padding-bottom: var(--ds-space-3);
  margin-bottom: var(--ds-space-2);
  border-bottom: 1px solid var(--ds-border);
}

.mega-right-link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

.mega-right-link {
  display: block;
  padding: 7px var(--ds-space-2);
  border-radius: var(--ds-radius-md);
  transition: background var(--ds-motion-fast) var(--ds-ease-out);
  text-decoration: none;
}
.mega-right-link:hover { background: var(--ds-surface-soft); text-decoration: none; }

.mega-right-link-name {
  font-family: var(--ds-font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--ds-text);
  display: block;
  line-height: var(--ds-leading-snug);
  transition: color var(--ds-motion-fast) var(--ds-ease-out);
}
.mega-right-link:hover .mega-right-link-name { color: var(--ds-accent); }

.mega-right-link-desc {
  font-family: var(--ds-font-body);
  font-size: 13px;
  color: var(--ds-text-muted);
  line-height: 1.3;
  margin-top: 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Close button (mobile only) ──────────────────────────────────────── */
.mega-close-btn { display: none; }
.mega-close-btn-label {
  font-family: "Eina03", "Noto Sans JP", sans-serif;
  font-size: var(--ds-text-sm);
  font-weight: 600;
  color: var(--ds-text);
}
.mega-close-btn-x {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--ds-text-muted);
  border: none;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.mega-close-btn-x:active { opacity: 0.5; }

/* ─── Mobile: desktop/mobile visibility ──────────────────────────────── */
.mega-ce-mobile-only { display: none; }
.cat-label { display: none; }
.cat-body { display: block; }

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --ds-gutter: 20px; }
  .ds-nav { gap: var(--ds-space-4); }
}

/* ─── Mobile Mega Menu (body.is-mobile) ──────────────────────────────── */
body.is-mobile .mega-menu {
  position: fixed !important;
  top: 56px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  transform: none !important;
  overflow-y: auto;
  z-index: 200;
}
body.is-mobile .ds-nav-item:hover .mega-menu { opacity: 0; pointer-events: none; }
body.is-mobile .ds-nav-item.open .mega-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
body.is-mobile .ds-nav-item.open .nav-caret { transform: rotate(180deg); opacity: 1; }

body.is-mobile .mega-menu-inner {
  grid-template-columns: 1fr !important;
  padding: var(--ds-space-6) var(--ds-gutter) var(--ds-space-10);
  gap: 0;
}
body.is-mobile .mega-pane-left {
  padding-right: 0;
  border-right: none;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
body.is-mobile .mega-ce-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}
body.is-mobile .mega-ce-desktop-only { display: none !important; }
body.is-mobile .mega-ce-mobile-only {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}
body.is-mobile .mega-ce-cat-label { display: none !important; }

/* Other+JV wrapper の border-top と padding-top をスマホで解除 */
body.is-mobile .mega-ce-grid > div[style*="border-top"] {
  border-top: none !important;
  padding-top: 0 !important;
}
body.is-mobile .mega-ce-grid > div[style*="grid-column"] { display: block !important; }
body.is-mobile .mega-ce-link-list[style*="grid-template-columns"] {
  display: flex !important;
  flex-direction: column !important;
}
body.is-mobile div[style*="grid-column:2"] { display: block !important; }

/* スマホ用アコーディオン */
body.is-mobile .cat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--ds-space-2);
  min-height: 48px;
  cursor: pointer;
  border-bottom: 1px solid var(--ds-surface-soft);
  user-select: none;
  -webkit-user-select: none;
  transition: background var(--ds-motion-fast) var(--ds-ease-out);
}
body.is-mobile .cat-label:active { background: var(--ds-surface-soft); }
body.is-mobile .cat-label .acc-label {
  font-family: "Eina03", "Noto Sans JP", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-text-sub);
}
body.is-mobile .cat-label .acc-caret {
  width: 10px;
  height: 10px;
  color: var(--ds-text-sub);
  transition: transform var(--ds-motion-fast) var(--ds-ease-out);
  flex-shrink: 0;
}
body.is-mobile .cat-label.open .acc-caret { transform: rotate(180deg); }

body.is-mobile .cat-body {
  display: none;
  padding-left: var(--ds-space-2);
  padding-bottom: var(--ds-space-2);
}
body.is-mobile .cat-body.open { display: block; }
body.is-mobile .mega-ce-link-list { margin-bottom: 0; }
body.is-mobile .mega-pane-right {
  padding-left: 0;
  padding-top: 20px;
  gap: var(--ds-space-6);
}
body.is-mobile .mega-pane-right::before { display: none; }
body.is-mobile .mega-right-section-label { display: block; width: 100%; }

body.is-mobile .mega-close-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--ds-gutter);
  height: 56px;
  border-bottom: 1px solid var(--ds-border);
  position: sticky;
  top: 0;
  background: var(--ds-white);
  z-index: 1;
  flex-shrink: 0;
}

/* ─── Override existing Bootstrap navbar styles ──────────────────────── */
.ds-header .ds-nav-link,
.ds-header .ds-nav-link:focus,
.ds-header .ds-nav-link:active {
  text-decoration: none;
  outline: none;
}

/* Account for fixed header height */
#main-header .top-fv {
  padding-top: 68px;
}
