/* 코드줍 — 목업(docs/02-design/mockups) 기준 구현. 모바일 퍼스트. */

:root {
	--accent: #ff5a4e;
	--accent-soft: #fff1ef;
	--accent-dark: #e8412f;
	--text: #1a1a1e;
	--text-sub: #8a8a93;
	--bg: #fff;
	--bg-section: #f7f7f8;
	--border: #ededf0;

	--r-card: 12px;
	--r-btn: 8px;
	--r-chip: 999px;

	--wrap: 1200px;
	--gap: 16px;

	--font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
		system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
	word-break: keep-all; /* 한글 줄바꿈 — 단어 중간에서 끊기지 않게 */
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

h1,
h2,
h3 {
	margin: 0;
	line-height: 1.3;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.cj-wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 20px;
}

.cj-accent {
	color: var(--accent);
}

/* ---------- 헤더 ---------- */

.cj-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
}

.cj-header__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 60px;
}

.cj-logo-link {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -0.03em;
	margin-right: auto;
}

.cj-logo-mark {
	width: 28px;
	height: 28px;
	flex: none;
}

.cj-nav {
	display: none;
}

.cj-nav a {
	position: relative;
	padding: 20px 2px;
	font-size: 16px;
	font-weight: 600;
	color: var(--text);
}

.cj-nav .current-menu-item a,
.cj-nav a[aria-current='page'] {
	color: var(--accent);
}

.cj-nav .current-menu-item a::after,
.cj-nav a[aria-current='page']::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--accent);
}

.cj-header__icons {
	display: flex;
	align-items: center;
	gap: 4px;
}

.cj-icon-btn {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 0;
	background: none;
	cursor: pointer;
	color: var(--text);
}

/* 제휴 고지 — 법적 필수. 지우지 말 것. */
.cj-affiliate-notice {
	background: var(--bg-section);
	border-bottom: 1px solid var(--border);
	color: var(--text-sub);
	font-size: 12px;
	text-align: center;
	padding: 8px 20px;
}

/* ---------- 버튼 / 칩 ---------- */

.cj-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px 20px;
	border: 1px solid transparent;
	border-radius: var(--r-btn);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.cj-btn--primary {
	background: var(--accent);
	color: #fff;
}

.cj-btn--primary:hover {
	background: var(--accent-dark);
}

.cj-btn--ghost {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--accent);
}

.cj-btn--ghost:hover {
	background: var(--accent);
	color: #fff;
}

.cj-btn--block {
	width: 100%;
}

.cj-btn[disabled],
.cj-btn--muted {
	background: var(--bg-section);
	border-color: var(--border);
	color: var(--text-sub);
	cursor: default;
	pointer-events: none;
}

.cj-chip {
	display: inline-flex;
	align-items: center;
	padding: 8px 16px;
	border: 1px solid var(--border);
	border-radius: var(--r-chip);
	background: var(--bg);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.cj-chip--active {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--accent);
}

/* ---------- 히어로 ---------- */

.cj-hero {
	padding: 32px 0 28px;
	background: var(--bg);
}

.cj-hero h1 {
	font-size: 30px;
	margin-bottom: 8px;
}

.cj-hero__stats {
	color: var(--text-sub);
	font-size: 15px;
	margin: 0 0 20px;
}

.cj-hero__stats b {
	color: var(--accent);
	font-weight: 700;
}

.cj-search {
	display: flex;
	gap: 8px;
	border: 1.5px solid var(--accent);
	border-radius: var(--r-btn);
	padding: 4px 4px 4px 16px;
	background: var(--bg);
}

.cj-search input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	font-family: inherit;
	font-size: 15px;
	background: transparent;
}

.cj-search button {
	flex: none;
	width: 44px;
	height: 40px;
	border: 0;
	border-radius: 6px;
	background: var(--accent);
	color: #fff;
	cursor: pointer;
}

.cj-quick-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

/* ---------- 섹션 ---------- */

.cj-section {
	padding: 32px 0;
}

.cj-section--tinted {
	background: var(--bg-section);
}

.cj-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 16px;
}

.cj-section__head h2 {
	font-size: 22px;
}

.cj-section__more {
	font-size: 14px;
	color: var(--text-sub);
	font-weight: 600;
}

/* ---------- 카드 공통 ---------- */

.cj-card {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	padding: 16px;
}

.cj-grid {
	display: grid;
	gap: var(--gap);
	grid-template-columns: 1fr;
}

