/* =====================================================
   Auction Detail — Mobile-First Redesign
   CATSBE Design System
===================================================== */

/* ── 페이지 래퍼 ── */
.ad-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
}

/* ── 이미지 갤러리 ── */
.ad-gallery {
  position: relative;
  background: #0f0e0c;
  overflow: hidden;
}
.ad-gallery-inner {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ad-gallery-inner::-webkit-scrollbar { display: none; }

.ad-gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 1 / 1;
  max-height: 480px;
}
.ad-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ad-gallery-empty {
  flex: 0 0 100%;
  aspect-ratio: 1 / 1;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cb-text-faint);
  font-size: 14px;
  background: var(--cb-surface-alt);
}

/* 갤러리 인디케이터 */
.ad-gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.ad-gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.2s;
}
.ad-gallery-dot.active {
  background: #fff;
  width: 18px;
  border-radius: 3px;
}

/* 갤러리 위 배지 */
.ad-gallery-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.ad-badge {
  padding: 4px 10px;
  border-radius: var(--cb-radius-pill);
  font-size: 11px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.ad-badge-type {
  background: rgba(255,255,255,0.85);
  color: var(--cb-text);
}
.ad-badge-status {
  color: #fff;
}
.ad-badge-status.live { background: var(--cb-live); }
.ad-badge-status.pending { background: var(--cb-upcoming); }
.ad-badge-status.closed { background: var(--cb-closed); }

/* ── 콘텐츠 영역 ── */
.ad-content {
  padding: 16px;
}

/* ── 헤더 (제목 + 액션) ── */
.ad-header {
  margin-bottom: 12px;
}
.ad-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--cb-text);
  line-height: 1.35;
  margin: 0 0 8px;
}
.ad-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ad-meta-chip {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--cb-radius-pill);
  background: var(--cb-surface-alt);
  color: var(--cb-text-sub);
  border: 1px solid var(--cb-border-light);
}
.ad-meta-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.ad-meta-actions a,
.ad-meta-actions button {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--cb-radius-sm);
  border: 1px solid var(--cb-border);
  background: var(--cb-surface);
  color: var(--cb-text-sub);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.ad-meta-actions a:hover,
.ad-meta-actions button:hover {
  background: var(--cb-bg-hover);
}
.ad-meta-actions .btn-watch {
  border-color: var(--cb-live);
  color: var(--cb-live);
}
.ad-meta-actions .btn-watch.active {
  background: var(--cb-live);
  color: #fff;
}
.ad-meta-actions .btn-del {
  border-color: var(--cb-danger);
  color: var(--cb-danger);
}

/* ── 가격 카드 ── */
.ad-price-card {
  background: var(--cb-surface);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}
.ad-price-label {
  font-size: 12px;
  color: var(--cb-text-muted);
  margin-bottom: 4px;
}
.ad-price-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--cb-text);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.ad-price-value.live {
  color: var(--cb-live);
}
.ad-price-value.secret {
  color: var(--cb-text-muted);
  font-size: 20px;
}

.ad-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: var(--cb-radius-pill);
  background: rgba(168,56,56,0.08);
  color: var(--cb-live);
  font-size: 13px;
  font-weight: 600;
}

/* ── 정보 그리드 ── */
.ad-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--cb-border-light);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.ad-info-item {
  padding: 10px 14px;
  background: var(--cb-surface);
}
.ad-info-item.full {
  grid-column: 1 / -1;
}
.ad-info-label {
  font-size: 11px;
  color: var(--cb-text-muted);
  margin-bottom: 2px;
}
.ad-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--cb-text);
}
.ad-info-value.accent {
  color: var(--cb-accent);
}

/* ── 타입 가이드 ── */
.ad-type-guide {
  padding: 12px 14px;
  border-radius: var(--cb-radius-lg);
  background: var(--cb-surface-alt);
  border: 1px solid var(--cb-border-light);
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cb-text-sub);
}
.ad-type-guide strong {
  color: var(--cb-text);
}
.ad-type-guide .sub {
  font-size: 12px;
  color: var(--cb-text-muted);
  margin-top: 4px;
}

