/**
 * search-custom.css
 * 検索ページカスタムスタイル - スケルトンスクリーン
 */

/* ===========================================
   ヘッダー分のオフセット（レイアウトシフト防止）
   JSが100ms後にbodyにpadding-topを設定するため、
   CSSで先に同じ値を確保しておく
   =========================================== */
body {
  padding-top: 119px;
}

/* ===========================================
   見出しレイアウトシフト防止
   =========================================== */
.fs-c-heading--page {
  min-height: 43px !important;
}

@media (max-width: 767px) {
  .fs-c-heading--page {
    min-height: 32px;
  }
}

/* ===========================================
   シマーアニメーション
   =========================================== */
@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===========================================
   スケルトン基本スタイル
   =========================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    #e8e8e8 25%,
    #f5f5f5 50%,
    #e8e8e8 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-container {
  transition: opacity 0.3s ease-out;
}

.skeleton-container.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ===========================================
   商品グリッドスケルトン
   =========================================== */
.skeleton-products {
  display: flex;
  flex-wrap: wrap;
  gap: 30px 26px;
  /* margin-top: 30px; */
}

/* ===========================================
   レイアウトシフト対策
   =========================================== */
/* 商品グリッドコンテナの最小高さを確保 */
[data-popfind="searchresults"] {
  min-height: 800px;
}

/* 商品画像のアスペクト比を固定 */
[data-popfind="searchresults"] ._item ._image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}


.skeleton-product-item {
  width: calc(25% - 20px);
  box-sizing: border-box;
}

.skeleton-product-image {
  width: 100%;
  padding-bottom: 100%; /* 1:1 アスペクト比 */
  margin-bottom: 15px;
  border-radius: 0;
}

