/* home.css — 메인 페이지 */
.hero {
  padding-block: 32px 0;
  text-align: center;
}

.hero__head {
  margin-bottom: 20px;
}

.hero__title {
  margin: 0 0 12px;
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 700;
  line-height: 1.35;
}

/* 모바일: 일본어 등 공백 없는 제목을 자연스러운 위치에서 나눔 / PC는 한 줄 */
.hero__title-desktop {
  display: none;
}

.hero__title-mobile {
  display: block;
  white-space: pre-line;
  text-align: center;
}

.hero__subtitle {
  margin: 0 auto;
  max-width: 36em;
  color: #555;
  font-size: 1rem;
  line-height: 1.6;
}

/* 모바일: 짧은 문구 / PC(768px+): 기존 상세 문구 */
.hero__subtitle-desktop {
  display: none;
  white-space: pre-line;
}

.hero__subtitle-mobile {
  display: inline;
  white-space: pre-line;
}

@media (min-width: 768px) {
  .hero__title-mobile {
    display: none;
  }

  .hero__title-desktop {
    display: inline;
  }

  .hero__subtitle-mobile {
    display: none;
  }

  .hero__subtitle-desktop {
    display: inline;
  }
}

/* 히어로 배너 — transform 무한 루프 · UI는 가운데 슬라이드에 고정
   admin 연동: home_banner_css_vars()가 --hb-* 원본 값을 inline으로 주입,
   아래에서 breakpoint별로 실제 사용 변수(--hero-banner-*)에 매핑 (mobile-first) */
.hero-banner {
  /* 100%는 flex track(max-content) 기준이라 슬라이드가 이미지 960px로 고정됨.
     100cqi = .hero-banner 본인 너비. JS가 px로 한 번 더 확정. */
  --hero-banner-width: min(calc(100cqi - 32px), var(--hb-max-width, 960px));
  --hero-banner-ratio-w: var(--hb-ratio-mobile-w, 2);
  --hero-banner-ratio-h: var(--hb-ratio-mobile-h, 1);
  --hero-banner-gap: 8px;
  --hero-banner-control-bg: rgb(72 58 50 / 36%);
  --hero-banner-control-blur: 8px;
  container-type: inline-size;
  width: 100%;
  margin-top: 12px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .hero-banner {
    --hero-banner-ratio-w: var(--hb-ratio-desktop-w, 2.6);
    --hero-banner-ratio-h: var(--hb-ratio-desktop-h, 1);
  }
}

.hero-banner__stage {
  position: relative;
  width: 100%;
}

.hero-banner__viewport {
  overflow: hidden;
  width: 100%;
  cursor: grab;
  touch-action: pan-y;
}

