/* site-layout.css */
/* サイトレイアウト関連のスタイル（ヘッダー、フッター、共通レイアウト要素） */

/* ============================================
   ヘッダー検索フォーム
   ============================================ */

/* PC版検索フォーム */
.header-search-wrapper {
  flex: 1;
  max-width: 500px;
  margin: 0 2em;
}

.header-search-form {
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.header-search-form input {
  width: 100%;
  height: 36px;
  padding: 0 3em 0 1.2em;
  font-size: 0.95em;
  border: 1px solid var(--color-border-light);
  border-radius: 9999px !important;
  outline: none;
  transition: border-color 0.2s;
  background-color: var(--color-bg-white);
}

.header-search-form input:focus {
  border-color: var(--fanika-primary);
}

.header-search-form button {
  position: absolute;
  right: 0.3em;
  height: 30px;
  width: 30px;
  border: none;
  outline: none;
  background-color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fanika-primary);
  transition: color 0.2s;
  padding: 0;
  box-shadow: none;
}

.header-search-form button:hover {
  color: var(--fanika-primary-600);
}

/* 検索ボタンの共通スタイル（PC版・スマホ版共通） */
.header-search-form button:focus,
.mobile-search-form button:focus {
  outline: none;
  box-shadow: none;
}

.header-search-form button i,
.mobile-search-form button i {
  font-size: 0.9em;
}

/* スマホ版検索フォーム */
.mobile-search-wrapper {
  padding: 0.5em 1em;
  background-color: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border-light);
}

.mobile-search-form {
  width: 100%;
}

.mobile-search-form input {
  width: 100%;
  height: 36px;
  padding: 0 3em 0 1.2em;
  font-size: 0.95em;
  border: 1px solid var(--color-border-light);
  border-radius: 9999px !important;
  outline: none;
  transition: border-color 0.2s;
  background-color: var(--color-bg-white);
}

.mobile-search-form input:focus {
  border-color: var(--fanika-primary);
}

.mobile-search-form button {
  position: absolute;
  right: 0.3em;
  height: 30px;
  width: 30px;
  border: none;
  outline: none;
  background-color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fanika-primary);
  transition: color 0.2s;
  padding: 0;
  box-shadow: none;
}

.mobile-search-form button:hover {
  color: var(--fanika-primary-600);
}

/* ============================================
   フッターリンク
   ============================================ */

.footer-links-container {
  background: var(--color-bg-light);
  border-top: 1px solid var(--color-border-light);
  padding: 1em 0;
  margin-top: 2em;
  text-align: center;
  font-size: 0.9em;
  color: var(--color-text-gray);
}

.footer-links-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1em;
}

.footer-links-wrapper {
  display: flex;
  justify-content: center;
  gap: 2em;
  flex-wrap: wrap;
  margin-bottom: 0.5em;
}

.footer-link {
  color: var(--color-link-blue);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--color-link-blue-hover);
  text-decoration: underline;
}

.footer-copyright {
  font-size: 0.8em;
  color: var(--color-text-light-gray);
}

/* ============================================
   Footer (BEM)
   ============================================ */

