/* Attractive v25 — いちばん最後に読み込まれます。
 *  1. 「必須」「任意」ラベルの統一
 *  2. バナーの VIEW MORE ボタン
 *  3. ランキング（トップページ）
 *  4. メンズ／レディースの導線（ナビ・一覧の切り替え）
 */

/* =========================================================
 * 1. 「必須」「任意」ラベル
 *    必須＝ブランドの濃いゴールド地に白文字 ／ 任意＝枠線のみ
 *    （赤は入力エラー専用の色として残します）
 *    対象：会員登録情報・お届け先(.at-mf-badge)／お問い合わせ(.at-required,.at-optional)
 *          購入手続き・ログイン・新規登録（WooCommerce標準の .required「*」／.optional「(任意)」）
 * ======================================================= */
#page .at-required,
#page .at-optional,
#page .at-mf-badge,
#page .at-co-optional,
#page label .required,
#page legend .required,
#page label .optional {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 18px;
  margin: 0 0 0 8px;
  padding: 0 7px;
  border: 1px solid #d9d2c6;
  border-radius: 2px;
  background: transparent;
  color: #625b51 !important;
  font: 500 10px/1 'Noto Sans JP', sans-serif !important;
  letter-spacing: .1em;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: 2px;
  cursor: default;
}
#page .at-required,
#page .at-mf-badge.is-required,
#page label .required,
#page legend .required {
  border-color: #806326;
  background: #806326;
  color: #fff !important;
}
/* WooCommerce標準の「*」「(任意)」は文字を隠し、同じ言葉に置き換えます */
#page label .required,
#page legend .required,
#page label .optional { font-size: 0 !important; }
#page label .required::after,
#page legend .required::after { content: '必須'; font-size: 10px; }
#page label .optional::after { content: '任意'; font-size: 10px; }
/* 項目名とラベルを flex で並べている箇所は、間隔が二重にならないように */
#page .at-mf-label .at-mf-badge { margin-left: 0; }
#page .at-profile-page > p .at-mf-badge { margin: 0 4px; }

/* =========================================================
 * 2. バナーの VIEW MORE ボタン
 * ======================================================= */