/* ── 입찰 액션 영역 ── */
.ad-action {
  margin-bottom: 20px;
}
.ad-action-disabled {
  padding: 14px;
  border-radius: var(--cb-radius-lg);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.ad-action-disabled.pending {
  background: var(--cb-surface-alt);
  color: var(--cb-text-muted);
}
.ad-action-disabled.closed {
  background: #f0f0ee;
  color: var(--cb-closed);
}

.ad-bid-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  background: var(--cb-surface);
  color: var(--cb-text);
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.ad-bid-input:focus {
  outline: none;
  border-color: var(--cb-accent);
}
.ad-bid-input:disabled {
  opacity: 0.5;
}

.ad-bid-hint {
  font-size: 12px;
  color: var(--cb-text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}

.ad-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--cb-radius-lg);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.15s;
}
.ad-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ad-btn-primary {
  background: var(--cb-text);
  color: #fff;
}
.ad-btn-primary:hover:not(:disabled) {
  background: #2a2520;
}
.ad-btn-danger {
  background: var(--cb-live);
  color: #fff;
}
.ad-btn-danger:hover:not(:disabled) {
  background: #8a2020;
}
.ad-btn-warning {
  background: var(--cb-warning);
  color: #fff;
  margin-top: 10px;
}
.ad-btn-warning:hover:not(:disabled) {
  background: #b88a10;
}
.ad-btn-outline {
  background: transparent;
  border: 2px solid var(--cb-border);
  color: var(--cb-text-sub);
}
.ad-btn-login {
  background: var(--cb-accent);
  color: #fff;
}

/* ── 구분선 ── */
.ad-divider {
  height: 8px;
  background: var(--cb-surface-alt);
  margin: 0 -16px;
}

/* ── 상품 설명 ── */
.ad-section {
  margin-bottom: 20px;
}
.ad-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--cb-text);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--cb-border-light);
}
.ad-description {
  font-size: 14px;
  line-height: 1.75;
  color: var(--cb-text-sub);
  word-break: break-word;
}
.ad-description img {
  max-width: 100%;
  border-radius: var(--cb-radius);
  margin: 12px 0;
}

/* ── 비디오 ── */
.ad-video {
  margin: 16px 0;
  border-radius: var(--cb-radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.ad-video iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── 입찰 기록 ── */
.ad-bid-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ad-bid-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--cb-border-light);
  font-size: 13px;
}
.ad-bid-item:last-child {
  border-bottom: none;
}
.ad-bid-user {
  font-weight: 600;
  color: var(--cb-text);
}
.ad-bid-time {
  font-size: 11px;
  color: var(--cb-text-muted);
  margin-left: 8px;
}
.ad-bid-amount {
  font-weight: 700;
  color: var(--cb-accent);
}
.ad-bid-amount.secret {
  color: var(--cb-text-muted);
  font-weight: 400;
}
.ad-bid-empty {
  text-align: center;
  padding: 20px;
  color: var(--cb-text-muted);
  font-size: 13px;
}
.ad-bid-hidden-note {
  font-size: 12px;
  color: var(--cb-text-muted);
  text-align: center;
  margin-top: 8px;
}

/* ── 알림 배너 ── */
.ad-alert {
  padding: 10px 14px;
  border-radius: var(--cb-radius);
  font-size: 13px;
  text-align: center;
  margin-bottom: 10px;
}
.ad-alert-warning {
  background: rgba(212,160,32,0.1);
  color: #8a6a10;
  border: 1px solid rgba(212,160,32,0.2);
}
.ad-alert-info {
  background: rgba(46,106,150,0.08);
  color: var(--cb-dream);
  border: 1px solid rgba(46,106,150,0.15);
}

