

/* ===== Section ===== */
.md-pick-section {
  padding: 40px 0;
  background-color: #fff;
}

/* ===== Section Header ===== */
.md-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 0;
  border-bottom: none;
}

.md-header .text-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.md-header .title {
  font-size: 22px;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.3px;
}

.md-header .desc {
  font-size: 14px;
  color: #888;
  font-weight: 400;
}

.md-header .link-more {
  font-size: 13px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  transition: color 0.2s;
}

.md-header .link-more:hover {
  color: #111;
}

/* ===== Grid — PC 4열, 모바일 1열 ===== */
.md-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ===== Card — Discover Feed Style ===== */
.md-card {
  display: flex;
  flex-direction: column;
  background: #f5f6f8; /* 모바일(ttm-card)과 동일한 소프트 그레이 카드 */
  border: 1px solid #e7e9ed; /* 가로/세로 구분선과 동일 톤의 카드 테두리 */
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-card:hover {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

/* ----- Top Bar: 공급업체명 ----- */
.md-card .card-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 18px;
  border-bottom: 1px solid #e7e9ed; /* 그레이 카드에서도 보이도록 구분선 강화 */
  background: transparent;
}

.md-card .supplier-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* 공급업체 이니셜 아바타 */
.md-card .supplier-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8e8e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.md-card .supplier-name {
  font-size: 13px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-card .topbar-price {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: 6px;
}

.md-card .topbar-price .discount {
  font-size: 16px;
  font-weight: 800;
  color: var(--c-point);
  letter-spacing: -0.3px;
}

.md-card .topbar-price .price {
  font-size: 16px;
  font-weight: 800;
  color: #111;
  letter-spacing: -0.3px;
}

.md-card .topbar-price .original {
  font-size: 16px;
  color: #bbb;
  text-decoration: line-through;
  font-weight: 400;
}

/* ----- Thumbnail ----- */
.md-thumb {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 정사각형 — 상품 이미지 비율에 맞춰 여백 최소화 */
  overflow: hidden;
  background: #fff; /* 카드가 그레이가 되면서 이미지 영역은 흰색으로 대비 */
  border-bottom: 1px solid #e7e9ed; /* 이미지 ↔ 정보영역 가로 구분선 */
}

.md-thumb .img-link {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* 꽉 안 차는(비율 다른) 이미지의 빈자리를 같은 이미지의 블러로 채움.
   정사각 이미지는 위 contain 이미지가 전체를 덮어 블러가 안 보임. */
.md-thumb .img-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--card-bg);
  background-size: cover;
  background-position: center;
  filter: blur(22px) saturate(1.1);
  transform: scale(1.25);
  z-index: 0;
}

.md-thumb .img-link img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* 원본 전체 표시(잘림 없음). 빈자리는 위 블러 배경이 채움 */
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.md-card:hover .md-thumb img {
  transform: scale(1.03);
}

/* 장바구니 버튼 */
.md-thumb .btn-cart {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  z-index: 3; /* img(z-index:1) 위로 — 정사각 이미지에 가려지던 문제 수정 */
}

/* hover 없이도 항상 표시 (위 기본값 opacity:1). hover 시 살짝 강조만 */
.md-card:hover .btn-cart {
  opacity: 1;
  transform: translateY(0);
}

.md-thumb .btn-cart:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* 품절 오버레이 (어둡게 프로스트 + 흰 테두리 칩) */
.soldout-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(26, 28, 32, 0.28);
  -webkit-backdrop-filter: grayscale(35%);
  backdrop-filter: grayscale(35%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.soldout-cover span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  border: 1.5px solid #fff;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(20, 22, 26, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* 일시품절은 살짝 다른 톤 (덜 어둡게) */
.soldout-cover.is-partial { background: rgba(26, 28, 32, 0.22); }

/* 상품 뱃지 오버레이 (md-thumb 좌측 상단) — 관리자 지정 + 유통기한임박/품절임박 자동뱃지.
   색상은 인라인(bg/text)으로 뱃지별 지정, 모바일(ttm-badge) 톤과 통일 */
.md-thumb .md-badge-wrap {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  z-index: 3; /* 이미지 위, soldout-cover(4)·btn-cart(5) 아래 */
  pointer-events: none;
  max-width: calc(100% - 20px);
}
.md-thumb .md-badge {
  font-size: 12.5px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 9px;
  line-height: 1.25;
  letter-spacing: -0.3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  white-space: nowrap;
}
/* 할인율 뱃지 — 모바일(ttm-badge)과 동일 톤 (빨강 + 컬러 글로우) */
.md-thumb .md-badge--dc {
  background: var(--c-point);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(255, 46, 136, 0.35);
}

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

/* ----- Info Area: 상품명 + 스토리 ----- */
.md-info {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 18px;
}

.info-link {
  text-decoration: none;
}

.md-info .prod-name {
  font-size: 16px;
  color: #111;
  line-height: 1.45;
  margin-bottom: 2px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 30px;
}

.md-info .brand {
  font-weight: 800;
  color: #111;
  margin-right: 3px;
}

/* 상품 스토리 */
.md-info .prod-story {
  font-size: 13.5px;
  color: #777;
  line-height: 1.55;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-bottom: 10px;
}

/* 가격 행 — 인포 하단 (topbar에도 가격이 있지만, 모바일 접근성을 위해 유지) */
.md-info .price-row {
  display: none; /* 기본은 topbar에 가격 표시하므로 숨김 */
}

/* 태그 */
.md-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.md-tag {
  font-size: 11px;
  color: #666;
  background-color: #f0f0ed;
  padding: 3px 8px;
  border-radius: 100px;
  font-weight: 500;
}

/* 쿠폰 */
.new_coupon {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #fff5f5;
  border-radius: 8px;
  border: 1px solid #ffe0e0;
}

.new_coupon span {
  font-size: 13px;
  color: var(--c-point);
  font-weight: 600;
}

.new_coupon span:first-child {
  font-weight: 800;
}

/* ===== Responsive — Tablet ===== */
@media (max-width: 1024px) {
  .md-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* ===== Responsive — Mobile ===== */
@media (max-width: 640px) {
  .md-pick-section {
    padding: 24px 0;
  }

  .md-header {
    margin-bottom: 16px;
    align-items: center;
  }

  .md-header .title {
    font-size: 18px;
  }

  .md-header .desc {
    display: none;
  }

  /* 모바일 1열 */
  .md-product-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 12px; /* 양옆 여백 — 카드가 화면 끝에 붙지 않도록 */
  }

  /* 카드 라운딩 줄이기 */
  .md-card {
    border-radius: 0px;
    padding: 10px;
  }

  /* 탑바 */
  .md-card .card-topbar {
    padding: 12px 14px;
  }

  .md-card .supplier-avatar {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }

  .md-card .supplier-name {
    font-size: 12px;
  }

  .md-card .topbar-price .discount {
    font-size: 22px;
  }

  .md-card .topbar-price .price {
    font-size: 22px;
  }

  .md-card .topbar-price .original {
    font-size: 11px;
  }

  /* 썸네일 — 모바일도 1:1 정사각형 유지 */
  .md-thumb {
    padding-top: 100%;
  }

  /* 장바구니 버튼 항상 표시 */
  .md-thumb .btn-cart {
    opacity: 1;
    transform: translateY(0);
    width: 34px;
    height: 34px;
    bottom: 8px;
    right: 8px;
  }

  .md-thumb .btn-cart svg {
    width: 16px;
    height: 16px;
  }

  /* 인포 */
  .md-info {
    padding: 12px 14px 16px;
  }

  .md-info .prod-name {
    font-size: 22px;
  }

  .md-info .prod-story {
    font-size: 18px;
    -webkit-line-clamp: 3;
  }

  .md-pick-section {
    padding: 10px 0;
  }

  .new_coupon span {
    font-size: 12px;
  }
}
/* ============================================================================
   [TTBOX] 메인 섹션 헤더 재구성 (2026-08-07)
   ----------------------------------------------------------------------------
   떠리마켓은 [타이틀 · 설명] 을 baseline 으로 나란히 놓고 우측에 회색 텍스트
   "전체보기 >" 를 두는 표준형이었다.
   티티박스는 타이틀 앞에 브랜드 액센트 바를 세우고 설명을 아래로 내리며,
   전체보기를 알약 칩으로 바꿔 헤더 신상관 칩·목록 필터 칩과 톤을 맞춘다.
   ★ 마크업은 그대로 두고 CSS 만 바꾼다.
   ============================================================================ */
.md-header { align-items: center; margin-bottom: 22px; }

.md-header .text-group {
  display: block;              /* baseline 나란히 → 세로 배치 */
  position: relative;
  padding-left: 14px;
}
/* 타이틀 앞 브랜드 액센트 바 */
.md-header .text-group::before {
  content: '';
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--c-primary) 0%, var(--c-point) 100%);
}
.md-header .title { font-size: 21px; letter-spacing: -.5px; display: block; }
.md-header .desc { display: block; margin-top: 3px; font-size: 13px; color: var(--c-light); }

/* 전체보기: 회색 텍스트 링크 → 알약 칩 */
.md-header .link-more {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-gray);
  font-size: 13px;
  font-weight: 700;
}
.md-header .link-more:hover { background: var(--c-primary-light); color: var(--c-primary); }

@media (max-width: 768px) {
  .md-header { margin-bottom: 16px; }
  .md-header .title { font-size: 18px; }
  .md-header .link-more { padding: 6px 11px; font-size: 12px; }
}