.at-bnr-slide { position: relative; }
.at-bnr-cta {
  position: absolute;
  bottom: clamp(14px, 7%, 44px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 26px;
  border: 1px solid transparent;
  font: 500 14px/1 'Cormorant Garamond', 'Noto Sans JP', serif;
  letter-spacing: .22em;
  white-space: nowrap;
  transition: background .25s, color .25s, border-color .25s;
  pointer-events: none;            /* クリックはスライド全体（リンク）で受けます */
}
.at-bnr-cta--left { left: clamp(14px, 5%, 56px); }
.at-bnr-cta--right { right: clamp(14px, 5%, 56px); }
.at-bnr-cta--center { left: 50%; transform: translateX(-50%); }
.at-bnr-cta--light { background: rgba(255, 255, 255, .94); color: #171717; }
.at-bnr-cta--dark { background: #171717; color: #fff; }
.at-bnr-cta-arrow { transition: transform .25s; }
.at-bnr-slide.is-current:hover .at-bnr-cta,
.at-bnr-slide.is-current:focus-visible .at-bnr-cta { background: #806326; color: #fff; }
.at-bnr-slide.is-current:hover .at-bnr-cta-arrow { transform: translateX(4px); }
.at-bnr.is-js .at-bnr-slide:not(.is-current) .at-bnr-cta { opacity: 0; }
@media (max-width: 640px) {
  .at-bnr-cta { padding: 10px 16px; gap: 8px; font-size: 12px; letter-spacing: .16em; }
}
@media (prefers-reduced-motion: reduce) {
  .at-bnr-cta, .at-bnr-cta-arrow { transition: none; }
}

/* =========================================================
 * 3. ランキング
 * ======================================================= */
.at-rank .at-section-top { align-items: flex-end; }
.at-rank-tabs { display: inline-flex; border: 1px solid #d9d2c6; border-radius: 2px; overflow: hidden; }
.at-rank-tab {
  min-width: 112px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #625b51;
  font: 500 13px/1 'Noto Sans JP', sans-serif;
  letter-spacing: .12em;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.at-rank-tab + .at-rank-tab { border-left: 1px solid #d9d2c6; }
.at-rank-tab:hover { background: #faf7f1; color: #171717; }
.at-rank-tab.is-active { background: #171717; color: #fff; }
.at-rank-tab:focus-visible { outline: 2px solid #806326; outline-offset: -4px; }

.at-rank-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.at-rank-grid .pcard { min-width: 0; position: relative; }
.at-rank-panel[hidden] { display: none; }
.at-rank-more { margin: 28px 0 0; text-align: center; }
.at-rank-more a {
  display: inline-block; padding: 12px 4px; color: #625641; font-size: 13px;
  border-bottom: 1px solid #cdbb8b;
}
.at-rank-more a:hover { color: #806326; }

/* 順位バッジ：1〜3位は濃く、4位以下は控えめに */
.at-rank .rank-badge {
  top: 0; left: 0; width: 34px; height: 38px; padding-bottom: 6px;
  background: #ebe7e1; color: #403d39;
  font: 500 17px/1 'Cormorant Garamond', serif;
}
.at-rank .pcard:nth-child(-n+3) .rank-badge { background: #806326; color: #fff; }
.at-rank .pcard:first-child .rank-badge { background: #171717; }

.at-rank-notice {
  max-width: 1280px; margin: 24px auto; padding: 14px 18px; box-sizing: border-box;
  border: 1px dashed #c9bfae; background: #faf8f4; color: #625b51; font-size: 13px; line-height: 1.9;
}
.at-rank-notice a { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 1100px) {
  /* 5点を横スクロールで見せます（2列に折り返すと順位が読み取りにくいため） */
  .at-rank-grid {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -20px; padding: 0 20px 6px; scroll-padding-left: 20px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .at-rank-grid::-webkit-scrollbar { display: none; }
  .at-rank-grid .pcard { flex: 0 0 clamp(150px, 42vw, 240px); scroll-snap-align: start; }
}
@media (max-width: 640px) {
  .at-rank .at-section-top { flex-direction: column; align-items: stretch; gap: 18px; }
  .at-rank-tabs { display: flex; }
  .at-rank-tab { flex: 1 1 0; min-width: 0; }
}

/* =========================================================
 * 4. メンズ／レディースの導線
 * ======================================================= */
/* PCナビ：性別 →（区切り線）→ アイテム */
.main-bar .main-item-gender { font-weight: 600; }
.main-bar .main-item-gender.is-last { margin-right: clamp(10px, 1.2vw, 20px) !important; }
.main-bar .main-item-gender.is-last::after {
  content: '' !important; display: block !important; position: absolute;
  top: 50%; right: calc(clamp(10px, 1.2vw, 20px) * -.5); left: auto; bottom: auto;
  width: 1px; height: 18px; background: #d9d2c6; transform: translateY(-50%);
}

/* スマホのメニュー：いちばん上に2つ並べる */
.mobile-drawer-gender { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 0 6px; }
.mobile-drawer .mobile-drawer-gender a {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0;
  border: 1px solid #171717; color: #171717; font-weight: 500; letter-spacing: .14em;
}

/* 商品一覧：すべて／メンズ／レディース */
.at-gender-switch {
  display: flex; justify-content: center; gap: 28px;
  margin: 0 auto; padding: 22px 20px 0;
}
.at-gender-switch a {
  position: relative; padding: 10px 2px; color: #7a746b;
  font: 500 14px/1.5 'Noto Sans JP', sans-serif; letter-spacing: .12em;
}
.at-gender-switch a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
  background: #171717; transform: scaleX(0); transition: transform .2s;
}
.at-gender-switch a:hover { color: #171717; }
.at-gender-switch a.is-active { color: #171717; }
.at-gender-switch a.is-active::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .at-gender-switch a::after { transition: none; } }
