/* shop style */
.fwpl-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 24px !important;

  &:has(.result-notfound) {
    grid-template-columns: 1fr !important;
  }

  .fwpl-result {
    box-sizing: border-box;
    margin-bottom: 32px;
    @media (max-width: 689px) {
      margin-bottom: 16px;
    }

    .shop_thumbnail {
      img {
        aspect-ratio: 1 / 1;
        width: 100%;
        height: auto;
        object-fit: cover;
      }
    }

    .fwpl-btn {
      display: block;
      width: 100%;
      text-align: center;
      padding: 6px 8px;
      background-color: #68bedf;
      color: #fff;
      font-weight: 600;
      text-decoration: none;
      transition: background-color 0.3s ease;
      margin-bottom: 8px;

      &:hover {
        background-color: #20a2dc;
      }
    }

    .shop_title,
    .brand_title {
      font-size: 18px;
      font-weight: 600;

      @media (max-width: 689px) {
        padding: 0 20px;
      }
    }

    .brand_title {
      @media (max-width: 689px) {
        padding: 0;
      }
    }

    .brand_original_name {
      font-size: 14px;
      color: #afafaf;
      @media (max-width: 689px) {
        font-size: 12px;
      }
    }

    .feed_name,
    .feed_headline {
      font-size: 15px;
      font-weight: 600;

      @media (max-width: 689px) {
        padding: 0 20px;
        font-size: 16px;
      }
    }

    .dynamic-datetime-display {
      @media (max-width: 689px) {
        padding: 0 20px;
      }
    }

    .feed_description {
      font-size: 14px;
      line-height: 1.3;

      @media (max-width: 689px) {
        padding: 0 20px;
      }
    }

    .market_category_wrapper {
      @media (max-width: 689px) {
        padding: 0;
      }
      span {
        border: 1px solid #d9d9d9;
      }
    }
    .feed_category {
      margin-bottom: 4px;
      margin-top: -3px;
      @media (max-width: 689px) {
        padding: 0 20px;
      }
      span {
        display: inline-block;
        padding: 2px 8px;
        background-color: #ff4d4f;
        color: #fff;
        border-radius: 4px;
        font-size: 12px;
        margin-right: 4px;
      }
    }

    .shop_desc,
    .brand_desc {
      font-size: 14px;
      line-height: 1.3;
      @media (max-width: 689px) {
        padding: 0 20px;
      }
    }

    .brand_desc {
      margin-bottom: 8px;
      display: -webkit-box;
      -webkit-line-clamp: 4;
      -webkit-box-orient: vertical;
      overflow: hidden;
      @media (max-width: 689px) {
        padding: 0;
      }
    }
  }

  .datetime-range {
    font-size: 14px;
    font-weight: 600;
  }

  .data-publish-start {
    font-size: 12px;
    color: #666;
  }
}
.brand-search-area-sp {
  display: none !important;
}
.brand-directory-wrapper {
  .fwpl-layout {
    gap: 16px !important;
  }

  .fwpl-result {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #d9d9d9;
    margin-bottom: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

    .fwpl-row {
      height: 100%;
    }
    .fwpl-col {
      height: 100%;
      display: flex;
      flex-direction: column;
    }

    .brand-card-button {
      max-width: 160px;
      margin: auto auto 0;
      width: 100%;
      a, button {
        border-radius: 8px;
        cursor: pointer;
        font-weight: inherit;
      }
    }
  }
}

.shop_category,
.market_category_wrapper {
  margin-bottom: 8px;
  @media (max-width: 689px) {
    padding: 0 20px;
  }
  span {
    display: inline-block;
    padding: 2px 8px;
    background-color: #d9d9d9;
    border-radius: 16px;
    border: 1px solid #d9d9d9;
    font-size: 12px;
    margin-right: 4px;
    color: #3a4f66;

    a {
      color: #3a4f66;
    }
  }
}

/* .facetwp-selections内に子要素がない場合、.elementor-dividerを非表示 */
/* .brand-search-container:has(.facetwp-selections:empty) .elementor-divider {
  display: none;
} */
/* .facetwp-selections内に子要素がない場合、.elementor-dividerを非表示 */
/* .brand-search-container:has(.facetwp-selections:empty)
  .brand-search-selections {
  display: none;
} */
/* .facetwp-selections内に子要素がない場合、.elementor-dividerを非表示 */
/* .brand-search-container:has(.facetwp-selections:empty) .clear-filters-text {
  display: none;
} */
.bland_official_shop_container:has(.e-loop-nothing-found-message) {
  display: none;
}
.bland_related_shop_container:has(.e-loop-nothing-found-message) {
  display: none;
}

