/* ===== 메인페이지 전용 스타일 ===== */

/* ===== 히어로 배너 ===== */
.hero-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 560px;
  overflow: hidden;
  background: var(--surface-light);
}

.hero-banner__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero-banner__slide--active { opacity: 1; }

.hero-banner__picture { display: block; width: 100%; height: 100%; }
.hero-banner__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 사진 위 스크림 — 상단(헤더 로고/네비용) + 좌하단(본문용). 우측·중앙은 비워 이미지 노출 */
.hero-banner__slide::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 28%),
    linear-gradient(to top right, rgba(0, 0, 0, 0.55), transparent 55%);
}

/* 밝은 배경(검정 글씨) — 흰 베일로 대비 확보 */
.hero-banner__slide.is-light::before {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(to top right, rgba(255, 255, 255, 0.7), transparent 55%);
}

/* 텍스트 위치: 좌측 중앙 (스크림 위) */
.hero-banner__content {
  position: absolute;
  top: 58%;
  left: 0;
  z-index: 2;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 8% 0 14%;
  max-width: 680px;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.hero-banner__cta-wrap {
  pointer-events: auto;
  min-height: 48px;
}

/* 텍스트 — 기본(어두운 배경)은 흰색, 자동 감지로 밝은 배경이면 검정 */
.hero-banner__sub,
.hero-banner__title,
.hero-banner__desc {
  color: var(--text-inverse);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.hero-banner__slide.is-light .hero-banner__sub,
.hero-banner__slide.is-light .hero-banner__title,
.hero-banner__slide.is-light .hero-banner__desc {
  color: var(--text-primary);
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.5);
}

.hero-banner__title {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  line-height: 1.1;
  margin-bottom: 14px;
  /* 큰 글자의 좌측 글리프 베어링 보정 — 부제목·CTA와 시각적 좌측선 정렬 */
  margin-left: -0.05em;
  letter-spacing: -1px;
  white-space: pre;
}

.hero-banner__desc {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: 1.6;
  margin-bottom: 36px;
}

/* CTA — 흰색 알약 */
.hero-banner__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 38px;
  background: var(--surface-white);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 3px;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: all var(--ease-base);
}

.hero-banner__cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* 밝은 배경 → 검정 알약 */
.hero-banner__slide.is-light .hero-banner__cta {
  background: var(--brand-primary);
  color: var(--text-inverse);
}

/* 좌우 화살표 */
.hero-banner__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color var(--ease-fast), transform var(--ease-fast);
  z-index: 5;
}
.hero-banner__arrow svg { width: 40px; height: 40px; stroke-width: 1.8; }

.hero-banner__arrow:hover { color: var(--surface-white); }
.hero-banner__arrow--prev:hover { transform: translateY(-50%) translateX(-2px); }
.hero-banner__arrow--next:hover { transform: translateY(-50%) translateX(2px); }

.hero-banner__arrow--prev { left: 24px; }
.hero-banner__arrow--next { right: 24px; }

/* 밝은 배경 → 화살표 어둡게 */
.hero-banner--light .hero-banner__arrow { color: rgba(0, 0, 0, 0.4); }
.hero-banner--light .hero-banner__arrow:hover { color: var(--text-primary); }

/* 도트: 하단 가운데 */
.hero-banner__dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.hero-banner__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.45);
  border: none;
  cursor: pointer;
  transition: all var(--ease-fast);
}

.hero-banner__dot--active {
  background: var(--surface-white);
  width: 28px;
}

/* 밝은 배경 → 도트 어둡게 */
.hero-banner--light .hero-banner__dot { background: rgba(0, 0, 0, 0.25); }
.hero-banner--light .hero-banner__dot--active { background: var(--brand-primary); }

@media (max-width: 768px) {
  .hero-banner { aspect-ratio: 4 / 3; max-height: none; min-height: 420px; }
  .hero-banner__content {
    padding: 0 6% 24px;
    max-width: 100%;
    top: auto;
    bottom: 48px;
    transform: none;
  }
  .hero-banner__title { font-size: var(--text-2xl); }
  .hero-banner__desc { font-size: var(--text-sm); margin-bottom: 16px; }
  .hero-banner__cta { padding: 12px 28px; font-size: var(--text-xs); }
  .hero-banner__arrow { display: none; }
  .hero-banner__dots { bottom: 12px; }
}

