/* ==========================================================================
   Heart to Kiss — ASK THE STYLIST Widget
   storefront/css/ask-widget.css
   모바일 우선 / 블랙·화이트 모노톤
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section 컨테이너
   -------------------------------------------------------------------------- */
.ask-widget {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-primary, #ffffff);
  color: var(--color-text-primary, #1a1a1a);
  padding: clamp(48px, 10vw, 120px) 16px;
  font-family: var(--font-body, 'Pretendard', sans-serif);
  user-select: none;
}

.ask-widget__inner {
  position: relative;
  z-index: 2;
  max-width: var(--container-max, 1280px);
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   백그라운드 슬라이더 (추천 상품 이미지 8장)
   - 8장 absolute 스택, opacity 페이드 (천천히)
   - 드래그 위/아래로 전환 + 우측 세로 버튼 클릭으로 전환
   -------------------------------------------------------------------------- */
.ask-widget__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ask-widget__bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition:
    opacity 1400ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 2800ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.ask-widget__bg-img.is-active {
  opacity: 0.18;
  transform: scale(1);
}

@media (max-width: 768px) {
  .ask-widget__bg-img.is-active {
    opacity: 0.14;
  }
}

/* --------------------------------------------------------------------------
   라벨 + 헤드라인 + 서브
   -------------------------------------------------------------------------- */
.ask-widget__label {
  display: block;
  font-family: var(--font-headline, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-text-secondary, #6b6b6b);
  text-transform: uppercase;
  margin-bottom: var(--space-3, 16px);
}

.ask-widget__title {
  font-family: var(--font-headline, 'Inter', sans-serif);
  font-size: clamp(64px, 14vw, 144px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--color-text-primary, #1a1a1a);
  margin: 0 0 var(--space-4, 24px) 0;
  text-transform: uppercase;
}

.ask-widget__sub {
  font-size: clamp(14px, 2vw, 18px);
  color: var(--color-text-secondary, #6b6b6b);
  max-width: 36ch;
  line-height: 1.6;
  margin: 0 0 var(--space-6, 48px) 0;
}

/* --------------------------------------------------------------------------
   카테고리 칩 (상단 7개 탭)
   -------------------------------------------------------------------------- */
.ask-widget__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2, 8px);
  margin-bottom: var(--space-5, 32px);
}

.ask-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;            /* 터치 영역 최소 44px */
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #e5e5e5;
  background: #f5f5f5;
  color: var(--color-text-primary, #1a1a1a);
  font-family: var(--font-headline, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--duration-ui, 280ms) var(--ease-out-soft, ease),
              color var(--duration-ui, 280ms) var(--ease-out-soft, ease),
              border-color var(--duration-ui, 280ms) var(--ease-out-soft, ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.ask-chip.is-active {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #1a1a1a;
}

@media (hover: hover) {
  .ask-chip:not(.is-active):hover {
    background: #eeeeee;
    border-color: #cccccc;
  }
}

/* --------------------------------------------------------------------------
   질문 캐러셀 래퍼
   -------------------------------------------------------------------------- */
.ask-widget__carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  margin-bottom: var(--space-5, 32px);
}

/* 캐러셀 (가로 스크롤) */
.ask-widget__carousel {
  display: flex;
  gap: var(--space-3, 16px);          /* 질문 칩 간격 */
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding: 0 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;              /* Firefox */
  flex: 1;
  min-width: 0;
}

.ask-widget__carousel::-webkit-scrollbar {
  display: none;                      /* Chrome/Safari */
}

/* 개별 질문 칩 */
.ask-question {
  flex-shrink: 0;
  scroll-snap-align: start;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #1a1a1a;
  background: transparent;
  color: var(--color-text-primary, #1a1a1a);
  font-family: var(--font-body, 'Pretendard', sans-serif);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-ui, 280ms) ease,
              color var(--duration-ui, 280ms) ease;
  -webkit-tap-highlight-color: transparent;
}

.ask-question.is-active {
  background: #1a1a1a;
  color: #ffffff;
}

@media (hover: hover) {
  .ask-question:hover {
    background: #1a1a1a;
    color: #ffffff;
  }
}

/* 로딩/에러 메시지 */
.ask-widget__loading {
  display: block;
  font-size: 14px;
  color: var(--color-text-secondary, #6b6b6b);
  padding: 12px 0;
}

/* 좌우 네비 버튼 — 모바일에서 숨김 */
.ask-carousel-nav {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  color: var(--color-text-primary, #1a1a1a);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--duration-ui, 280ms) ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .ask-carousel-nav:hover {
    background: #f5f5f5;
  }
}

/* --------------------------------------------------------------------------
   답변 영역
   -------------------------------------------------------------------------- */
.ask-widget__answer {
  border-top: 1px solid #e5e5e5;
  padding: var(--space-5, 32px) 0;
  margin-bottom: var(--space-5, 32px);
}

.ask-widget__answer-label {
  display: block;
  font-family: var(--font-headline, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-text-secondary, #6b6b6b);
  text-transform: uppercase;
  margin-bottom: var(--space-3, 16px);
}

.ask-widget__answer-text {
  font-family: var(--font-body, 'Pretendard', sans-serif);
  font-size: clamp(18px, 4vw, 28px);
  line-height: 1.6;
  color: var(--color-text-primary, #1a1a1a);
  margin: 0;
  /* typewriter 커서 효과 (JS가 텍스트를 주입 중일 때 시각적 힌트) */
  border-right: 2px solid transparent;
}

/* --------------------------------------------------------------------------
   추천 상품 그리드
   -------------------------------------------------------------------------- */
.ask-widget__products {
  /* 추가 여백 없음 — answer 아래 바로 */
}

.ask-widget__products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4, 24px);
}

.ask-widget__products-label {
  font-family: var(--font-headline, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-text-secondary, #6b6b6b);
  text-transform: uppercase;
}

/* RESHUFFLE 버튼 */
.ask-reshuffle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #1a1a1a;
  background: transparent;
  color: var(--color-text-primary, #1a1a1a);
  font-family: var(--font-headline, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 36px;
  transition: background var(--duration-ui, 280ms) ease,
              color var(--duration-ui, 280ms) ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .ask-reshuffle:hover {
    background: #1a1a1a;
    color: #ffffff;
  }
}

/* 상품 그리드 — 모바일: 1열 */
.ask-widget__products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4, 24px);
}

/* 상품 카드 */
.ask-product-card {
  display: block;
  text-decoration: none;
  color: var(--color-text-primary, #1a1a1a);
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
  transition: transform var(--duration-ui, 280ms) var(--ease-out-soft, ease),
              box-shadow var(--duration-ui, 280ms) var(--ease-out-soft, ease);
}

.ask-product-card__media {
  aspect-ratio: 3 / 4;
  width: 100%;
  background: #eeeeee;   /* JS가 gradient로 교체 */
}

.ask-product-card__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-3, 16px);
}

.ask-product-card__category {
  font-family: var(--font-headline, 'Inter', sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary, #6b6b6b);
  text-transform: uppercase;
}

.ask-product-card__name {
  font-family: var(--font-body, 'Pretendard', sans-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-primary, #1a1a1a);
}

.ask-product-card__price {
  font-family: var(--font-numeric, 'Inter', monospace);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary, #1a1a1a);
}

/* --------------------------------------------------------------------------
   태블릿 768px+
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .ask-widget {
    padding: clamp(64px, 10vw, 120px) var(--space-5, 32px);
  }

  .ask-widget__chips {
    gap: var(--space-3, 16px);
  }

  /* 상품 그리드 — 태블릿: 3열 */
  .ask-widget__products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4, 24px);
  }
}

/* --------------------------------------------------------------------------
   데스크탑 1024px+
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .ask-widget {
    padding: clamp(80px, 10vw, 120px) var(--space-8, 96px);
  }

  /* 캐러셀 좌우 버튼 표시 */
  .ask-carousel-nav {
    display: flex;
  }

  /* 상품 카드 호버 부상 (hover 가능 환경에서만) */
  @media (hover: hover) {
    .ask-product-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
    }
  }
}
