/* ==========================================================================
   PAGE: MALL LIST (상품 리스트 페이지)
   ========================================================================== */

/* --- 1. 서브 배너 영역 --- */
.main_banner_B {
    width: 100%;
    max-width: var(--w-container); /* 헤더와 동일한 최대 너비 */
    margin: 20px auto 40px; /* 상하 여백 */
    border-radius: 12px;
    overflow: hidden; /* 모서리 둥글게 */
  }
  .main_banner_B img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
  }
  
  /* --- 2. 페이지 타이틀 영역 --- */
  .main_title {
    max-width: var(--w-container);
    margin: 0 auto 30px;
    padding: 0 20px;
    text-align: center; /* 중앙 정렬 (요즘 트렌드) */
  }
  .main_title_txt01 {
    font-size: 28px;
    font-weight: 700;
    color: var(--c-black);
    margin-bottom: 8px;
  }
  .main_title_txt02 {
    font-size: 15px;
    color: var(--c-gray);
    font-weight: 400;
  }
  
  /* --- 3. 상품 리스트 그리드 (Grid Layout) --- */
  .main_product_list .ttery_product {
    max-width: var(--w-container);
    margin: 0 auto;
    padding: 10px 20px;
  }
  /* PC: 좌우 패딩 제거 → 상단 배너(main_banner_B, 패딩 없음)와 끝선 일치
     (.discount-filter 기본 규칙이 파일 하단에 있어 특이도를 올려 오버라이드) */
  @media (min-width: 769px) {
    .main_product_list .ttery_product { padding: 10px 0; }
    .main_title { padding: 0; }
    .main_product_list .discount-filter { padding: 0; }
  }
  
  .prdList.grid4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4열 고정 */
    gap: 40px 20px; /* 세로간격 40px, 가로간격 20px */
  }
  
  /* --- 4. 상품 카드 디자인 (Item) — 모바일(ttm-card) 톤: 그레이 카드 + 라운드 + 호버 리프트 --- */
  .prdList__item {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #f5f6f8;
    border: 1px solid #e7e9ed; /* 가로/세로 구분선과 동일 톤의 카드 테두리 */
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .prdList__item:hover {
    transform: translateY(-4px); /* 호버 시 살짝 위로 */
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
  }

  /* 4-1. 썸네일 (카드 상단에 풀블리드 — 라운딩은 카드가 담당) */
  .prdList__item .thumbnail {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background-color: #fff; /* 카드가 그레이가 되면서 이미지 영역은 흰색으로 대비 */
    aspect-ratio: 1 / 1; /* 정사각형 비율 유지 */
    margin-bottom: 0;
    border-bottom: 1px solid #e7e9ed; /* 이미지 ↔ 정보영역 가로 구분선 */
  }
  .prdList__item .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }
  /* 썸네일 호버 시 이미지 확대 효과 */
  .prdList__item:hover .thumbnail img {
    transform: scale(1.05);
  }
  
  /* 4-2. 뱃지 (Badges) — 모바일(ttm-badge) 톤과 통일한 컬러 pill */
  .badge-wrap {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 2;
    pointer-events: none;
    max-width: calc(100% - 20px);
  }
  .nanum_box, .badge {
    font-size: 12.5px;
    padding: 5px 10px;
    border-radius: 9px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
    white-space: nowrap;
  }
  /* 할인율 뱃지 — 모바일(ttm-badge)과 동일 톤 (빨강 + 컬러 글로우) */
  .nanum_box--dc {
    background: var(--c-point);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 5px 12px rgba(204, 77, 80, 0.35);
  }
  /* 품절 뱃지 스타일 */
  .badge--hit, .badge--partial {
    background: rgba(0,0,0,0.7);
    color: #fff;
  }

  /* 품절 오버레이 (썸네일 전체 프로스트 + 흰 테두리 칩) */
  .prdList__item .thumbnail .soldout-cover {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 28, 32, 0.28);
    -webkit-backdrop-filter: grayscale(35%);
    backdrop-filter: grayscale(35%);
    border-radius: inherit;
  }
  .prdList__item .thumbnail .soldout-cover.is-partial {
    background: rgba(26, 28, 32, 0.22);
  }
  .prdList__item .thumbnail .soldout-cover span {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #fff;
    border: 1.5px solid #fff;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(20, 22, 26, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  /* 재고 표시 뱃지 (썸네일 좌측 하단) */
  .prdList__item .thumbnail .stock-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 3;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    pointer-events: none;
    letter-spacing: 0.2px;
  }

  /* 4-3. 상품 정보 (Description) — 카드형 전환으로 내부 패딩 추가 */
  .description {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px 16px;
  }
  
  /* 업체명 (Vendor) */
  .vendor-header {
    font-size: 13px;
    color: #999;
    margin-bottom: 2px !important;
  }
  
  /* 상품명 */
  .description .name a span {
    font-size: 15px !important;
    color: var(--c-black) !important;
    font-weight: 400;
    line-height: 1.4;
    
    /* 2줄 말줄임 처리 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 42px; /* 2줄 높이 확보 */
  }
  
  /* 가격 정보 (.spec) */
  .spec {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .spec li { display: flex; align-items: center; flex-wrap: wrap; }
  
  /* 소비자가 (취소선) */
  .spec li span[style*="text-decoration:line-through"] {
    font-size: 17px !important;
    color: #bbb !important;
  }
  
  /* 판매가 & 할인율 */
  .spec li span[style*="font-weight:600"] { /* 할인율 */
    font-size: 18px !important;
    color: var(--c-point) !important; /* 브랜드 포인트 컬러 */
    font-weight: 700 !important;
    margin-right: 6px !important;
  }
  .spec li span[style*="color:#1a1a1a"] { /* 판매가 */
    font-size: 18px !important;
    color: var(--c-black) !important;
    font-weight: 700 !important;
  }
  
  /* 쿠폰가 */
  .spec li strong.title { display: none; } /* '쿠폰적용가' 텍스트 숨김 (깔끔하게) */
  .spec li span[style*="color:#cc4d50"] { /* 쿠폰 가격 */
    font-size: 14px !important;
    color: var(--c-primary) !important;
    font-weight: 600 !important;
    margin-top: 2px;
  }
  
  
  /* --- 6. 모바일 반응형 (Mobile) --- */
  @media (max-width: 768px) {
    /* 4열 -> 2열 변경 */
    .prdList.grid4 {
      grid-template-columns: repeat(2, 1fr);
      gap: 20px 12px; /* 간격 좁힘 */
    }
  
    .main_title_txt01 { font-size: 20px; }
    .main_title_txt02 { font-size: 13px; }
    
    .prdList__item .thumbnail { border-radius: 6px; }
    
    .description .name a span {
      font-size: 14px !important;
      min-height: 40px;
    }
    
    .spec li span[style*="font-weight:600"], /* 할인율 */
    .spec li span[style*="color:#1a1a1a"] { /* 판매가 */
      font-size: 16px !important;
    }
  }

/* 티티멤버스 공구 전용 할인율 필터 */
.discount-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: var(--w-container);   /* .main_title 와 동일 정렬 */
  margin: 4px auto 22px;
  padding: 0 20px;
  box-sizing: border-box;
}
.discount-filter .df-label {
  font-size: 14px;
  font-weight: 700;
  color: #555;
  margin-right: 2px;
}
.discount-filter .df-btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  background: #fff;
  color: #555;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
  transition: all .15s ease;
}
.discount-filter .df-btn:hover {
  border-color: #cc4d50;
  color: #cc4d50;
}
.discount-filter .df-btn.active {
  background: linear-gradient(135deg, #d2686a 0%, #cc4d50 100%);
  border-color: #cc4d50;
  color: #fff;
  box-shadow: 0 2px 8px rgba(204, 77, 80, .35);
}
@media (max-width: 768px) {
  .discount-filter .df-btn { padding: 7px 13px; font-size: 13px; }
  .discount-filter .df-label { width: 100%; margin-bottom: 2px; }
}
/* ============================================================================
   [TTBOX] 상품 카드 재구성 (2026-08-07)
   ----------------------------------------------------------------------------
   떠리마켓 카드: 회색 카드껍데기 + 테두리 + 1:1 정사각 이미지 + 구분선,
                  정보는 [공급사 → 상품명 → 리뷰 → 정가 → 할인율+판매가] 세로 나열.
   티티박스 카드: 껍데기를 없애고 이미지만 라운드, 비율 4:5 세로형,
                  정보는 [할인율+판매가 → 상품명 → 공급사 → 리뷰] 로 가격 우선.
   ★ 마크업은 한 줄도 건드리지 않고 CSS 만으로 재배치한다.
      _mallListGrid.php 의 인라인 style 은 Suppliervendorhead8.php 가 후크로 쓰고 있어
      구조를 바꾸면 템플릿8 이 깨진다.
   ============================================================================ */

/* 1) 카드 껍데기 제거 — 이미지가 주인공이 된다 */
.prdList__item {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.prdList__item:hover {
  transform: none;               /* 카드 전체가 뜨는 대신 이미지만 반응 */
  box-shadow: none;
}

/* 2) 썸네일 — 1:1 → 4:5 세로형 + 자체 라운드 */
.prdList__item .thumbnail {
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  border-bottom: 0;
  background-color: #f4f5f7;
  transition: box-shadow .2s ease;
}
.prdList__item:hover .thumbnail { box-shadow: 0 10px 26px rgba(19, 43, 35, .13); }

/* 3) 정보 영역 — 좌우 패딩 제거(이미지 끝선과 글자 시작선을 맞춘다) */
.description {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 2px 0;
}

/* 4) ★ 순서 재배치: 가격을 상품명 위로.
      할인 커머스는 가격이 먼저 읽혀야 한다. */
.description .spec { order: 1; margin-top: 0; }
.description .name { order: 2; }
.description .tt-rvline { order: 3; }

/* 5) 가격 줄을 세로 나열 → 가로 한 줄로.
      정가(취소선)는 판매가 뒤로 보내 "할인율 · 판매가 · 정가" 순서가 되게 한다. */
.spec {
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 7px;
}
.spec li:has(span[style*="line-through"]) { order: 2; }
.spec li:has(span[style*="color:#cc4d50"]) { order: 3; flex-basis: 100%; }

.spec li span[style*="font-weight:600"] {   /* 할인율 */
  font-size: 20px !important;
  margin-right: 4px !important;
}
.spec li span[style*="color:#1a1a1a"] {     /* 판매가 */
  font-size: 20px !important;
  letter-spacing: -.3px;
}
.spec li span[style*="text-decoration:line-through"] {  /* 정가 */
  font-size: 13.5px !important;
  color: #b3b8c2 !important;
}

/* 6) 상품명 — 가격 아래로 내려왔으니 보조 정보 톤으로 */
.description .name { display: flex; flex-direction: column; }
.description .name > a { order: 1; }
.description .name .vendor-header { order: 2; margin: 3px 0 0 !important; }
.description .name a span {
  font-size: 14px !important;
  color: var(--c-dark) !important;
  min-height: 0;                 /* 2줄 고정 높이 해제 — 카드 높이가 내용에 맞게 */
  -webkit-line-clamp: 2;
}
.vendor-header { font-size: 12.5px; color: var(--c-light); }

@media (max-width: 768px) {
  .prdList__item .thumbnail { border-radius: 12px; }
  .description { padding: 10px 2px 0; }
  .spec li span[style*="font-weight:600"],
  .spec li span[style*="color:#1a1a1a"] { font-size: 17px !important; }
}