.skeleton-product-tag {
  display: inline-block;
  width: 50px;
  height: 24px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.skeleton-product-brand {
  width: 30%;
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-product-name {
  width: 100%;
  height: 14px;
  margin-bottom: 6px;
}

.skeleton-product-name.short {
  width: 80%;
}

.skeleton-product-price {
  width: 40%;
  height: 16px;
  margin-top: 10px;
}


/* ===========================================
   ページネーションスケルトン
   =========================================== */
.skeleton-pagination-container {
  margin-top: 40px;
}

.skeleton-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.skeleton-pagination-item {
  width: 40px;
  height: 40px;
  border-radius: 4px;
}

/* ===========================================
   検索ステータスプレースホルダー
   =========================================== */
.search-status-placeholder {
  color: #000;
}

/* ===========================================
   レスポンシブ対応
   =========================================== */
@media (max-width: 767px) {
  .skeleton-product-item {
    width: calc(50% - 8px);
  }

  .skeleton-products {
    gap: 20px 16px;
  }

  .skeleton-pagination-item {
    width: 36px;
    height: 36px;
  }
}

/* ===========================================
   商品画像フェードイン
   =========================================== */
[data-popfind="searchresults"] ._item ._image img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

[data-popfind="searchresults"] ._item ._image img.is-loaded {
  opacity: 1;
}


/* ===========================================
   ブランドアコーディオン
   =========================================== */
._attributegroup_brand {
  border-top: 1px solid #D7D7D7;
  padding-bottom: 15px !important;
}

._attributegroup_brand > ._group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 14px !important;
  font-weight: bold;
  margin-bottom: 0;
}

._attributegroup_brand > ._group::after {
  content: '' !important;
  display: block !important;
  width: 30px !important;
  height: 30px !important;
  background: url('https://sundaymountain.itembox.design/item/assets/images/icon_arrow_down_gray-s.svg') no-repeat center !important;
  background-size: contain !important;
  transform: rotate(0deg);
  transition: transform 0.3s;
  flex-shrink: 0;
  border: none !important;
}

._attributegroup_brand._open > ._group::after {
  transform: rotate(180deg);
}

@media (max-width: 767px) {
  ._attributegroup_brand > ._group::after {
    background: url('https://sundaymountain.itembox.design/item/assets/images/icon_arrow_down_white-s.svg') no-repeat center !important;
    height: 20px !important;
    background-size: 24px !important;
  }
}

/* ブランドコンテンツ（アコーディオン用） */
._attributegroup_brand > ._attributes {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

._attributegroup_brand._open > ._attributes {
  max-height: 500px;
}

/* ブランド詳細リスト（アコーディオン連動） */
._attributegroup_brand ~ .attributeList {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

._attributegroup_brand._open ~ .attributeList {
  max-height: 2000px;
}

/* ブランド詳細リストの見出し非表示 */
._attributegroup_brand ~ .attributeList ._group {
  display: none !important;
}

/* ブランド詳細リストのチェックボックス左padding削除 */
._attributegroup_brand ~ .attributeList ._attribute {
  padding-left: 0 !important;
}

._attributegroup_brand ~ .attributeList ._attributegroup {
  padding-left: 0 !important;
}

._attributegroup_brand ~ .attributeList ._attributegroup:first-child {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

._attributegroup_brand ~ .attributeList ._attributes > ._attribute:first-child {
  margin-top: 0 !important;
}

._attributegroup_brand ~ .attributeList ._attributes {
  padding-left: 0 !important;
}

/* ブランド詳細リスト初期状態で全て非表示 */
._attributegroup_brand ~ .attributeList [data-popfind^="attributes-brand"] {
  display: none;
}

/* ブランドA-Z ボタンスタイル */
.s-narrow ._attributegroup_brand > ._attributes > ._attribute > label > input + ._label {
  transition: all 0.2s ease;
  background-color: transparent !important;
  border-color: #c3c3c3 !important;
  color: #c3c3c3 !important;
}

/* 既存の._selectスタイルをリセット */
.s-narrow ._attributegroup_brand > ._attributes > ._attribute._select > label > input + ._label {
  background-color: transparent !important;
  border-color: #c3c3c3 !important;
  color: #c3c3c3 !important;
  border-radius: 100% !important;
  width: 40px !important;
  height: 40px !important;
}

/* ホバー時: オレンジ背景、白文字 */
.s-narrow ._attributegroup_brand > ._attributes > ._attribute > label:hover > input + ._label {
  background-color: #FFA733 !important;
  border-color: #FFA733 !important;
  color: #fff !important;
}

/* 選択時（レター開いてる）: 濃いオレンジ背景、白文字 */
.s-narrow ._attributegroup_brand > ._attributes > ._attribute.is-selected > label > input + ._label {
  background-color: #FF9100 !important;
  border-color: #FF9100 !important;
  color: #fff !important;
  border-radius: 100% !important;
}

/* チェック済みブランドあり: アウトライン、オレンジ文字 */
.s-narrow ._attributegroup_brand > ._attributes > ._attribute.has-checked > label > input + ._label {
  background-color: transparent !important;
  border-color: #FF9100 !important;
  color: #FF9100 !important;
}

/* チェック済み + 選択時: 背景優先 */
.s-narrow ._attributegroup_brand > ._attributes > ._attribute.has-checked.is-selected > label > input + ._label {
  background-color: #FF9100 !important;
  border-color: #FF9100 !important;
  color: #fff !important;
}

/* モバイル: ブランドA-Zボタン */
@media (max-width: 767px) {
  /* 非アクティブ: 白線、白文字 */
  .s-narrow ._attributegroup_brand > ._attributes > ._attribute > label > input + ._label {
    border-color: #fff !important;
    color: #fff !important;
  }

  .s-narrow ._attributegroup_brand > ._attributes > ._attribute._select > label > input + ._label {
    display: block !important;
    border-color: #fff !important;
    color: #fff !important;
  }

  /* 選択時: 白べた */
  .s-narrow ._attributegroup_brand > ._attributes > ._attribute.is-selected > label > input + ._label {
    background-color: #fff !important;
    border-color: #fff !important;
    color: #f5a623 !important;
  }

  /* チェック済み: 3px太枠 */
  .s-narrow ._attributegroup_brand > ._attributes > ._attribute.has-checked > label > input + ._label {
    background-color: transparent !important;
    border: 3px solid #fff !important;
    color: #fff !important;
  }

  /* チェック済み+選択時: 3px太枠+白べた */
  .s-narrow ._attributegroup_brand > ._attributes > ._attribute.has-checked.is-selected > label > input + ._label {
    background-color: #fff !important;
    border: 3px solid #fff !important;
    color: #f5a623 !important;
  }
}

/* ===========================================
   価格アコーディオン
   =========================================== */
._priceinput.price-accordion-initialized ._label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

._priceinput.price-accordion-initialized ._label::after {
  content: '' !important;
  display: block !important;
  width: 30px !important;
  height: 30px !important;
  background: url('https://sundaymountain.itembox.design/item/assets/images/icon_arrow_down_gray-s.svg') no-repeat center !important;
  background-size: contain !important;
  transform: rotate(0deg);
  transition: transform 0.3s;
  flex-shrink: 0;
  border: none !important;
}

._priceinput.price-accordion-initialized._open ._label::after {
  transform: rotate(180deg);
}

@media (max-width: 767px) {
  ._priceinput.price-accordion-initialized ._label::after {
    background: url('https://sundaymountain.itembox.design/item/assets/images/icon_arrow_down_white-s.svg') no-repeat center !important;
    height: 20px !important;
    background-size: 24px !important;
  }
}

/* 価格コンテンツラッパー */
._priceinput.price-accordion-initialized .price-content-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s;
}

._priceinput.price-accordion-initialized._open .price-content-wrapper {
  grid-template-rows: 1fr;
}

._priceinput.price-accordion-initialized .price-content-wrapper > * {
  overflow: hidden;
  min-height: 0;
}

/* コンテンツ内部ラッパー */
._priceinput.price-accordion-initialized .price-content-inner {
  overflow: hidden;
}

/* ===========================================
   価格レンジスライダー
   =========================================== */
.price-slider {
  padding: 15px 12px 20px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
}

.price-slider__track {
  position: relative;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
}

.price-slider__range {
  position: absolute;
  height: 100%;
  background: #f5a623;
  border-radius: 3px;
}

.price-slider__handle {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;

  transition: border-color 0.2s, box-shadow 0.2s;
}

.price-slider__handle:hover {
  border-color: #f5a623;
}

.price-slider__handle:active,
.price-slider__handle.is-dragging {
  cursor: grabbing;
  border-color: #f5a623;
  box-shadow: 0 2px 8px rgba(245, 166, 35, 0.4);
}

/* タッチ領域拡大（モバイル対応） */
.price-slider__handle::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
}

/* モバイル: 価格スライダー */
@media (max-width: 767px) {
  .price-slider__range {
    background: #fff;
  }

  .price-slider__track {
    background: #C3C3C3;
  }

  .price-slider__handle {
    box-shadow: 1px 1px 4px 1px #00000026;
  }

}

/* 価格スライダーボタン */
.price-slider-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.price-slider-buttons button {
  width: 75px;
  height: 40px;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 5px;
}

.price-slider-buttons__clear {
  background: #f5f5f5;
  color: #333;
}

.price-slider-buttons__clear:hover {
  background: #eee;
}

.price-slider-buttons__ok {
  background: #f5a623;
  color: #fff;
}

.price-slider-buttons__ok:hover {
  background: #e09000;
}

/* モバイル: 価格スライダーボタン非表示 */
@media (max-width: 767px) {
  .price-slider-buttons {
    display: none;
  }
}

/* ===========================================
   ブランドOK/クリアボタン
   =========================================== */
._attributegroup_brand ~ .brand-buttons {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

._attributegroup_brand._open ~ .brand-buttons {
  max-height: 100px;
  padding-bottom: 15px;
}

.brand-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.brand-buttons button {
  width: 75px;
  height: 40px;
  border: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-bottom: 5px;
}

.brand-buttons__clear {
  background: #f5f5f5;
  color: #333;
}

.brand-buttons__clear:hover {
  background: #eee;
}

.brand-buttons__ok {
  background: #f5a623;
  color: #fff;
}

.brand-buttons__ok:hover {
  background: #e09000;
}

/* モバイル: ブランドボタン非表示 */
@media (max-width: 767px) {
  .brand-buttons {
    display: none;
  }
}

/* ===========================================
   モバイル: フィルターコンテンツ下部余白
   =========================================== */
/* ===========================================
   カテゴリ サブグループ見出し非表示
   （WEAR/GEAR/GOODSの子カテゴリ展開時の見出しを隠す）
   =========================================== */
[data-popfind="attributes-wear"] ._attributegroup ._attributegroup > ._group,
[data-popfind="attributes-gear"] ._attributegroup ._attributegroup > ._group,
[data-popfind="attributes-goods"] ._attributegroup ._attributegroup > ._group {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  line-height: 0 !important;
  border: none !important;
}

/* サブグループの余計な余白を詰める */
[data-popfind="attributes-wear"] ._attributegroup ._attributegroup,
[data-popfind="attributes-gear"] ._attributegroup ._attributegroup,
[data-popfind="attributes-goods"] ._attributegroup ._attributegroup {
  margin: 0 !important;
  padding: 0 !important;
  border-top: none !important;
}

/* サブグループ内の属性リストも余白を詰める */
[data-popfind="attributes-wear"] ._attributegroup ._attributegroup > ._attributes,
[data-popfind="attributes-gear"] ._attributegroup ._attributegroup > ._attributes,
[data-popfind="attributes-goods"] ._attributegroup ._attributegroup > ._attributes {
  margin: 0 !important;
  padding: 0 !important;
}

/* 子要素のチェックボックスをインデント */
[data-popfind="attributes-wear"] ._attributegroup ._attributegroup > ._attributes > ._attribute,
[data-popfind="attributes-gear"] ._attributegroup ._attributegroup > ._attributes > ._attribute,
[data-popfind="attributes-goods"] ._attributegroup ._attributegroup > ._attributes > ._attribute {
  padding-left: 1em !important;
}
._attributegroup{
      padding: 0 1.5em;
}


._attributegroup_brand._open ~ .attributeList{
  margin-top: 0;
}

/* ===========================================
   ソート/件数セレクタ レイアウトシフト防止
   PopFind読み込み前から高さを確保
   =========================================== */
@media (max-width: 767px) {
  .s-sort {
    min-height: 40px;
  }
}

/* フッターボタン（条件をクリア/絞り込む）に隠れないよう余白を確保 */
@media (max-width: 767px) {
  .s-narrow ._filtercontents {
    padding-bottom: 80px;
  }

  .s-page .fs-c-heading--page{
           margin-bottom: 22px !important;
  }

}
