* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f2f2;
  
}

body {
  min-height: 100vh;
}

.header-bar {
  position: relative;
  width: 100%;
  min-height: 170px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  padding: 1rem 1.6rem 1rem 1.3rem;
  gap: 0.8rem;
  background-image: url('../image/background_header.jpg');
  background-size: cover;
  background-position-x: center;
  background-position-y: 80%;
  color: #fff;
}

.title-wrap,
.under-page-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 2;
}

.under-page-title-subwrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 1.3rem;
  grid-column: 1;
  min-width: 0;
}

.title-wrap h1,
.under-page-title-wrap h1,
.under-page-title-subwrap h2 {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 2px 3px 2px rgba(0, 0, 0, 0.5);
}

.title-wrap h1 {
  text-align: center;
  font-size: clamp(1.2rem, 1.5vw + 0.7rem, 2.7rem);
}

.under-page-title-subwrap h2 {
  text-align: left;
  font-size: clamp(0.85rem, 0.8vw + 0.65rem, 1.6rem);
  white-space: nowrap;
}

.under-page-title-subwrap h2 a {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.under-page-title-subwrap h2 a:hover {
  opacity: 0.9;
  filter: brightness(1.1);
}

.home-icon {
  width: 1.2em;
  height: 1.2em;
  fill: currentColor;
  flex-shrink: 0;
}

.under-page-title-wrap h1 {
  text-align: center;
  font-size: clamp(1.2rem, 1.5vw + 0.7rem, 2.7rem);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.9rem;
  grid-column: 3;
}

.phone-toggle {
  border: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: clamp(0.85rem, 0.6vw + 0.65rem, 1.4rem);
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  min-width: 200px;
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
  text-shadow: 2px 3px 2px rgba(0, 0, 0, 0.5);
}

.phone-toggle:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.phone-toggle:disabled {
  cursor: default;
}

.phone-icon {
  width: 1.2em;
  height: 1.2em;
  fill: currentColor;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.phone-toggle:disabled .phone-icon {
  transform: scale(1.06);
}

.phone-toggle span {
  display: inline-block;
  min-width: 110px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.phone-toggle:disabled span {
  opacity: 1;
  transform: translateY(0);
  animation: phoneReveal 0.35s ease;
}

@keyframes phoneReveal {
  0% {
    opacity: 0;
    transform: translateY(6px);
    letter-spacing: 0.08em;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 0;
  }
}

@media (max-width: 900px) {
  .header-bar {
    min-height: 140px;
    display: grid;
    grid-template-columns: 1fr;
    text-align: center;
    padding: 1rem 1rem 1.2rem;
    gap: 0.75rem;
  }

  .title-wrap,
  .under-page-title-wrap {
    grid-column: 1;
    width: 100%;
    justify-content: center;
  }

  .under-page-title-subwrap {
    grid-column: 1;
    width: 100%;
    justify-content: center;
    padding-left: 0;
  }

  .title-wrap h1,
  .under-page-title-wrap h1,
  .under-page-title-subwrap h2 {
    text-align: center;
  }

  .header-actions {
    grid-column: 1;
    width: 100%;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .title-wrap h1,
  .under-page-title-wrap h1 {
    font-size: clamp(1rem, 4vw, 1.8rem);
    line-height: 1.1;
  }

  .under-page-title-subwrap h2 {
    font-size: clamp(0.9rem, 3vw, 1.4rem);
    white-space: normal;
  }

  .under-page-title-subwrap h2 a {
    justify-content: center;
  }

  .phone-toggle {
    min-width: 0;
    font-size: clamp(0.8rem, 2.8vw, 1.1rem);
  }
}

@media (max-width: 480px) {
  .header-bar {
    padding: 0.9rem 0.85rem 1rem;
  }

  .header-actions {
    flex-direction: column;
  }

  .phone-toggle {
    min-width: 0;
  }

  .under-page-title-subwrap h2 a {
    gap: 0.35rem;
  }

  .home-icon {
    width: 1.05em;
    height: 1.05em;
  }
}
