/* ========================================
 * EC-CUBE BtoB受注サイト - 商品一覧スタイル
 * ======================================== */

/* ========================================
 * 商品リスト
 * ======================================== */
.btob-product-list {
  background: var(--btob-bg-white);
  padding-bottom: var(--btob-footer-height);
}

/* ========================================
 * 商品カード
 * ======================================== */
.btob-product {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: var(--btob-space-xs) var(--btob-space-sm);
  padding: var(--btob-space-md) var(--btob-space-lg);
  background: var(--btob-bg-white);
  border-bottom: 1px solid var(--btob-border-light);
  animation: btob-fade-in 0.3s ease;
}

.btob-product:last-child {
  border-bottom: none;
}

/* 商品画像 */
.btob-product__image {
  grid-row: 1 / 3;
  grid-column: 1;
  align-self: start;
  width: 56px;
  height: 56px;
  border-radius: var(--btob-radius-sm);
  overflow: hidden;
  background: var(--btob-bg);
}

.btob-product__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 商品情報 */
.btob-product__body {
  grid-row: 1;
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 商品名 */
.btob-product__name {
  font-size: var(--btob-font-size-md);
  font-weight: var(--btob-font-weight-bold);
  line-height: 1.3;
  color: var(--btob-text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.btob-product__name a {
  color: inherit;
}

.btob-product__name a:hover {
  color: var(--btob-primary);
}

/* 説明文 */
.btob-product__desc {
  font-size: var(--btob-font-size-xs);
  color: var(--btob-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 前回注文情報 */
.btob-product__last-order {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--btob-space-xs);
  background: var(--btob-primary-light);
  border-radius: var(--btob-radius-sm);
  font-size: var(--btob-font-size-xs);
  color: var(--btob-primary);
  width: fit-content;
}

/* 入数バッジ */
.btob-product__quantity-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--btob-space-xs);
  background: var(--btob-bg);
  border-radius: var(--btob-radius-sm);
  font-size: var(--btob-font-size-xs);
  color: var(--btob-text-muted);
  width: fit-content;
}

/* 価格行（入数と価格を1行に） */
.btob-product__info-row {
  display: flex;
  align-items: center;
  gap: var(--btob-space-sm);
  flex-wrap: wrap;
}

/* 価格 */
.btob-product__price {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.btob-product__price-value {
  font-size: var(--btob-font-size-lg);
  font-weight: var(--btob-font-weight-bold);
  color: var(--btob-primary);
}

.btob-product__price-tax {
  font-size: var(--btob-font-size-xs);
  color: var(--btob-text-secondary);
}

.btob-product__price-unit {
  font-size: var(--btob-font-size-xs);
  color: var(--btob-text-secondary);
}

/* 注文コントロール */
.btob-product__controls {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: var(--btob-space-sm);
}

.btob-product__unit {
  width: auto;
}

.btob-product__unit .btob-select {
  height: 36px;
  min-width: 80px;
  font-size: var(--btob-font-size-sm);
}

.btob-product__qty {
  width: auto;
}

.btob-product__qty .btob-qty {
  width: auto;
}

.btob-product__qty .btob-qty__btn {
  width: 36px;
  height: 36px;
}

.btob-product__qty .btob-qty__input {
  width: 40px;
  height: 36px;
  font-size: var(--btob-font-size-sm);
}

.btob-product__add {
  height: 36px;
  padding: 0 var(--btob-space-md);
  font-size: var(--btob-font-size-sm);
}

/* ========================================
 * PC版レイアウト
 * ======================================== */
@media (min-width: 768px) {
  .btob-product {
    grid-template-columns: 48px 1fr auto;
    grid-template-rows: auto;
    padding: var(--btob-space-sm) var(--btob-space-xl);
    gap: var(--btob-space-sm) var(--btob-space-lg);
  }

  .btob-product__image {
    grid-row: 1;
    width: 48px;
    height: 48px;
  }

  .btob-product__body {
    grid-row: 1;
    grid-column: 2;
  }

  .btob-product__controls {
    grid-row: 1;
    grid-column: 3;
    gap: var(--btob-space-md);
  }

  .btob-product__name {
    font-size: var(--btob-font-size-md);
  }

  .btob-product__unit .btob-select {
    min-width: 90px;
  }

  .btob-product__add {
    min-width: 80px;
  }
}

/* ========================================
 * 画像なしモード
 * ======================================== */
.btob-product--no-image {
  grid-template-columns: 1fr;
}

.btob-product--no-image .btob-product__body {
  grid-column: 1;
}

.btob-product--no-image .btob-product__controls {
  grid-column: 1;
  justify-content: flex-end;
}

@media (min-width: 768px) {
  .btob-product--no-image {
    grid-template-columns: 1fr auto;
  }

  .btob-product--no-image .btob-product__body {
    grid-row: 1;
    grid-column: 1;
  }

  .btob-product--no-image .btob-product__controls {
    grid-row: 1;
    grid-column: 2;
  }
}

/* ========================================
 * 検索結果なし
 * ======================================== */
.btob-no-result {
  padding: var(--btob-space-2xl);
  text-align: center;
  color: var(--btob-text-muted);
  font-size: var(--btob-font-size-md);
}

/* ========================================
 * ローディング
 * ======================================== */
.btob-product-list.is-loading {
  position: relative;
  min-height: 200px;
}

.btob-product-list.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--btob-border);
  border-top-color: var(--btob-primary);
  border-radius: 50%;
  animation: btob-spin 0.8s linear infinite;
}