.brand-search-container {
  .pc-only {
    @media (max-width: 999px) {
      display: none !important;
    }
  }
  .tab-only {
    display: none;
    @media (max-width: 999px) {
      display: block !important;
    }
  }
  .sp-only {
    display: none;
    @media (max-width: 689px) {
      display: block !important;
    }
  }
  .facetwp-facet-brand_sort,
  .facetwp-facet-brand,
  .facetwp-facet-brand_categories,
  .facetwp-facet-parent_evoked_category {
    margin-bottom: 0;
  }
  .fs-wrap {
    width: 100%;
  }

  .facetwp-facet-brand_sort select,
  .facetwp-type-hierarchy_select select {
    background-color: white;
    border: 1px solid #dddddd;
    border-radius: 0;
    padding: 6px 22px 6px 8px;
    height: 34px;
    font-size: 14px;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
  }

  .facetwp-type-hierarchy_select select:first-child {
    margin-bottom: 8px;
  }

  .facetwp-type-hierarchy_select {
    .facetwp-hierarchy_select.is-disabled {
      display: none;
    }
  }

  .facetwp-facet-brand_search {
    margin-bottom: 0;
    input {
      min-width: auto !important;
      background: #e6e6e6;
      height: 34px;
      border-radius: 8px;
      @media (min-width: 690px) and (max-width: 999px) {
        height: 48px;
      }
    }
    .facetwp-input-wrap {
      @media (max-width: 999px) {
        width: 100%;
      }
    }
    .facetwp-icon {
      display: none;
    }
  }

  .facetwp-selections {
    ul {
      padding-left: 0;
      li[data-facet="brand_search"] {
        position: relative;
      }
      li[data-facet="brand_search"]:before {
        content: '🔍"';
      }
      li[data-facet="brand_search"] .facetwp-selection-value:after {
        content: '"';
      }
      li[data-facet="brand_search"] .facetwp-selection-value {
        margin-left: -2px;
      }
      li {
        background: #d9d9d9;
        padding: 8px 0px 8px 8px;
        border-radius: 4px;
        margin-bottom: 4px;
        margin-right: 4px;
        .facetwp-selection-label {
          display: none;
        }
      }

      li[data-facet="brand_contexts"],
      li[data-facet="brand_categories"] {
        background: transparent;
        padding: 0;

        .facetwp-selection-value {
          background-color: #d9d9d9;
          border-radius: 4px;
          margin-right: 4px;
          padding-top: 8px;
          padding-bottom: 8px;
          padding-left: 8px;
          padding-right: 24px;
          background-position: right 8px center;
          margin-bottom: 4px;

          &::before {
            content: "#";
          }
        }

        .facetwp-selection-value:hover {
          color: #2d9cdb;
        }
      }

      li[data-facet="brand_categories"] {
        .facetwp-selection-value::before {
          content: "";
        }
      }

      li:hover {
        color: #2d9cdb;
      }

      li[data-facet="brand_contexts"]:hover,
      li[data-facet="brand_categories"]:hover {
        color: inherit;
      }

      @media screen and (max-width: 689px) {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: scroll;
        li {
          margin-right: 8px;
          display: flex;
          white-space: nowrap;
        }
      }
    }
  }

  .facet-wrap {
    @media (max-width: 999px) {
      display: block !important;
    }
    h6 {
      @media (max-width: 999px) {
        display: none;
      }
    }
  }
}
@media (max-width: 999px) {
  .brand-search-area-sp {
    display: flex !important;
  }

  /* タブレット/モバイルでは既存の .facetwp-selections を非表示
     → .brand-active-chips（active-filter-chips.js）で代替表示する */
  .brand-search-container .facetwp-selections {
    display: none !important;
  }
}

@media (max-width: 689px) {
  .fwpl-layout {
    grid-template-columns: 1fr !important;
  }
  .data-publish-start {
    padding: 0 20px;
  }

  .brand-directory-wrapper .fwpl-layout {
    grid-template-columns: repeat(2, 1fr) !important;
    column-gap: 16px !important;
    row-gap: 16px !important;

    &:has(.result-notfound) {
      grid-template-columns: 1fr !important;
    }
  }

  .elementor-widget-container .e-n-accordion-item {
    .e-child {
      max-height: 60vh;
      overflow-y: scroll;
    }
  }
}

@media (min-width: 767px) {
  .popular-shops {
    .facet-main-section {
      margin-left: auto !important;
      transition: none !important;
    }

    .facet-main-section-fixed {
      position: relative;
      transform: translateX(6px) !important;
    }
  }
}

.related_shop_card {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d9d9d9;
  margin-bottom: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 8px;

  @media (max-width: 689px) {
    .shop_category {
      padding-left: 0;
      padding-right: 0;
    }
  }
}

.bland_official_shop_container {
  .related_shop_card {
    background: #20a2dc1a;
    border: 2px solid #20a2dc;
  }
}

.brand-directory-wrapper {
  .facetwp-pager {
    .facetwp-page {
      width: 40px;
      height: 40px;
      border: 1px solid #20a2dc;
      border-radius: 50%;
      text-align: center;
      line-height: 40px;
      color: #20a2dc;

      @media (max-width: 689px) {
        display: none;
      }
    }
    .facetwp-page.active {
      background-color: #20a2dc80;
      color: white;
    }
  }
  .facetwp-facet-brand_load_more {
    display: none;

    @media (max-width: 689px) {
      display: block;
    }
  }
}

.facetwp-load-more {
  width: 100%;
  background-color: #20a2dc80;
  color: white;
  text-align: center;
  padding: 6px;
  max-width: 214px;
  margin: 0 auto;
  display: block;
  border-radius: 8px;
}

.facetwp-facet-parent_evoked_category .fs-wrap,
.facetwp-facet-evoked_categories .fs-wrap {
  border-radius: 8px;

  .fs-dropdown {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
  }

  .fs-label-wrap {
    border-radius: 8px;
    cursor: pointer;
  }
}

.fs-open {
  .fs-label-wrap {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
}

/* ===================================================
   Brand Directory — No Results Empty State
   =================================================== */

/* Safety rule: honour the hidden attribute even if CSS resets override it */
.brand-no-results[hidden] {
  display: none;
}

.brand-no-results {
  padding: 56px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.brand-no-results__primary {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-emphasis);
  margin: 0;
}

.brand-no-results__secondary {
  font-size: 15px;
  color: var(--color-text-muted);
  margin: 0;
}

.brand-no-results__hint {
  font-size: 14px;
  color: var(--color-text-subtle);
  margin: 0 0 16px;
}

.brand-no-results__clear {
  background: var(--color-accent-soft);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.brand-no-results__clear:hover {
  background: var(--color-accent);
}
