/* Curebell Header CSS */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Header Container */
.cb-header {
  width: 100%;
  background-color: #ffffff;
  border-bottom: 1px solid #eff0f2;
  position: sticky;
  top: 0;
  z-index: 1000;
}

@media screen and (max-width: 639px) {
  .cb-header {
    display: flex;
    flex-direction: column;
  }
}

@media screen and (min-width: 640px) {
  .cb-header {
    height: 75px;
  }
}

.cb-header__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 52px;
  padding: 12px 20px;
  max-width: 100%;
}

@media screen and (max-width: 639px) {
  .cb-header__content {
    height: 67px;
  }
}

@media screen and (min-width: 640px) {
  .cb-header__content {
    height: 100%;
    padding: 16px 20px 16px 32px;
    gap: 24px;
  }
}

/* Logo */
.cb-header__logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s;
}

.cb-header__logo-link:hover {
  opacity: 0.8;
}

.cb-header__logo-image {
  height: 40px;
  width: auto;
  object-fit: contain;
  max-width: none;
}

@media screen and (min-width: 640px) {
  .cb-header__logo-image {
    height: 50px;
  }
}

/* Center Navigation (PC only) */
.cb-header__center-navigation {
  display: none;
}

@media screen and (min-width: 640px) {
  .cb-header__center-navigation {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    justify-content: center;
    height: 100%;
  }
}

.cb-header__center-nav-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.cb-header__center-nav-button::after {
  content: '';
  display: block;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -16px;
  width: 32px;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background-color: transparent;
  transition: background-color 0.2s;
}

.cb-header__center-nav-button:hover::after {
  background-color: #5297DC;
}

.cb-header__center-nav-button[data-active="true"]::after {
  background-color: #0066CC;
}

.cb-header__center-nav-text {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  color: #383838;
  transition: color 0.2s;
}

.cb-header__center-nav-button[data-active="true"] .cb-header__center-nav-text {
  color: #0066CC;
}

/* Secondary Navigation (SP only) */
.cb-header__secondary-nav {
  display: none;
}

@media screen and (max-width: 639px) {
  .cb-header__secondary-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    border-top: 1px solid #eff0f2;
    width: 100%;
  }
}

.cb-header__secondary-nav-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  transition: background 0.2s;
}

.cb-header__secondary-nav-button::after {
  content: '';
  display: block;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 24px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background-color: transparent;
  transition: background-color 0.2s;
}

.cb-header__secondary-nav-button:hover::after {
  background-color: #5297DC;
}

.cb-header__secondary-nav-button[data-active="true"]::after {
  background-color: #0066CC;
}

.cb-header__secondary-nav-text {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  color: #383838;
  transition: color 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-header__secondary-nav-button[data-active="true"] .cb-header__secondary-nav-text {
  color: #0066CC;
}

/* Navigation Group */
.cb-header__navigation {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Navigation Button */
.cb-header__nav-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.cb-header__nav-button:hover {
  opacity: 0.8;
}

.cb-header__nav-button:hover .cb-header__accent {
  background-color: #5297dc;
  opacity: 1;
}

.cb-header__nav-button.is-active .cb-header__nav-text {
  color: #0066cc;
}

.cb-header__nav-button.is-active .cb-header__accent {
  background-color: #0066cc;
  opacity: 1;
}

.cb-header__nav-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cb-header__nav-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.cb-header__nav-text {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  color: #383838;
  text-align: center;
  white-space: nowrap;
}

/* Accent Bar */
.cb-header__accent {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background-color: transparent;
  border-radius: 2px 2px 0px 0px;
  opacity: 0;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

/* Divider */
.cb-header__divider {
  width: 1px;
  height: 41px;
  background-color: #eff0f2;
}

/* Desktop Styles */
@media screen and (min-width: 640px) {
  .cb-header__navigation {
    gap: 20px;
  }

  .cb-header__nav-content {
    gap: 4px;
  }

  .cb-header__divider {
    height: 43px;
  }

  .cb-header__accent {
    bottom: -16px;
  }

  /* Fixed width for menu button on desktop */
  .cb-header__nav-button:last-child {
    width: 50px;
  }
}

/* Hover effects for desktop only */
@media (hover: hover) and (pointer: fine) {
  .cb-header__nav-button:hover .cb-header__nav-text {
    color: #5297dc;
  }
}

/* Focus styles for accessibility */
.cb-header__nav-button:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.cb-header__nav-button:focus:not(:focus-visible) {
  outline: none;
}

.cb-header__logo-link:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
  border-radius: 4px;
}

.cb-header__logo-link:focus:not(:focus-visible) {
  outline: none;
}