.cj-logo {
	width: 72px;
	height: 72px;
	flex: none;
	object-fit: contain;
	background: var(--bg-section);
	border-radius: 8px;
}

.cj-logo--text {
	display: grid;
	place-items: center;
	font-size: 13px;
	font-weight: 800;
	color: var(--text);
	text-align: center;
	padding: 4px;
	line-height: 1.1;
}

/* ---------- 인기 할인코드 카드 ---------- */

.cj-promo-mini {
	display: flex;
	align-items: center;
	gap: 14px;
}

.cj-promo-mini__body {
	flex: 1;
	min-width: 0;
}

.cj-promo-mini__brand {
	font-size: 13px;
	color: var(--text-sub);
}

.cj-promo-mini__title {
	font-size: 16px;
	font-weight: 700;
	margin: 2px 0 4px;
}

.cj-promo-mini__used {
	font-size: 13px;
	color: var(--text-sub);
}

/* ---------- 할인코드 카드 (브랜드 상세) ---------- */

.cj-promo {
	display: grid;
	gap: 12px;
	margin-bottom: 12px;
}

.cj-promo__main {
	display: flex;
	gap: 14px;
}

.cj-promo__body {
	flex: 1;
	min-width: 0;
}

.cj-promo__title {
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 6px;
}

.cj-promo__conditions {
	margin: 0;
	padding-left: 16px;
	font-size: 14px;
	color: var(--text-sub);
}

.cj-promo__conditions li {
	margin-bottom: 2px;
}

.cj-usage {
	display: inline-flex;
	gap: 6px;
	margin-top: 8px;
	font-size: 13px;
	color: var(--text-sub);
}

.cj-promo--expired {
	opacity: 0.55;
}

.cj-promo__badge {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 8px;
	border-radius: var(--r-chip);
	background: var(--bg-section);
	color: var(--text-sub);
	font-size: 12px;
	font-weight: 600;
	vertical-align: middle;
}

/* ---------- 브랜드 상세 ---------- */

.cj-breadcrumb {
	font-size: 13px;
	color: var(--text-sub);
	padding: 14px 0;
}

.cj-breadcrumb a:hover {
	color: var(--text);
}

.cj-brand__cover {
	border-radius: var(--r-card);
	overflow: hidden;
	margin-bottom: 20px;
}

.cj-brand h1 {
	font-size: 26px;
	margin-bottom: 6px;
}

.cj-brand__updated {
	font-size: 14px;
	color: var(--text-sub);
	margin-bottom: 20px;
}

.cj-toc {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--r-card);
	padding: 16px;
	margin-bottom: 24px;
}

.cj-toc__title {
	font-weight: 700;
	margin-bottom: 8px;
}

.cj-toc ol {
	margin: 0;
	padding-left: 20px;
	font-size: 15px;
}

.cj-side {
	display: grid;
	gap: 16px;
	margin-top: 28px;
}

.cj-side__card h3 {
	font-size: 17px;
	margin-bottom: 12px;
}

.cj-side__row {
	display: flex;
	justify-content: space-between;
	padding: 7px 0;
	font-size: 14px;
	border-bottom: 1px solid var(--border);
}

.cj-side__row:last-child {
	border-bottom: 0;
}

.cj-side__row b {
	color: var(--accent);
}

/* ---------- 카테고리 타일 ---------- */

.cj-cat-tiles {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
}

.cj-cat-tile {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px;
	border-radius: var(--r-card);
	background: var(--accent-soft);
	font-weight: 700;
}

.cj-cat-tile__arrow {
	margin-left: auto;
	color: var(--text-sub);
}

/* ---------- 브랜드 그리드 ---------- */

.cj-brand-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.cj-brand-item {
	display: flex;
	align-items: center;
	gap: 14px;
}

.cj-brand-item__name {
	font-weight: 700;
}

.cj-brand-item__count {
	font-size: 14px;
	color: var(--text-sub);
}

.cj-brand-item__arrow {
	margin-left: auto;
	color: var(--text-sub);
}

/* ---------- 필터 사이드바 ---------- */

.cj-filter {
	display: none;
}

.cj-cat-tabs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 4px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.cj-cat-tabs::-webkit-scrollbar {
	display: none;
}

/* ---------- 모달 ---------- */

body.cj-modal-open {
	overflow: hidden;
}

.cj-modal[hidden] {
	display: none;
}

