/* =====================================================
   productDetail.css - 상품 상세 페이지
   ===================================================== */

.pdContainer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 0 60px;
}

/* =====================================================
   상단: 이미지 갤러리 + 상품 정보
   ===================================================== */
.pdTopArea {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  margin-bottom: 48px;
}

/* ── 갤러리 ── */
.pdGallery {
  width: 480px;
  flex-shrink: 0;
}

.pdMainImg {
  width: 480px;
  height: 480px;
  border: 1px solid #eee;
  border-radius: 14px;
  overflow: hidden;
  background: #f8f8f8;
  margin-bottom: 14px;
}

.pdMainImg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.pdMainImg:hover img {
  transform: scale(1.03);
}

.pdThumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pdThumb {
  width: 80px;
  height: 80px;
  border: 2px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
  background: #f8f8f8;
}

.pdThumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdThumb.active,
.pdThumb:hover {
  border-color: #20c997;
}

/* ── 상품 정보 패널 ── */
.pdInfoPanel {
  flex: 1;
  min-width: 0;
}

.pdBreadcrumb {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pdBreadcrumb a {
  color: #aaa;
  text-decoration: none;
  transition: color 0.2s;
}

.pdBreadcrumb a:hover {
  color: #20c997;
}

.pdTitle {
  font-size: 24px;
  font-weight: bold;
  color: #1a1a1a;
  line-height: 1.4;
  margin-bottom: 16px;
}

.pdPriceRow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.pdPrice {
  font-size: 30px;
  font-weight: bold;
  color: #1a1a1a;
}

.pdStateBadge {
  font-size: 13px;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid #20c997;
  color: #20c997;
}

.pdState-미개봉 {
  background: #e6f9f4;
}

.pdDivider {
  border: none;
  border-top: 1px solid #f0f0f0;
  margin: 20px 0;
}

/* 메타 정보 */
.pdMetaList {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.pdMetaList li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.pdMetaList ion-icon {
  font-size: 18px;
  color: #20c997;
  flex-shrink: 0;
}

.pdMetaLabel {
  color: #aaa;
  width: 64px;
  flex-shrink: 0;
}

.pdMetaValue {
  color: #313030;
  font-weight: 500;
}

/* 판매자 박스 */
.pdSellerBox {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8f8f8;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.pdSellerBox--link {
  text-decoration: none;
  transition: background .2s, box-shadow .2s;
  cursor: pointer;
  border: 1px solid transparent;
}
.pdSellerBox--link:hover {
  background: #f0fdf8;
  border-color: #20c997;
  box-shadow: 0 2px 8px rgba(32,201,151,.1);
}

.pdSellerAvatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #e0e0e0;
  flex-shrink: 0;
}
.pdSellerAvatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdSellerName {
  font-size: 15px;
  font-weight: bold;
  color: #313030;
}

.pdSellerSub {
  font-size: 12px;
  color: #20c997;
  margin-top: 2px;
  font-weight: 500;
}

/* 태그 */
.pdTags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.pdTag {
  font-size: 13px;
  color: #20c997;
  background: #e6f9f4;
  border-radius: 20px;
  padding: 4px 10px;
}

/* 거래 상태 뱃지 */
.pdTradeBadge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.pdTrade-RESERVED {
  background: #fff7e6;
  color: #d97706;
  border: 1.5px solid #f59e0b;
}

.pdTrade-SOLD {
  background: #f0f0f0;
  color: #888;
  border: 1.5px solid #ccc;
}

/* 거래 상태 변경 영역 */
.pdTradeStatusWrap {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-bottom: 8px;
}

.pdTradeStatusSelect {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.pdTradeStatusSelect:focus {
  border-color: #20c997;
}

.pdBtnStatus {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 16px;
  background: #20c997;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.pdBtnStatus:hover {
  background: #17a589;
}

/* 액션 버튼 */
.pdActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pdBtnPrimary,
.pdBtnSecondary,
.pdBtnDanger {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  font-size: 15px;
  font-weight: bold;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.pdBtnPrimary {
  background: #20c997;
  color: #fff;
}

.pdBtnPrimary:hover {
  background: #17a589;
}

.pdBtnSecondary {
  background: #f0f0f0;
  color: #555;
}

.pdBtnSecondary:hover {
  background: #e0e0e0;
}

.pdBtnDanger {
  background: #fff0f0;
  color: #e74c3c;
  border: 1px solid #e74c3c;
}

.pdBtnDanger:hover {
  background: #e74c3c;
  color: #fff;
}

/* =====================================================
   하단: 상품 설명
   ===================================================== */
.pdDescSection {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 24px;
}

.pdSectionTitle {
  font-size: 17px;
  font-weight: bold;
  color: #313030;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid #20c997;
}

.pdDesc {
  font-size: 15px;
  color: #444;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 뒤로가기 */
.pdBackRow {
  text-align: left;
}

.pdBackBtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #666;
  cursor: pointer;
  transition: background 0.2s;
}

.pdBackBtn:hover {
  background: #e8e8e8;
}

/* =====================================================
   거래완료 처리 모달
   ===================================================== */
@keyframes bmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes bmSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.bmOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bmFadeIn 0.2s ease;
}

.bmCard {
  background: #fff;
  border-radius: 18px;
  width: 360px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  overflow: hidden;
  animation: bmSlideUp 0.25s ease;
}

/* 헤더 */
.bmHeader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #f3f4f6;
}

.bmIconWrap {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: linear-gradient(135deg, #20c997, #12b886);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bmIconWrap ion-icon {
  font-size: 24px;
  color: #fff;
}

.bmTitle {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin: 0 0 3px;
}

.bmSub {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
}

/* 본문 */
.bmBody {
  min-height: 100px;
  padding: 16px 20px;
}

/* 빈 상태 */
.bmEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 0 10px;
  gap: 8px;
}

.bmEmpty ion-icon {
  font-size: 40px;
  color: #d1d5db;
}

.bmEmpty p {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
}

/* 구매자 목록 */
.bmList {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bmList::-webkit-scrollbar { width: 4px; }
.bmList::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 4px; }

.bmItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}

.bmItem ion-icon {
  font-size: 24px;
  color: #9ca3af;
  flex-shrink: 0;
}

.bmItem span {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.bmItem:hover {
  border-color: #20c997;
  background: #f0fdf9;
}

.bmItem--selected {
  border-color: #20c997 !important;
  background: #f0fdf9 !important;
}

.bmItem--selected ion-icon {
  color: #20c997;
}

/* 푸터 버튼 */
.bmFooter {
  display: flex;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid #f3f4f6;
}

.bmBtnCancel, .bmBtnConfirm {
  flex: 1;
  padding: 11px 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.15s, color 0.15s;
}

.bmBtnCancel {
  border: 1.5px solid #e5e7eb;
  background: #fff;
  color: #374151;
}

.bmBtnCancel:hover {
  background: #f9fafb;
}

.bmBtnConfirm {
  border: none;
  background: #20c997;
  color: #fff;
}

.bmBtnConfirm:hover {
  background: #17a589;
  color: #fff;
}

.bmBtnConfirm:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}

.bmBtnConfirm:disabled:hover {
  background: #e5e7eb;
  color: #9ca3af;
}

/* ── 추천 상품 섹션 ── */
.pdRelatedSection {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #f0f0f0;
}

.pdRelatedGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 768px) {
  .pdRelatedGrid { grid-template-columns: repeat(2, 1fr); }
}

.pdRelatedCard {
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee;
  background: #fff;
  transition: box-shadow .2s, transform .2s;
}
.pdRelatedCard:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  transform: translateY(-2px);
}

.pdRelatedImg {
  aspect-ratio: 1;
  overflow: hidden;
}
.pdRelatedImg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.pdRelatedCard:hover .pdRelatedImg img {
  transform: scale(1.05);
}

.pdRelatedInfo {
  padding: 10px 12px 12px;
}
.pdRelatedTitle {
  font-size: .875rem;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.pdRelatedPrice {
  font-size: .95rem;
  font-weight: 800;
  color: #1a1a1a;
}
.pdRelatedPlace {
  font-size: .75rem;
  color: #aaa;
  margin-top: 3px;
}

