/* 참지마켓 style.css — 모바일 쇼핑앱 UX 기준 */

/* ─── 토큰 ─────────────────────────────────── */
:root {
  --point: #ffc400;
  --point-dark: #e6ac00;
  --point-soft: #fff0b3;
  --bg-dark: #111111;
  --bg-dark2: #1c1c1c;
  --bg-page: #f2f2f5;
  --card-bg: #ffffff;
  --text-main: #1a1a1a;
  --text-sub: #666666;
  --text-light: #f5f5f5;
  --text-muted: #999999;
  --border: #e4e4e4;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --header-h: 56px;
}

/* ─── 리셋 ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

img { display: block; max-width: 100%; }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

/* ─── 헤더 ─────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg-dark);
  border-bottom: 2px solid var(--point);
  height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--point);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

/* 헤더 검색창 */
.header-search-wrap {
  flex: 1;
  min-width: 0;
}

.header-search-input {
  width: 100%;
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid #ddd;
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.header-search-input::placeholder {
  color: #aaa;
}

.header-search-input:focus {
  border-color: var(--point);
}

/* ─── 메인 레이아웃 ────────────────────────── */
.main-content {
  padding-bottom: 40px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── 섹션 공통 ────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 10px;
}

.section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  position: relative;
  padding-left: 11px;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 1em;
  background: var(--point);
  border-radius: 2px;
}

.section-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--point-soft);
  color: #7a5800;
}

/* ─── 오늘의 추천 캐러셀 ─────────────────── */
.featured-section {
  background: var(--bg-dark);
  padding-bottom: 20px;
}

.featured-section .section-header {
  padding-top: 16px;
}

.featured-section .section-title {
  color: var(--text-light);
}

.featured-carousel {
  display: flex;
  gap: 12px;
  padding: 0 16px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.featured-carousel::-webkit-scrollbar {
  display: none;
}

/* 추천 카드 */
.featured-card {
  flex-shrink: 0;
  width: 44vw;
  max-width: 180px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.fc-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8f8f8;
}

.fc-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.featured-card:hover .fc-img-wrap img {
  transform: scale(1.03);
}

.fc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--point);
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
}

.fc-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.fc-title {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fc-price {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--point-dark);
}

.fc-reason {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── 카테고리 필터 ────────────────────────── */
.controls-section {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  position: sticky;
  top: var(--header-h);
  z-index: 100;
}

.category-filters {
  display: flex;
  gap: 7px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

.category-button {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-sub);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.13s, background 0.13s, color 0.13s;
}

.category-button:hover {
  border-color: var(--point);
  color: var(--text-main);
}

.category-button.active {
  background: var(--point);
  border-color: var(--point);
  color: #111;
}

/* ─── 전체 상품 2열 그리드 ──────────────────── */
.allproducts-section {
  padding-bottom: 8px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 12px;
}

/* 일반 상품 카드 */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pc-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8f8f8;
  overflow: hidden;
}

.pc-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pc-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--point);
  color: #111;
  font-size: 0.65rem;
  font-weight: 700;
}

.pc-body {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pc-title {
  margin: 0 0 3px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-price {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--point-dark);
}

.pc-reason {
  margin: 0 0 6px;
  font-size: 0.74rem;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.tag {
  font-size: 0.66rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f0f0f0;
  color: var(--text-sub);
}

/* ─── CTA 버튼 ─────────────────────────────── */
.btn-cta {
  display: block;
  width: 100%;
  padding: 9px 0;
  margin-top: auto;
  border-radius: var(--radius-sm);
  background: var(--point);
  color: #111;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  transition: background 0.13s;
}

.btn-cta:hover {
  background: var(--point-dark);
}

/* ─── 기타 ─────────────────────────────────── */
.no-result {
  text-align: center;
  padding: 48px 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.carousel-empty {
  padding: 24px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── 파트너스 고지 ────────────────────────── */
.partners-notice {
  background: var(--bg-dark);
  border-top: 1px solid #2a2a2a;
  padding: 16px;
  text-align: center;
}

.partners-notice p {
  margin: 0;
  font-size: 0.75rem;
  color: #777;
  line-height: 1.6;
}

/* ─── 반응형: 태블릿 (640px~) ──────────────── */
@media (min-width: 640px) {
  .featured-card {
    width: 200px;
    max-width: 200px;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 16px;
  }
}

/* ─── 반응형: 데스크톱 (1024px~) ───────────── */
@media (min-width: 1024px) {
  .featured-section .section-header,
  .allproducts-section .section-header {
    padding-left: 24px;
  }

  .featured-carousel {
    padding: 0 24px 4px;
    gap: 16px;
  }

  .featured-card {
    width: 220px;
    max-width: 220px;
  }

  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 24px;
  }

  .category-filters {
    padding: 0 24px;
  }
}