.cj-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: grid;
	place-items: center;
	padding: 20px;
}

.cj-modal__dim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.cj-modal__card {
	position: relative;
	width: 100%;
	max-width: 400px;
	background: #fff;
	border-radius: 16px;
	padding: 28px 24px 24px;
	text-align: center;
}

.cj-modal__x {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	border: 0;
	background: none;
	font-size: 24px;
	line-height: 1;
	color: var(--text-sub);
	cursor: pointer;
}

.cj-modal__brand {
	font-size: 14px;
	color: var(--text-sub);
	margin-bottom: 6px;
}

.cj-modal__title {
	font-size: 20px;
	margin-bottom: 6px;
}

.cj-modal__lead {
	font-size: 14px;
	color: var(--text-sub);
	margin: 0 0 16px;
}

.cj-modal__code {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px;
	border: 1.5px dashed var(--accent);
	border-radius: 10px;
	background: var(--accent-soft);
}

.cj-modal__code-text {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: 0.04em;
	color: var(--accent);
}

.cj-modal__copy {
	width: 28px;
	height: 28px;
	border: 0;
	background: none;
	cursor: pointer;
	color: var(--text-sub);
}

.cj-modal__copy::before {
	content: '⧉';
	font-size: 18px;
}

.cj-modal__copied {
	font-size: 14px;
	font-weight: 600;
	color: #12a150;
	margin: 12px 0 4px;
}

.cj-modal__hint {
	font-size: 13px;
	color: var(--text-sub);
	margin: 0 0 16px;
}

.cj-modal__go {
	display: block;
	width: 100%;
	padding: 14px;
	border-radius: var(--r-btn);
	background: var(--accent);
	color: #fff;
	font-weight: 700;
}

/* ---------- 푸터 ---------- */

.cj-footer {
	margin-top: 48px;
	padding: 28px 0 40px;
	border-top: 1px solid var(--border);
	background: var(--bg-section);
	font-size: 13px;
	color: var(--text-sub);
}

.cj-footer a {
	margin-right: 14px;
}

/* =======================================================================
   태블릿 이상
   ======================================================================= */

@media (min-width: 768px) {
	.cj-hero {
		padding: 56px 0 44px;
		text-align: center;
	}

	.cj-hero h1 {
		font-size: 42px;
	}

	.cj-hero__inner {
		max-width: 760px;
		margin: 0 auto;
	}

	.cj-quick-chips {
		justify-content: center;
	}

	.cj-search {
		padding: 6px 6px 6px 20px;
	}

	.cj-search button {
		height: 46px;
	}

	.cj-grid--3 {
		grid-template-columns: repeat(3, 1fr);
	}

	.cj-cat-tiles {
		grid-template-columns: repeat(3, 1fr);
	}

	.cj-brand-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.cj-brand-item {
		flex-direction: column;
		text-align: center;
	}

	.cj-brand-item__arrow {
		display: none;
	}

	.cj-promo__main {
		align-items: center;
	}

	.cj-promo {
		grid-template-columns: 1fr auto;
		align-items: center;
	}

	.cj-promo .cj-btn {
		width: auto;
		min-width: 180px;
	}

	.cj-brand h1 {
		font-size: 34px;
	}
}

/* =======================================================================
   데스크톱
   ======================================================================= */

@media (min-width: 1024px) {
	.cj-header__inner {
		height: 72px;
	}

	.cj-nav {
		display: flex;
		gap: 28px;
		margin: 0 auto;
	}

	.cj-header__icons .cj-menu-toggle {
		display: none;
	}

	.cj-cat-tiles {
		grid-template-columns: repeat(5, 1fr);
	}

	.cj-brand-grid--6 {
		grid-template-columns: repeat(6, 1fr);
	}

	/* 본문 + 사이드바 2단 */
	.cj-layout {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: 32px;
		align-items: start;
	}

	.cj-side {
		margin-top: 0;
		position: sticky;
		top: 96px;
	}

	/* 필터 사이드바 + 본문 */
	.cj-layout--filter {
		grid-template-columns: 260px minmax(0, 1fr);
	}

	.cj-filter {
		display: block;
	}

	.cj-cat-tabs {
		display: none;
	}

	.cj-toc ol {
		columns: 2;
	}
}

@media (min-width: 1200px) {
	.cj-hero h1 {
		font-size: 48px;
	}
}

/* 접근성 — 모션 최소화 */
@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