/* ===== 타임세일 캐러셀 ===== */
.ts-section {
  max-width: none;
  background: var(--surface-off-white);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 48px 0 56px;
}

.ts-section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

.ts-carousel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ts-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: var(--surface-white);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all var(--ease-fast);
}

.ts-arrow:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.ts-carousel--static .ts-arrow {
  display: none;
}

.ts-track-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.ts-track {
  display: flex;
  gap: 16px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ts-card {
  flex: 0 0 calc((100% - 80px) / 6);
  min-width: 140px;
  text-decoration: none;
  color: inherit;
}

.ts-card__img {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-light);
  margin-bottom: 8px;
}

.ts-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface-light);
  transition: transform 0.4s ease;
}

.ts-card:hover .ts-card__img img {
  transform: scale(1.03);
}

/* 호버 전환 이미지 */
.ts-card__img--secondary {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--ease-base), transform 0.4s ease;
}

.ts-card:hover .ts-card__img--secondary {
  opacity: 1;
}

.ts-card__timer {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text-inverse);
  font-size: 11px;
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.2px;
}

.ts-card__timer-icon {
  flex-shrink: 0;
}

.ts-card__placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface-light);
}

.ts-card__info {
  padding: 0 2px;
}

.ts-card__name {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: 1.5;
  height: 3em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.ts-card__original {
  font-size: var(--text-md);
  color: var(--text-muted);
  text-decoration: line-through;
  display: block;
  text-align: right;
}

.ts-card__price-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
}

.ts-card__rate {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--brand-danger);
}

.ts-card__sale {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.ts-section__more {
  text-align: center;
  margin-top: 36px;
}

.ts-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 36px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transition: all var(--ease-fast);
}

.ts-more-btn:hover {
  border-color: var(--text-primary);
  background: var(--surface-light);
}

@media (max-width: 768px) {
  .ts-card { flex: 0 0 calc((100% - 32px) / 3); min-width: 120px; }
  .ts-section { padding: 32px 0 40px; }
  .ts-section__inner { padding: 0 16px; }
  .ts-arrow { width: 34px; height: 34px; }
}

@media (max-width: 480px) {
  .ts-card { flex: 0 0 calc((100% - 16px) / 2.3); min-width: 110px; }
}

/* ===== 무한스크롤 로더 ===== */
.scroll-loader {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}

.scroll-loader__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-light);
  border-top-color: var(--brand-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 상품 카드 링크 ===== */
.product-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ===== 베스트 리뷰 섹션 ===== */
.review-section {
  padding: 80px 0 100px;
  background: var(--surface-off-white);
  border-top: 1px solid var(--border-light);
}

.review-section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

.review-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-carousel__arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--surface-white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--ease-fast);
  z-index: 2;
}

.review-carousel__arrow:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.review-carousel__viewport {
  flex: 1;
  overflow: hidden;
}

.review-carousel__track {
  display: flex;
  gap: 16px;
  transition: transform var(--ease-slide);
}

/* ===== 리뷰 카드 (메인) ===== */
.review-card {
  flex: 0 0 calc((100% - 64px) / 5);
  min-width: 180px;
  cursor: pointer;
}

.review-card__img-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-light);
  cursor: pointer;
}

.review-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--ease-slow);
}

.review-card__img-wrap:hover .review-card__img {
  transform: scale(1.04);
}

.review-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}

.review-card__title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-inverse);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-card__content {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.review-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.review-card__stars {
  color: var(--brand-accent);
  font-size: var(--text-sm);
  letter-spacing: 1px;
}

.review-card__author {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.75);
}

/* ===== 더보기 버튼 ===== */
.review-section__more {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.review-section__more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 16px 60px;
  border: 1px solid var(--border-subtle);
  font-size: var(--text-md);
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--surface-white);
  transition: all var(--ease-base);
}

.review-section__more-btn:hover {
  border-color: var(--brand-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 1024px) {
  .review-card { flex: 0 0 calc((100% - 48px) / 4); }
}

@media (max-width: 768px) {
  .review-section { padding: 60px 0 80px; }
  .review-section__inner { padding: 0 16px; }
  .review-card { flex: 0 0 calc((100% - 32px) / 3); min-width: 140px; }
  .review-carousel__arrow { width: 32px; height: 32px; }
}

@media (max-width: 480px) {
  .review-card { flex: 0 0 calc((100% - 16px) / 2.2); min-width: 130px; }
}