.footer {
  background: var(--color-white, #ffffff);
}

.footer .l-container {
  max-width: 1300px;
  padding: 60px 0;
}

.footer__inner {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding-top: 56px;
  padding-bottom: 56px;
}

.footer__brand {
  flex: 0 0 220px;
}

.footer__logo {
  display: block;
  margin-bottom: 16px;
}

.footer__logo img {
  width: 120px;
}

.footer__tagline {
  font-size: 13px;
  color: var(--color-gray-700, #666666);
  line-height: 1.9;
}

.footer__nav {
  display: flex;
  flex: 1;
  gap: 24px;
}

.footer__links {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.footer__links li {
  margin: 0;
  padding: 0;
}

.footer__links a {
  font-size: 14px;
  color: var(--color-gray-700, #666666);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer__links a::before {
  content: '›';
  color: var(--color-pink-50, #ff6b8a);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.footer__links a:hover {
  color: var(--color-pink-50, #ff6b8a);
}

.footer__cta {
  flex: 0 0 230px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__cta-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-gray-900, #1a1a1a);
  margin-bottom: 4px;
  white-space: nowrap;
}

.footer__cta-deco {
  width: 22px;
  height: auto;
  flex-shrink: 0;
}

.footer__cta-deco--flip {
  transform: scaleX(-1);
}

.btn--footer {
  width: 100%;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 14px;
}

.btn--line-outline {
  background: var(--color-white, #ffffff);
  border: 2px solid #06c755;
  color: #06c755;
}

.btn--line-outline:hover {
  opacity: 0.82;
}

.footer__copy {
  background: var(--color-blue-50, #f5f9ff);
  border-top: 1px solid var(--color-gray-200, #e5e7eb);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: var(--color-gray-700, #666666);
}

@media (max-width: 900px) {
  .footer__inner {
    flex-wrap: wrap;
    gap: 32px;
  }

  .footer__brand {
    flex: 0 0 100%;
  }

  .footer__nav {
    flex: 0 0 100%;
  }

  .footer__cta {
    flex: 0 0 100%;
  }
}

@media (max-width: 600px) {
  .footer .l-container {
    padding: 0 10px;
  }

  .footer__inner {
    flex-direction: column;
    gap: 18px;
    padding-top: 24px;
    padding-bottom: 24px;
    width: 100%;
  }

  .footer__brand {
    flex: none;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 10px;
  }

  .footer__logo {
    margin-bottom: 0;
    line-height: 0;
  }

  .footer__logo img {
    width: 100px;
  }

  .footer__tagline {
    font-size: 12px;
    line-height: 1.7;
    margin: 0;
  }

  .footer__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 10px;
  }

  .footer__links {
    flex: none;
    min-width: 0;
    gap: 8px;
    margin: 0;
    padding: 0;
  }

  .footer__links a {
    font-size: 14px;
    line-height: 1.45;
    /* Let long Japanese labels wrap inside their grid column (keep-all pushed them 24px past the viewport). */
    word-break: normal;
  }

  .footer__links a::before {
    font-size: 16px;
  }

  /* 3列目（2リンク）は横幅を有効活用して2カラム表示 */
  .footer__links:nth-child(3) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .footer__cta {
    flex: none;
    width: 100%;
    gap: 10px;
    padding: 15px 0;
  }

  .footer__cta-title {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .footer__cta-deco {
    width: 18px;
  }

  .btn--footer {
    padding: 12px 14px;
    font-size: 13px;
  }

  .btn--footer img {
    width: 20px;
    height: 20px;
  }

  .btn--footer .btn__arrow {
    font-size: 18px;
  }

  .btn--line-outline.btn--footer {
    margin-bottom: 8px;
  }

  .footer__copy {
    padding: 14px 0;
    font-size: 12px;
  }
}

/* ============================================
   共通UIプリミティブ（LP + フッター用）
   衝突回避のためスコープ限定
   ============================================ */

:where(
  .footer-links-container,
  .fanika-top-container,
  .fanika-features-container,
  .fanika-points-container,
  .fanika-cta-container
) {
  color: var(--color-gray-900, #1a1a1a);
  line-height: 1.7;
}

:where(
  .footer-links-container,
  .fanika-top-container,
  .fanika-features-container,
  .fanika-points-container,
  .fanika-cta-container
) *,
:where(
  .footer-links-container,
  .fanika-top-container,
  .fanika-features-container,
  .fanika-points-container,
  .fanika-cta-container
) *::before,
:where(
  .footer-links-container,
  .fanika-top-container,
  .fanika-features-container,
  .fanika-points-container,
  .fanika-cta-container
) *::after {
  box-sizing: border-box;
}

.u-text-pink {
  color: var(--color-pink-50, #ff6b8a);
}

.l-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 26px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.82;
}

.btn--outline {
  border: 2px solid var(--color-blue-500, #6689d7);
  color: var(--color-blue-500, #6689d7);
  background: var(--color-white, #ffffff);
}

.btn--primary {
  background: var(--color-pink-50, #ff6b8a);
  color: var(--color-white, #ffffff);
  border: 2px solid transparent;
}

.btn--hero {
  padding: 18px 52px;
  font-size: 18px;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(255, 107, 138, 0.35);
}

.btn__arrow {
  font-size: 22px;
  line-height: 1;
  margin-top: -1px;
}

/* ============================================
   ヘッダー共通スタイル
   ============================================ */

/* ヘッダーコンテナ */
.site-header.fixed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8em 1em;
  background: var(--color-bg-white);
  border-bottom: 1px solid var(--color-border-light);
  font-family: sans-serif;
  min-height: 56px;
}

/* ロゴ */
/* WordPress admin toolbar: retain the QA header layout and offset only admin-bar sessions.
   Core toolbar height is 32px on desktop and 46px on narrow screens. See #832. */
body.admin-bar .site-header.fixed-header {
  top: var(--wp-admin--admin-bar--height, 32px);
}

/* In QA, mobile body padding is 50px while logged-in header is about 65px.
   Reserve the header height below the WP toolbar without changing guest/non-admin-bar layouts. */
@media (max-width: 768px) {
  body.admin-bar {
    padding-top: 66px !important;
  }
}

.site-header.fixed-header img {
  height: 32px;
}

/* ヘッダー右側コンテナ */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.7em;
}

/* ログイン/新規登録ボタン */
.header-login-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 1.2em;
  font-weight: bold;
  color: var(--color-link-blue);
  background-color: var(--color-bg-white);
  border: 2px solid var(--color-link-blue);
  border-radius: 9999px;
  text-decoration: none;
  font-size: 0.9em;
  transition: all 0.2s;
  white-space: nowrap;
}

.header-login-button:hover {
  background-color: var(--color-link-blue);
  color: var(--color-bg-white);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.header-login-button i {
  font-size: 0.9em;
}

.header-register-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 1.2em;
  font-weight: bold;
  color: var(--color-bg-white);
  background-color: var(--fanika-primary);
  border: 2px solid var(--fanika-primary);
  border-radius: 9999px;
  text-decoration: none;
  font-size: 0.9em;
  transition: all 0.2s;
  white-space: nowrap;
}

.header-register-button:hover {
  background-color: var(--fanika-primary-600);
  border-color: var(--fanika-primary-600);
  color: var(--color-bg-white);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.header-register-button i {
  font-size: 0.9em;
}

/* 未ログイン時ヘッダー（LP向け） */
.site-header.fixed-header.guest-header {
  padding: 14px 20px;
  min-height: 76px;
  background: #f3f4f6;
  border-bottom: 1px solid #d1d5db;
}

.site-header.fixed-header.guest-header .header-logo-img {
  height: 42px;
  width: auto;
}

.site-header.fixed-header.guest-header .header-right {
  gap: 12px;
}

.site-header.fixed-header.guest-header .header-login-button,
.site-header.fixed-header.guest-header .header-register-button {
  min-width: 116px;
  padding: 9px 18px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  border-radius: 9999px;
  justify-content: center;
}

.site-header.fixed-header.guest-header .header-login-button {
  color: #6f87a6;
  background: #ffffff;
  border: 1.5px solid #b5c5d9;
}

.site-header.fixed-header.guest-header .header-login-button:hover {
  color: #57739a;
  background: #f8fbff;
  border-color: #9fb4cf;
  box-shadow: none;
  transform: none;
}

.site-header.fixed-header.guest-header .header-register-button {
  color: #ffffff;
  background: #ef5d89;
  border: 1.5px solid #ef5d89;
}

.site-header.fixed-header.guest-header .header-register-button:hover {
  background: #e64d7d;
  border-color: #e64d7d;
  box-shadow: none;
  transform: none;
}

/* FC/EC開設リンク */
.entry-links {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.fc-link {
  font-weight: bold;
  color: var(--color-accent-green);
  text-decoration: none;
  font-size: 0.95em;
  padding: 0 0.2em;
  white-space: nowrap;
}

.ec-link {
  font-weight: bold;
  color: var(--color-accent-purple);
  text-decoration: none;
  font-size: 0.95em;
  padding: 0 0.2em;
  white-space: nowrap;
}

/* ヘッダーナビゲーションアイコンリンク（メッセージ、カート、探す） */
.header-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.85em;
  color: var(--color-text-medium);
  text-decoration: none;
}

.header-nav-link i {
  font-size: 1.6em;
  width: 1.6em;
  height: 1.6em;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* メッセージ未読バッジ（P2） */
.header-nav-icon-wrap {
  position: relative;
  display: inline-flex;
}

.header-nav-link .unread-badge {
  position: absolute;
  top: -0.4em;
  right: -0.6em;
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 0.3em;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  font-size: 0.6em;
  line-height: 1.4em;
  text-align: center;
  font-weight: 700;
}

.header-nav-link .header-fc-icon {
  /* 他のFont Awesomeアイコンより一回り大きめにして視認性を確保 */
  width: 2.5em !important;
  height: 2.5em !important;
  max-width: 2.5em !important;
  max-height: 2.5em !important;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0;
  flex-shrink: 0;
}

.header-nav-link span {
  font-size: 0.65em;
  margin-top: 0.2em;
}

/* マイページリンク */
.header-mypage-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  font-weight: bold;
  color: var(--color-text-dark);
}

.avatar-image {
  width: 38px !important;
  height: 38px !important;
  max-width: 38px !important;
  max-height: 38px !important;
  border-radius: 50% !important;
  margin-right: 0.6em;
  object-fit: cover;
  display: block;
}

/* スマホ時のみ表示する「MYページへ」ラベル（PCでは非表示） */
.header-mypage-sp-label {
  display: none;
}

/* ============================================
   レスポンシブ対応
   ============================================ */

@media (max-width: 768px) {
  /* ヘッダー右側のアイコン群が折り返さないように＆間隔を少し詰める */
  .header-right {
    gap: 0.2em;
    flex-wrap: nowrap;
  }

  /* マイページリンク：左側アイコンと同じ縦並び・サイズに統一 */
  .header-mypage-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.85em;
    color: var(--color-text-medium);
    font-weight: normal;
  }
  /* アイコンエリアを32pxで固定し、テキストの位置を他アイコンと揃える */
  .header-mypage-icon-wrap {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 32px !important;
    height: 32px !important;
    flex-shrink: 0;
  }
  .header-mypage-link .avatar-image {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    margin-right: 0 !important;
  }
  .header-mypage-sp-label {
    display: block;
    font-size: 0.65em;
    margin-top: 0.2em;
    color: var(--color-text-medium);
  }
  /* マイページの名前非表示（SP時） */
  .avatar-username {
    display: none;
  }
  
  /* FC/EC開設リンクのレスポンシブ調整（SP時は改行＋行間詰め） */
  .entry-links {
    gap: 0.3em;
  }
  .fc-link, .ec-link {
    font-size: 0.9em;
    padding: 0 0.1em;
    white-space: normal;
    text-align: center;
    line-height: 1.1;
  }
  .fc-link .entry-link-line1,
  .fc-link .entry-link-line2,
  .ec-link .entry-link-line1,
  .ec-link .entry-link-line2 {
    display: block;
    line-height: 1.1;
  }
  
  /* ヘッダーのレスポンシブ調整 */
  .site-header.fixed-header {
    padding: 0.5em 0.5em !important;
    min-height: 48px !important;
  }
  .site-header.fixed-header img {
    height: 24px !important;
  }
  /* SP時：エージェント・FC・ショップメニューのアイコン画像は正円にする（.fixed-header img の height 指定を上書き） */
  .site-header.fixed-header .header-nav-link .header-fc-icon {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover;
  }
  /* SP時はロゴを小さくして段落ちを防ぐ */
  .site-header.fixed-header .header-logo-img {
    height: 20px !important;
    width: auto !important;
    max-height: 11px !important;
  }
  /* マイページのアバターは除外（左側アイコンと高さを揃えるため） */
  .site-header.fixed-header .header-mypage-link .avatar-image,
  .site-header.fixed-header .header-mypage-link .header-mypage-icon-wrap img {
    height: 32px !important;
    width: 32px !important;
    max-height: 32px !important;
    max-width: 32px !important;
  }
  
  /* ログイン/新規登録ボタンのレスポンシブ調整 */
  .header-login-button,
  .header-register-button {
    padding: 0.4em 0.9em !important;
    font-size: 0.85em !important;
    gap: 0 !important;
  }
  .header-login-button i,
  .header-register-button i {
    display: none !important;
  }
  .header-login-button span,
  .header-register-button span {
    display: inline !important;
  }

  .site-header.fixed-header.guest-header {
    padding: 10px 12px !important;
    min-height: 58px !important;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
  }

  .site-header.fixed-header.guest-header .header-logo-img {
    height: 30px !important;
    max-height: 30px !important;
  }

  .site-header.fixed-header.guest-header .header-right {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    align-items: center;
    margin-left: 8px;
  }

  .site-header.fixed-header.guest-header .header-login-button,
  .site-header.fixed-header.guest-header .header-register-button {
    min-width: auto;
    padding: 8px 12px !important;
    font-size: 12px !important;
    white-space: nowrap;
    line-height: 1;
  }

  .site-header.fixed-header.guest-header .header-logo-wrap {
    min-width: 0;
    flex: 0 1 auto;
    display: flex;
    align-items: center;
  }

  .site-header.fixed-header.guest-header .header-logo-img {
    max-width: min(46vw, 170px);
    width: auto !important;
  }
  
  /* 検索フォームのレスポンシブ調整 */
  .header-search-wrapper {
    max-width: none;
    margin: 0 0.5em;
  }
  .header-search-form input {
    font-size: 0.9em !important;
    height: 32px !important;
    padding: 0 2.5em 0 1em !important;
    border-radius: 9999px !important;
  }
  .header-search-form button {
    height: 26px !important;
    width: 26px !important;
    right: 0.25em !important;
  }
  .header-search-form button i {
    font-size: 0.85em !important;
  }
  .mobile-search-form input {
    font-size: 0.9em;
    height: 32px;
    padding: 0 2.5em 0 1em;
    border-radius: 9999px !important;
  }
  .mobile-search-form button {
    height: 26px;
    width: 26px;
    right: 0.25em;
  }
  .mobile-search-form button i {
    font-size: 0.85em;
  }

  /* SP時のFC・ショップアイコンサイズ調整（他アイコンとバランスを合わせる） */
  .header-nav-link .header-fc-icon {
    width: 1.6em !important;
    height: 1.6em !important;
    max-width: 1.6em !important;
    max-height: 1.6em !important;
  }

  /* SP時もプロフィールアイコンは正円維持（ロゴ用imgのheight指定を上書き） */
  .site-header.fixed-header .avatar-image {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover;
    display: block;
  }
  /* マイページリンク内のアイコンは32pxで統一（上記で指定済み・念のため） */
  .site-header.fixed-header .header-mypage-link .avatar-image {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
  }

  /* SP時、FC・ショップアイコンもimgの高さ指定の影響を受けないようにする */
  .site-header.fixed-header .header-fc-icon {
    height: 2.6em !important;
    max-height: 2.6em !important;
  }

  /* SP時のFC・ショップアイコンサイズ調整（他アイコンとバランスを合わせる） */
  .header-nav-link .header-fc-icon {
    width: 2em !important;
    height: 2em !important;
    max-width: 2em !important;
    max-height: 2em !important;
  }
}

