/* =====================================================================
   Responsive — 웹 디자인 기반 반응형 (태블릿 / 모바일)
   ===================================================================== */

/* 컨텐츠 폭을 1200 → 화면폭으로 (좌우 여백 부여) */
@media (max-width: 1239px) {
  .container { width: 100%; padding-inline: 24px; }
}

/* ============ 태블릿 (≤1024) ============ */
@media (max-width: 1024px) {
  main > .container { gap: 56px; padding-block: 32px 64px; }

  /* 헤더 */
  .util-tab { font-size: var(--fs-md); padding: 9px 11px; }
  .brand-row__inner { height: 70px; }
  .logo__mark { width: 49px; height: 36px; }
  .logo__wordmark { width: 147px; height: 14px; }
  .search { width: 330px; height: 46px; }
  .search__btn { width: 38px; height: 38px; flex-basis: 38px; }
  .search__btn img { width: 22px; height: 22px; }

  /* 히어로: 캐러셀 위 / 타일 아래 */
  .hero { flex-direction: column; }
  .hero__carousel { width: 100%; flex: none; height: 340px; }
  .tiles { width: 100%; height: auto; flex: none; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }

  /* 그리드 */
  .product-grid--4 { grid-template-columns: repeat(3, 1fr); }

  /* 칩 배너: 비대칭 → 동일 폭 2분할 */
  .chip-card:nth-child(1), .chip-card:nth-child(2) { flex: 1 1 0; width: auto; }

  /* 리뷰: 고정폭 해제 → 2개씩 */
  .review-card { flex: 0 0 calc((100% - 24px) / 2); width: auto; height: auto; }
  .review-card__thumb { width: auto; height: auto; aspect-ratio: 1 / 1; }

  /* 섹션 타이틀 */
  .section-title { font-size: var(--fs-title-md); }
  .chip-card__title { font-size: var(--fs-title-md); }
}

/* ============ 모바일 (≤768) ============ */
@media (max-width: 768px) {
  main > .container { gap: 38px; padding-block: 18px 72px; }

  /* 헤더: 유틸바 축소 + 검색 줄바꿈 + cat-bar 가로스크롤 */
  .util-bar__inner { min-height: 38px; }
  .util-tab { font-size: var(--fs-xs); padding: 7px 8px; }
  .util-links a { padding: 5px 6px; font-size: var(--fs-2xs); }

  .logo__mark { width: 41px; height: 30px; }
  .logo__wordmark { width: 126px; height: 12px; }
  .search {
    order: 3;
    width: 100%;
    height: 44px;
    margin: 1px 0 6px;
    padding-left: 16px;
  }
  .search__btn { width: 38px; height: 38px; flex-basis: 38px; }
  .search__btn img { width: 22px; height: 22px; }
  .brand-row__inner { flex-wrap: wrap; align-content: center; row-gap: 5px; height: auto; padding: 6px 20px 0; }

  /* 히어로 */
  .hero__carousel { height: 240px; }
  .hero-fallback { gap: 14px; padding: 24px; }
  .hero-fallback__copy { flex-basis: 58%; }
  .hero-fallback__copy em { font-size: 12px; }
  .hero-fallback__copy strong { margin-top: 8px; font-size: var(--fs-title-sm); }
  .hero-fallback__copy span { margin-top: 10px; font-size: 13px; line-height: 1.55; }
  .hero-fallback__media { border-radius: 12px; }
  .hero-fallback__media--contain { padding: 18px 10px 0; }
  .hero__nav { width: 40px; height: 40px; top: auto; bottom: 12px; }
  .hero__nav img { width: 22px; height: 22px; }
  .hero__nav--prev { left: 12px; }
  .hero__nav--next { right: 12px; }
  .tiles { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); gap: 9px; }
  .tile { min-height: 92px; padding: 10px; border-radius: 12px; }
  .tile__title { font-size: 13px; line-height: 1.45; max-width: 76%; }
  .tile__thumb { width: 62px; height: 62px; right: 8px; top: 30px; }

  /* 섹션 헤더 */
  .section-title { font-size: var(--fs-xl); }
  .section-title--sm { font-size: var(--fs-lg); }
  .more-link { font-size: 15px; }
  .section-head { margin-bottom: 20px; }

  /* 상품 그리드: 2열 */
  .product-grid { gap: 14px; }
  .product-grid--4, .product-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .product-card__info { margin-top: 10px; }
  .cart-btn { height: 40px; font-size: 13px; gap: 6px; }
  .cart-btn img { width: 18px; height: 18px; }
  .product-card__brand, .product-card__name { font-size: 14px; margin-top: 6px; }
  .price__origin { font-size: 13px; }
  .price__rate, .price__final { font-size: 17px; }
  .rating img { width: 18px; height: 18px; }
  .rating__score { font-size: 14px; }
  .badge-new { font-size: 13px; padding: 4px 7px; }
  .badge-rank { width: 44px; height: 60px; right: 12px; font-size: var(--fs-title-sm); }

  /* 베스트 탭: 가로 스크롤 */
  .tabs { gap: 8px; margin-bottom: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: 9px 18px; font-size: 15px; }

  /* 칩 배너: 세로 적층 */
  .chip-banners { flex-direction: column; }
  .chip-card,
  .chip-card:nth-child(1),
  .chip-card:nth-child(2) { flex: 1 1 auto; width: 100%; min-height: 200px; padding: 24px; }
  .chip-card__label { font-size: 14px; }
  .chip-card__title { font-size: var(--fs-title-sm); }
  .chip-card__btn { right: 24px; bottom: 24px; padding: 10px 14px; font-size: 14px; }

  /* 리뷰: 1개씩 */
  .review-card { flex: 0 0 100%; }
  .review-card__name { font-size: 18px; margin-top: 12px; }
  .review-card__stars img { width: 18px; height: 18px; }
  .reviews__nav { top: auto; bottom: 50%; }

  /* 라인 배너 */
  .line-banner { height: 84px; }
  .line-banner__text { font-size: 15px; padding: 0 16px; text-align: center; }

  /* 푸터: 세로 적층 */
  .footer__inner { flex-direction: column; gap: 28px; }
  .footer__col--a { width: 100%; flex: none; padding-right: 0; }
  .footer__col--b {
    flex-wrap: wrap; gap: 20px 30px;
    padding: 24px 0 0; border-left: 0; border-top: 1px solid #e3e3e3;
  }
  .footer__col--c { padding: 24px 0 0; border-left: 0; border-top: 1px solid #e3e3e3; }
}

/* ============ 소형 모바일 (≤420) ============ */
@media (max-width: 420px) {
  .util-links a:first-child { display: none; } /* 회원가입 숨김 */
  .search__input { font-size: 15px; }
  .hero__carousel { height: 190px; }
  .hero-fallback { padding: 18px; }
  .hero-fallback__copy strong { font-size: 20px; }
  .hero-fallback__copy span { display: none; }
  .tile { min-height: 88px; }
  .tile__thumb { width: 60px; height: 60px; top: 28px; }
  .section-title { font-size: 20px; }
  .chip-card__title { font-size: 20px; }
}
