/* ブランドコレクションページ CSS（collection.brand.liquid のインライン style を移植） */

  /* 横長キャンペーンバナー。画像への直接 CSS がテーマに上書きされるのを防ぐため、
     外側の DIV ごと表示/非表示を切り替える（本番と同じ）。 */
  #custom-nicobay-banner-container-col { width: 100%; margin-bottom: 20px; }
  #custom-nicobay-banner-container-col a { display: block; width: 100%; text-decoration: none; }

  #custom-banner-wrap-pc-col { display: block !important; }
  #custom-banner-wrap-sp-col { display: none !important; }

  /* 768px 以下を SP として切り替え */
  @media screen and (max-width: 768px) {
    #custom-banner-wrap-pc-col { display: none !important; }
    #custom-banner-wrap-sp-col { display: block !important; }
  }

  /* Ensure page-width doesn't cause overflow on mobile */
  @media screen and (max-width: 768px) {
    .page-width {
      padding-left: 10px;
      padding-right: 10px;
      max-width: 100%;
      overflow-x: hidden;
    }
  }

  .vendor-brand-header {
    padding: 40px 0;
  }

  .nicobay-brand-header {
    background: transparent !important;
    border-bottom: none !important;
  }

  .nicobay-brand-header__container {
    background: white;
    padding: 10px;
    border-radius: 16px;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 40px;
    min-height: auto;
  }

  @media screen and (max-width: 749px) {
    .vendor-brand-header {
      padding: 0;
    }

    .nicobay-brand-header__container {
      flex-direction: column;
      border-radius: 0;
      margin: 0 -10px;
      gap: 16px;
    }
  }

  /* .nicobay-brand-header__logo-image {
    width: 100%;
    max-width: 267px;
    height: auto;
    max-height: 267px;
    display: block;
    object-fit: contain;
  } */

  .nicobay-brand-header__logo > img {
    width: 100%;
    height: auto;
    border-radius: 10px;
  }

  .nicobay-brand-header__content {
    flex: 1;
  }

  .nicobay-brand-header__title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 15px;
    margin-bottom: 12px;
  }

  .nicobay-brand-header__title {
    color: #4d4d4d;
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.2;
    flex: 1;
  }

  @media screen and (max-width: 749px) {
    .nicobay-brand-header__title {
      font-size: 18px;
    }
  }

  /* Description collapse functionality */
  .nicobay-brand-header__description-wrapper,
  .vendor-brand-featured__description-wrapper {
    position: relative;
  }

  .nicobay-brand-header__description,
  .vendor-brand-featured__description {
    color: #4d4d4d;
    font-size: 1.5rem;
    line-height: 1.6;
    flex: 1;
    font-weight: 400;
    white-space: pre-line;
  }

  /* Desktop: Always show description, hide toggle button */
  @media screen and (min-width: 750px) {
    .nicobay-brand-header__description,
    .vendor-brand-featured__description {
      max-height: none !important;
      overflow: visible !important;
      margin-bottom: 16px;
    }

    .description-toggle-btn {
      display: none !important;
    }
  }

  /* Mobile: Collapsed by default with toggle */
  @media screen and (max-width: 749px) {
    .nicobay-brand-header__description,
    .vendor-brand-featured__description {
      overflow: hidden;
      max-height: 0;
      transition: max-height 0.3s ease-out;
      margin: 0 15px;
    }

    .nicobay-brand-header__description.expanded,
    .vendor-brand-featured__description.expanded {
      max-height: 500px;
      margin-bottom: 16px;
    }

    .description-toggle-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: none;
      border: none;
      cursor: pointer;
      padding: 0;
      width: 24px;
      height: 24px;
      flex-shrink: 0;
    }

    .description-toggle-btn svg {
      width: 24px;
      height: 24px;
      transition: transform 0.3s ease;
    }

    .description-toggle-btn[aria-expanded='true'] svg {
      transform: rotate(90deg);
    }

    .description-toggle-btn:hover {
      opacity: 0.8;
    }
  }

  /* Vendor brand collections container */
  .vendor-brand-collections {
    width: 100%;
    overflow-x: hidden;
  }

  /* Collection products grid styles */
  .collection-products {
    padding: 20px 0;
  }

  .collection-products__grid {
    width: 100%;
    box-sizing: border-box;
  }

  @media screen and (max-width: 768px) {
    .collection-products {
      padding: 18px 10px;
    }

    .collection-products__grid {
      padding: 0;
      margin: 0;
    }
  }

  .collection-products__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
  }

  .collection-products__title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
  }

  .collection-products__view-all {
    color: #22c55e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s ease;
  }

  .collection-products__view-all:hover {
    opacity: 0.8;
  }

  .vendor-brand-featured {
    padding: 40px 0;
  }

  @media screen and (max-width: 768px) {
    .vendor-brand-featured {
      padding: 20px 10px;
      padding-bottom: 10px;
    }
  }

  .vendor-brand-featured__container {
    background: white;
    padding: 10px 10px;
    border-radius: 16px;
    box-shadow: none;
    display: flex;
    gap: 40px;
    align-items: center;
    color: inherit;
    min-height: auto;
  }

  @media screen and (max-width: 749px) {
    .vendor-brand-featured__container {
      flex-direction: column;
      gap: 8px;
    }
  }

  .vendor-brand-featured__image {
    flex: 0 0 auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    padding: 0;
    overflow: hidden;
  }

  .vendor-brand-featured__image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
  }

  @media screen and (min-width: 750px) {
    .vendor-brand-featured__image {
      max-width: 25%;
    }
  }

  @media screen and (max-width: 749px) {
    .vendor-brand-featured__image {
      flex: 0 0 auto;
      /* width: 150px; */
      /* height: 150px; */
      padding: 1.5rem;
      width: 100%;
    }
  }

  .vendor-brand-featured__content {
    flex: 1;
  }

  @media screen and (min-width: 750px) {
    .vendor-brand-featured__content {
      max-width: 50%;
      padding-left: 5rem;
    }
  }

  .vendor-brand-featured__title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 0 15px;
  }

  .vendor-brand-featured__content h3 {
    font-size: 2.4rem;
    font-weight: 700;
    color: #4d4d4d;
    margin: 0;
    flex: 1;
  }

  /* Flavor chart container styles */
  .flavor-chart-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 0 20px;
  }

  .flavor-chart-container canvas {
    width: 100%;
  }

  /* Collection products list styles */
  .collection__products-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }

  @media screen and (max-width: 1200px) {
    .collection__products-list {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  @media screen and (max-width: 768px) {
    .collection__products-list {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
  }

  .collection__products-item {
    list-style: none;
    width: 100%;
    overflow: hidden;
    position: relative;
  }

  /* Ensure product cards don't overflow on mobile */
  @media screen and (max-width: 768px) {
    .featured-collection-product-item {
      width: 100%;
    }

    .nicobay-product-brand__card {
      width: 100%;
      box-sizing: border-box;
      overflow: hidden;
    }

    .nicobay-product-brand__image-wrapper {
      width: 100%;
      box-sizing: border-box;
      padding-bottom: 0 !important;
    }

    .nicobay-product-brand__info {
      padding: 10px !important;
      padding-top: 0 !important;
      box-sizing: border-box;
    }

    .nicobay-product-brand__product-title {
      font-size: 1.2rem !important;
      white-space: normal;
      word-wrap: break-word;
      overflow-wrap: break-word;
    }

    .nicobay-product-brand__vendor {
      max-width: 100%;
      font-size: 1.1rem !important;
      line-height: 1.1rem;
      height: 1.1rem;
    }

    .flavor-chart-container {
      width: 100%;
      padding: 0 5px;
      margin-top: -10px;
    }

    .flavor-chart-container canvas {
      width: 100% !important;
      height: auto !important;
    }

    .nicobay-product-brand__product-meta {
      flex-wrap: wrap;
      gap: 5px;
    }

    .featured-collection-card__cart-button-wrapper {
      padding: 0 8px 8px;
    }

    .nicobay-product-brand__product-title {
      margin: 5px 0 !important;
    }

    .featured-collection-cart-btn {
      height: 3.4rem;
    }
  }

  .nicobay-product-brand__image-wrapper {
    padding: 6px;
  }

  .nicobay-product-brand__image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
  }

  .nicobay-product-brand__card-link {
    text-decoration: none;
    color: inherit;
  }

  .puffs-badge-inline,
  .nicobay-product-brand__puffs-inline,
  .nicobay-product-brand__puffs-badge {
    display: inline-block;
    font-size: 10px;
    color: white;
    background-color: #3abb1e;
    padding: 3px 6px;
    border-radius: 12px;
    font-weight: 600;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 10px;
  }

  .nicobay-product-brand__info {
    padding: 15px 20px;
  }

  .nicobay-product-brand__product-title {
    font-size: 1.5rem;
    height: 3.2rem;
    line-height: 1.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #505050;
    margin: 0;
    margin-top: 15px;
  }

  @media screen and (max-width: 768px) {
    .nicobay-product-brand__product-title {
      height: 4.5rem;
    }
  }

  .nicobay-product-brand__card .icon-cart {
    stroke: none;
    width: 15px;
    height: 15px;
  }

  .nicobay-product-brand__product-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    overflow: hidden;
  }

  .nicobay-product-brand__vendor {
    color: #505050;
    font-size: 1.5rem;
    line-height: 1.5rem;
  }

  .vendor-brand-featured__title {
    font-size: 2.8rem;
    font-weight: 700;
    color: #505050;
    margin-bottom: 10px;
  }

  @media screen and (max-width: 749px) {
    .vendor-brand-featured__title {
      font-size: 2.2rem;
    }

    .vendor-brand-featured__title-row h3 {
      font-size: 1.8rem;
    }
  }

  @media screen and (max-width: 480px) {
    .nicobay-product-brand__price {
      font-size: 1.4rem;
    }
  }

  .price-item--sale {
    color: #ff4757;
  }