/* ── 포인트 안내 ── */
.ad-points-note {
  font-size: 11px;
  color: var(--cb-text-muted);
  text-align: center;
  padding: 8px 0;
  border-top: 1px solid var(--cb-border-light);
  margin-top: 12px;
}

/* =====================================================
   Desktop (768px+): 2-column layout
===================================================== */
@media (min-width: 768px) {
  .ad-page {
    padding: 16px;
  }

  .ad-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }

  .ad-gallery {
    border-radius: var(--cb-radius-lg);
    overflow: hidden;
    position: sticky;
    top: 16px;
  }

  .ad-gallery-slide {
    max-height: 520px;
  }

  .ad-content {
    padding: 0;
  }

  .ad-divider {
    display: none;
  }

  .ad-title {
    font-size: 24px;
  }

  .ad-price-value {
    font-size: 32px;
  }
}

/* =====================================================
   Small mobile tweaks
===================================================== */
@media (max-width: 380px) {
  .ad-price-value {
    font-size: 24px;
  }
  .ad-title {
    font-size: 18px;
  }
  .ad-info-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 복수 즉시구매 ── */
.buy-now-count {
  font-weight: 700;
}
.buy-now-sold-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: var(--cb-radius-pill);
  background: var(--cb-live);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.buy-now-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.buy-now-progress {
  flex: 1;
  height: 6px;
  background: var(--cb-border-light);
  border-radius: 3px;
  overflow: hidden;
}
.buy-now-progress-bar {
  height: 100%;
  background: var(--cb-accent);
  border-radius: 3px;
  transition: width 0.3s;
}
.buy-now-progress-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--cb-text-sub);
  white-space: nowrap;
}
.ad-buyout-soldout {
  padding: 12px;
  border-radius: var(--cb-radius-lg);
  background: var(--cb-surface-alt);
  color: var(--cb-text-muted);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  margin-top: 10px;
}

/* ── 특수 경매 안내 배너 ── */
.ad-special-guide {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--cb-radius-lg);
  margin-bottom: 16px;
  border: 1px solid;
}
.ad-special-guide.dutch {
  background: rgba(217,83,79,0.06);
  border-color: rgba(217,83,79,0.2);
}
.ad-special-guide.sealed {
  background: rgba(46,106,150,0.06);
  border-color: rgba(46,106,150,0.2);
}
.ad-special-guide.average {
  background: rgba(140,120,60,0.06);
  border-color: rgba(140,120,60,0.2);
}
.ad-special-guide.reverse {
  background: rgba(80,140,100,0.06);
  border-color: rgba(80,140,100,0.2);
}

.ad-sg-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
}
.dutch .ad-sg-icon { color: #d9534f; background: rgba(217,83,79,0.1); }
.sealed .ad-sg-icon { color: #2e6a96; background: rgba(46,106,150,0.1); }
.average .ad-sg-icon { color: #8c783c; background: rgba(140,120,60,0.1); }
.reverse .ad-sg-icon { color: #508c64; background: rgba(80,140,100,0.1); }

.ad-sg-body {
  flex: 1;
  min-width: 0;
}
.ad-sg-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--cb-text);
}
.ad-sg-desc {
  font-size: 13px;
  color: var(--cb-text-sub);
  line-height: 1.5;
  margin-bottom: 10px;
}
.ad-sg-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ad-sg-steps li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--cb-text-sub);
  line-height: 1.5;
}
.ad-sg-steps .num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--cb-text-muted);
}
.dutch .ad-sg-steps .num { background: #d9534f; }
.sealed .ad-sg-steps .num { background: #2e6a96; }
.average .ad-sg-steps .num { background: #8c783c; }
.reverse .ad-sg-steps .num { background: #508c64; }

.ad-sg-warn {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--cb-radius-sm);
  background: rgba(217,83,79,0.08);
  color: #a94442;
  line-height: 1.5;
}
