/* Product-list renewal card grid 0.14.10
   가로형 OFF(db-compact-view) => renewal reference card layout.
   가로형 ON(db-horizontal-view) => existing one-product-per-row layout. */

.db-card-option-toggle,
.db-card-swatches,
.db-card-option-panel {
  display: none;
}

.product-list.db-compact-view {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 20px;
  row-gap: 64px;
  align-items: start;
  border-top: 0;
}

.product-list.db-compact-view .db-product-row {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0 0 8px;
  border: 0;
  background: #fff;
}

.product-list.db-compact-view .db-product-row[hidden] {
  display: none !important;
}

.product-list.db-compact-view .db-product-row .row-image {
  order: 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border: 0;
  background: #f7f7f7;
}
.product-list.db-compact-view .db-product-row .row-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
  transition: transform .2s ease;
}
.product-list.db-compact-view .db-product-row .row-image:hover img {
  transform: scale(1.025);
}

.product-list.db-compact-view .db-product-row .row-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  width: 24px;
  height: 24px;
  margin: 0;
}

.product-list.db-compact-view .db-product-row .row-info {
  order: 2;
  min-width: 0;
  min-height: 148px;
  padding: 16px 8px 0;
}
.product-list.db-compact-view .db-card-swatches {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 16px;
  margin: 0 0 12px;
}
.product-list.db-compact-view .db-card-swatch {
  display: block;
  width: 12px;
  height: 12px;
  border: 1px solid rgb(0 0 0 / 8%);
  border-radius: 50%;
  background: #222;
}
.product-list.db-compact-view .db-product-row .row-brand {
  margin: 0 0 10px;
  color: #171717;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}
.product-list.db-compact-view .db-product-row .row-name {
  min-height: 44px;
  margin: 0 0 6px;
  color: #222;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}
.product-list.db-compact-view .db-product-row .row-name a {
  display: block;
}
.product-list.db-compact-view .db-product-row .row-code {
  overflow: hidden;
  min-height: 20px;
  color: #8a8a8a;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 카드 모드에서는 가격만 외부에 두고, 선택합계/옵션/액션은 전용 panel로 이동한다. */
.product-list.db-compact-view .db-product-row .row-price-tools {
  order: 3;
  display: block;
  width: 100%;
  padding: 0 8px 14px;
}
.product-list.db-compact-view .db-product-row .row-price {
  display: block;
  color: var(--purple);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
}
.product-list.db-compact-view .db-product-row .row-price-tools > .row-selection-total,
.product-list.db-compact-view .db-product-row .row-price-tools > .other-model {
  display: none;
}

.product-list.db-compact-view .db-card-option-toggle {
  order: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 16px);
  min-height: 42px;
  margin: 0 8px;
  padding: 0 15px;
  border: 1px solid #dedede;
  border-radius: 8px;
  color: #242424;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
}
.product-list.db-compact-view .db-card-option-toggle:hover,
.product-list.db-compact-view .db-card-option-toggle:focus-visible {
  border-color: var(--purple);
  outline: 0;
}
.product-list.db-compact-view .db-card-option-toggle .db-card-option-symbol {
  color: #222;
  font-size: 17px;
  font-weight: 400;
}
.product-list.db-compact-view .db-product-row.db-card-options-open .db-card-option-toggle {
  min-height: 46px;
  border: 2px solid var(--purple);
  border-bottom: 1px solid #ece7f8;
  border-radius: 10px 10px 0 0;
  font-size: 15px;
  font-weight: 600;
}

/* 하나의 연속된 옵션 패널 */
.product-list.db-compact-view .db-card-option-panel {
  order: 5;
  display: block;
  width: calc(100% - 16px);
  margin: -1px 8px 0;
  border: 2px solid var(--purple);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: #fff;
  overflow: hidden;
}
.product-list.db-compact-view .db-card-option-panel[hidden] {
  display: none !important;
}

.product-list.db-compact-view .db-card-option-panel > .row-options {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 12px 14px 10px;
  border: 0;
  border-bottom: 1px solid #ececec;
  background: #fff;
}
.product-list.db-compact-view .db-card-option-panel .option-list li {
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
  min-height: 42px;
  font-size: 13px;
}
.product-list.db-compact-view .db-card-option-panel .option-label {
  gap: 7px;
  min-width: 0;
}
.product-list.db-compact-view .db-card-option-panel .option-label > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-list.db-compact-view .db-card-option-panel .option-check {
  width: 22px;
  height: 22px;
  font-size: 13px;
}
.product-list.db-compact-view .db-card-option-panel .option-quantity {
  width: 76px;
  height: 30px;
}
.product-list.db-compact-view .db-card-option-panel .option-quantity button {
  width: 24px;
  height: 28px;
  font-size: 13px;
}
.product-list.db-compact-view .db-card-option-panel .option-quantity output {
  min-width: 26px;
  font-size: 12px;
}
.product-list.db-compact-view .db-card-option-panel .option-amount {
  display: none;
}

.product-list.db-compact-view .db-card-option-panel > .row-selection-total {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  min-height: 54px;
  margin: 0;
  padding: 14px 14px 10px;
  border: 0;
  border-bottom: 1px solid #ececec;
  color: #222;
  background: #fff;
  font-size: 13px;
}
.product-list.db-compact-view .db-card-option-panel > .row-selection-total span {
  display: none;
}
.product-list.db-compact-view .db-card-option-panel > .row-selection-total::before {
  content: "총 구매금액";
  font-weight: 600;
}
.product-list.db-compact-view .db-card-option-panel > .row-selection-total strong {
  color: var(--purple);
  font-size: 17px;
  font-weight: 600;
}

.product-list.db-compact-view .db-card-option-panel > .row-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 10px 12px 12px;
  border: 0;
  background: #fff;
}
.product-list.db-compact-view .db-card-option-panel > .row-actions button {
  width: 100%;
  min-width: 0;
  height: 42px;
  border-radius: 0;
  white-space: nowrap;
}
.product-list.db-compact-view .db-card-option-panel > .row-actions button:first-child {
  border-radius: 6px 0 0 6px;
}
.product-list.db-compact-view .db-card-option-panel > .row-actions button:nth-child(2) {
  border-radius: 0 6px 6px 0;
}
.product-list.db-compact-view .db-card-option-panel > .row-actions a {
  display: none;
}

/* 카드형에서는 다른기종보기는 노출하지 않는다. */
.product-list.db-compact-view .db-product-row .other-model {
  display: none !important;
}

/* 가로형은 기존 행 구조만 사용 */
.product-list.db-horizontal-view .db-card-option-toggle,
.product-list.db-horizontal-view .db-card-swatches,
.product-list.db-horizontal-view .db-card-option-panel {
  display: none !important;
}
.product-list.db-horizontal-view .db-product-row.db-card-options-open {
  outline: 0;
}

@media (max-width: 1399px) {
  .product-list.db-compact-view {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 52px;
  }
}

@media (max-width: 1179px) {
  .product-list.db-compact-view {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 42px;
  }
}

@media (max-width: 759px) {
  .product-list.db-compact-view {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 34px;
  }
  .product-list.db-compact-view .db-product-row .row-info {
    min-height: 132px;
  }
}