.hero-banner__viewport.is-dragging {
  cursor: grabbing;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.hero-banner__track {
  display: flex;
  gap: var(--hero-banner-gap);
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.45s ease;
  will-change: transform;
}

.hero-banner__track.is-no-transition {
  transition: none;
}

.hero-banner__slide {
  flex: 0 0 var(--hero-banner-width);
  width: var(--hero-banner-width);
  max-width: var(--hero-banner-width);
  min-width: 0;
  list-style: none;
}

.hero-banner__slide--clone {
  pointer-events: none;
}

.hero-banner__link {
  display: block;
  width: 100%;
  aspect-ratio: var(--hero-banner-ratio-w) / var(--hero-banner-ratio-h);
  border-radius: 16px;
  overflow: hidden;
  background: #e8f4fc;
  text-decoration: none;
  color: inherit;
  -webkit-user-drag: none;
  user-select: none;
}

.hero-banner__viewport.is-dragging .hero-banner__link {
  pointer-events: none;
}

.hero-banner__media {
  display: block;
  width: 100%;
  height: 100%;
  -webkit-user-drag: none;
  user-select: none;
}

.hero-banner__link picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-banner__link img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.hero-banner__slide--placeholder .hero-banner__link {
  background: linear-gradient(135deg, #dbeafe 0%, #ecfdf5 100%);
}

.hero-banner__slide--placeholder[data-slide-index="1"] .hero-banner__link {
  background: linear-gradient(135deg, #fce7f3 0%, #e0e7ff 100%);
}

.hero-banner__slide--placeholder[data-slide-index="2"] .hero-banner__link {
  background: linear-gradient(135deg, #fef3c7 0%, #dbeafe 100%);
}

/* UI — 가운데 슬라이드 영역에 고정 */
.hero-banner__ui {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 10;
  width: var(--hero-banner-width);
  aspect-ratio: var(--hero-banner-ratio-w) / var(--hero-banner-ratio-h);
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-banner__nav {
  /* 모바일: 스와이프 대체 → 숨김. PC: 호버·터치 시에만 표시 */
  display: none;
  position: absolute;
  top: 50%;
  z-index: 2;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 0; /* base.css button min-height 무효화 */
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgb(255 255 255 / 92%);
  color: #333;
  line-height: 0;
  box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.hero-banner__chevron {
  display: block;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

@media (min-width: 768px) {
  .hero-banner__nav {
    display: inline-flex;
  }

  .hero-banner__stage:hover .hero-banner__nav,
  .hero-banner__stage.is-nav-visible .hero-banner__nav,
  .hero-banner__nav:focus-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.hero-banner__nav--prev {
  left: 10px;
}

.hero-banner__nav--next {
  right: 10px;
}

.hero-banner__nav:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.hero-banner__controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.hero-banner__counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  background: var(--hero-banner-control-bg);
  backdrop-filter: blur(var(--hero-banner-control-blur));
  -webkit-backdrop-filter: blur(var(--hero-banner-control-blur));
  color: #fff;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.02em;
}

.hero-banner__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  min-height: 0; /* base.css button min-height 44px 무효화 — 타원 방지 */
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--hero-banner-control-bg);
  backdrop-filter: blur(var(--hero-banner-control-blur));
  -webkit-backdrop-filter: blur(var(--hero-banner-control-blur));
  color: #fff;
  cursor: pointer;
}

.hero-banner__toggle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.hero-banner__icon[hidden] {
  display: none !important;
}

.hero-banner__icon--pause {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: auto;
  height: auto;
}

.hero-banner__icon--pause::before,
.hero-banner__icon--pause::after {
  content: "";
  display: block;
  width: 2px;
  height: 9px;
  background: currentColor;
  border-radius: 1px;
}

.hero-banner__icon--play {
  display: block;
  width: 0;
  height: 0;
  margin-left: 1px;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
}

/* 대분류 필터 — 히어로와 카드 사이. 박스·줄 간격을 붙여 두지 않음 */
.catalog-filter {
  margin-top: 20px;
  margin-bottom: 32px;
}

.catalog-filter__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: stretch;
  gap: 12px;
  width: 100%;
}

.catalog-filter__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f1f3f5;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

/* 긴 카테고리 이름(일·영)은 두 줄까지, 넘치면 말줄임 — 칸 밖으로 나가지 않게 */
.catalog-filter__btn span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
  text-align: center;
}

/* 상품 표의 즉시구입과 같은 파랑 — 선택된 분류만 채운다 */
.catalog-filter__btn:hover {
  background: #e5e7eb;
}

.catalog-filter__btn.is-selected {
  background: #2563eb;
  color: #fff;
}

.catalog-filter__btn.is-selected:hover {
  background: #1d4ed8;
}

.catalog-filter__btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.catalog-filter__empty {
  margin-top: 8px;
}

@media (min-width: 768px) {
  .catalog-filter {
    margin-top: 28px;
    margin-bottom: 40px;
  }

  .catalog-filter__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
  }

  .catalog-filter__btn {
    width: auto;
    min-width: 7.25rem;
    padding: 8px 22px;
    font-size: 16px;
    line-height: 1.3;
  }
}

/* 상품 그리드 — 모바일 2열 · PC 4열 / 행·열 여백·구분선 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-card {
  min-width: 0;
  padding-bottom: 22px;
  border-bottom: 1px solid #e8e8e8;
}

/* 모바일 2열 — 마지막 줄은 구분선 없음 */
.product-card:nth-last-child(-n+2) {
  border-bottom: none;
  padding-bottom: 0;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 28px;
    row-gap: 20px;
  }

  .product-card {
    padding-bottom: 28px;
    border-bottom: 1px solid #e8e8e8;
  }

  /* PC 4열 — 마지막 줄만 구분선 제거 */
  .product-card:nth-last-child(-n+2) {
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 28px;
  }

  .product-card:nth-last-child(-n+4) {
    border-bottom: none;
    padding-bottom: 0;
  }
}

.product-card.is-filter-hidden {
  display: none;
}

.product-grid.is-filtered .product-card {
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 22px;
}

.product-grid.is-filtered .product-card.is-grid-tail {
  border-bottom: none;
  padding-bottom: 0;
}

@media (min-width: 768px) {
  .product-grid.is-filtered .product-card {
    padding-bottom: 28px;
  }

  .product-grid.is-filtered .product-card.is-grid-tail {
    border-bottom: none;
    padding-bottom: 0;
  }
}

.product-card__link {
  display: block;
  min-height: 44px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.product-card--static .product-card__link--static {
  cursor: default;
}

.product-card--static .product-card__visual {
  opacity: 0.72;
}

/* 실물 기프트카드 비율 — 이미지 꽉 채움 / 없으면 no-image / 제목만 */
.product-card__visual {
  aspect-ratio: 1.586 / 1; /* 표준 카드 비율에 가깝게 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #f0f0f0;
  border: 1px solid #ebebeb;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.product-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.product-card__visual--empty {
  background: #f3f3f3;
}

/* 데모 카드도 상세로 이동 가능 */

/* 이미지 바로 아래 · 제목만 · 가운데 */
.product-card__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 2px;
  padding-inline: 2px;
  text-align: center;
}

.product-card__name {
  margin: 0;
  width: 100%;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.35;
  color: #555;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (min-width: 768px) {
  .product-card__name {
    font-size: 0.8125rem;
  }
}

.product-card__link:hover .product-card__visual {
  border-color: #cbd5e1;
}

.product-card__link:hover .product-card__name {
  color: #333;
}

@media (hover: hover) {
  .product-card__link:hover {
    transform: translateY(-4px);
  }

  .product-card--static .product-card__link--static:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-card__link {
    transition: none;
  }

  .product-card__link:hover {
    transform: none;
  }
}

.product-card__link:focus-visible {
  outline: none;
}

.product-card__link:focus-visible .product-card__visual {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* 구매 3단계 */
.section__title--with-icon {
  text-align: center;
}

.section__title--with-icon .section__title__inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}

.section__title__icon {
  flex-shrink: 0;
  color: #2563eb;
}

@media (min-width: 768px) {
  .section__title--with-icon {
    text-align: left;
  }

  .section__title--with-icon .section__title__inner {
    justify-content: flex-start;
  }
}

.steps {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
}

.steps__arrow {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding-block: 14px;
  color: #64748b;
}

.steps__arrow-icon {
  display: block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.steps__arrow-icon--right {
  display: none;
}

.step-card {
  min-width: 0;
  padding: 24px 20px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgb(15 23 42 / 6%);
  text-align: center;
}

.step-card__label {
  margin: 0 0 10px;
  color: #3b82f6;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.step-card__title {
  margin: 0 0 10px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.step-card__desc {
  margin: 0;
  font-size: 0.9375rem;
  color: #555;
  line-height: 1.6;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: normal;
  word-break: normal;
  line-break: strict;
}

@media (min-width: 768px) {
  .steps {
    flex-direction: row;
    align-items: stretch;
  }

  .steps__arrow {
    padding-block: 0;
    padding-inline: 14px;
    align-self: center;
  }

  .steps__arrow-icon--down {
    display: none;
  }

  .steps__arrow-icon--right {
    display: block;
  }

  .step-card {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
}

.howto-warn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 64px 0 0;
  padding: 16px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 12px;
}

.howto-warn__icon {
  flex-shrink: 0;
  display: block;
  width: 32px;
  height: 32px;
  margin-top: 1px;
}

.howto-warn__body {
  min-width: 0;
  flex: 1;
}

.howto-warn__title {
  margin: 0 0 12px;
  color: #991b1b;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.howto-warn__list {
  margin: 0;
  padding-left: 1.2em;
  color: #7f1d1d;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.howto-warn__list li + li {
  margin-top: 8px;
}

.howto-warn__list li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.howto-warn__list strong {
  color: #9f1239;
  font-weight: 800;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
}

.faq-item__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 14px 16px;
  border: none;
  background: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.faq-item__question::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.25rem;
  color: #888;
}

.faq-item.is-open .faq-item__question::after {
  content: "−";
}

.faq-item__answer {
  display: none;
  margin: 0;
  padding: 0 16px 16px;
  color: #555;
  font-size: 0.9375rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.faq-item.is-open .faq-item__answer {
  display: block;
}

.faq-item__question:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.faq-page__item + .faq-page__item {
  margin-top: 20px;
}

.faq-page__q {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
}

.faq-page__a {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
