/* Astra의 사이드바/컨테이너 레이아웃 해제 */
body.yjs-archive .site-content > .ast-container { display: block; max-width: none; padding: 0; }
body.yjs-archive #primary { width: 100%; max-width: none; margin: 0; padding: 0; float: none; }
body.yjs-archive #secondary { display: none; }
body.yjs-archive .ast-woocommerce-container { padding: 0; }

.yjs {
	--blue: #1f6bff;
	--ink: #1a1a1a;
	--sub: #6b7280;
	--line: #e5e7eb;
	--bg: #f6f7f9;
	--red: #e5333d;
	max-width: 1240px;
	margin: 0 auto;
	padding: 18px 20px 90px;
	color: var(--ink);
	font-size: 15px;
	line-height: 1.55;
	letter-spacing: -0.01em;
}
.yjs *, .yjs *::before, .yjs *::after { box-sizing: border-box; }
.yjs a { text-decoration: none; color: inherit; }
.yjs ul { list-style: none; margin: 0; padding: 0; }
.yjs h1, .yjs h3, .yjs h4 { margin: 0; }
.yjs img { display: block; max-width: 100%; height: auto; }
/* 테마의 버튼 글자색(흰색)이 덮어쓰지 않도록 */
.yjs button { font-family: inherit; }
.yjs .yjs-filterbtn, .yjs .yjs-side__close, .yjs .yjs-view__btn { color: var(--ink); }
.yjs .yjs-view__btn:not(.is-active) { color: #9ca3af; }
.yjs .yjs-chip:not(.is-active) { color: #444; }
.yjs .yjs-cats__toggle { color: #9ca3af; }

.yjs-crumb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--sub); padding: 6px 0 4px; }
.yjs-crumb em { font-style: normal; color: var(--ink); }
.yjs-crumb a:hover { color: var(--blue); }

.yjs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 18px; }

/* ---------- 사이드 ---------- */
.yjs-side__head, .yjs-side__close { display: none; }
.yjs-title { font-size: 34px; font-weight: 800; line-height: 1.25; word-break: keep-all; }
.yjs-title--side { display: block; margin: 0 0 22px; }
.yjs-main > .yjs-title { display: none; margin: 4px 0 14px; }

.yjs-block { margin-bottom: 8px; }
.yjs-block > h3 { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.yjs-cats li { position: relative; border-bottom: 1px solid #eceef1; }
.yjs-cats a { display: flex; justify-content: space-between; align-items: center; padding: 11px 26px 11px 0; color: #444; font-size: 15px; }
.yjs-cats a em { font-style: normal; font-size: 12.5px; color: #9ca3af; }
.yjs-cats a:hover { color: var(--blue); }
.yjs-cats li.is-current > a { color: var(--blue); font-weight: 800; }
.yjs-cats__toggle { position: absolute; right: 0; top: 8px; width: 26px; height: 26px; border: 0; background: none; cursor: pointer; color: #9ca3af; }
.yjs-cats__toggle::before { content: "+"; font-size: 18px; line-height: 26px; }
.yjs-cats li.is-open > .yjs-cats__toggle::before { content: "\2212"; }
.yjs-cats--sub { display: none; padding-left: 12px; }
.yjs-cats li.is-open > .yjs-cats--sub { display: block; }

.yjs-filter { margin-top: 34px; }
.yjs-filter__head { display: flex; justify-content: space-between; align-items: center; border-top: 2px solid var(--ink); padding-top: 16px; margin-bottom: 16px; }
.yjs-filter__head h3 { font-size: 16px; font-weight: 800; }
.yjs-filter__reset { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--sub); }
.yjs-filter__reset.is-off { opacity: .4; pointer-events: none; }
.yjs-block--flt { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid #eceef1; }
.yjs-block--flt h4 { font-size: 14px; font-weight: 800; margin-bottom: 12px; }
.yjs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.yjs-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; color: #444; cursor: pointer; }
.yjs-chip:hover { border-color: var(--ink); }
.yjs-chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.yjs-range { display: flex; align-items: center; gap: 6px; }
.yjs-range input { flex: 1; min-width: 0; height: 38px; border: 1px solid #d6d8dc; border-radius: 8px; padding: 0 10px; font-size: 13.5px; background: #fff; }
.yjs-range span { color: var(--sub); }
.yjs-range__go { height: 38px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; padding: 0 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.yjs-check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14.5px; }
.yjs-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }

/* ---------- 툴바 ---------- */
.yjs-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg); border-radius: 14px; padding: 16px 22px; margin-bottom: 24px; }
.yjs-count { margin: 0; color: #4b5563; font-size: 14.5px; }
.yjs-count strong { color: var(--ink); }
.yjs-toolbar__right { display: flex; align-items: center; gap: 10px; }
.yjs-sort { height: 42px; border: 1px solid #d6d8dc; border-radius: 8px; padding: 0 34px 0 14px; font-size: 14px; background: #fff; min-width: 130px; }
.yjs-view { display: inline-flex; border: 1px solid #d6d8dc; border-radius: 8px; overflow: hidden; background: #fff; }
.yjs-view__btn { width: 42px; height: 40px; border: 0; background: #fff; color: #9ca3af; display: grid; place-items: center; cursor: pointer; padding: 0; }
.yjs-view__btn + .yjs-view__btn { border-left: 1px solid #d6d8dc; }
.yjs-view__btn.is-active { color: var(--ink); background: #f0f1f3; }
.yjs-filterbtn { display: none; }
.yjs-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); vertical-align: middle; }
.yjs-catchips { display: none; }

.yjs-active { display: flex; gap: 6px; flex-wrap: wrap; margin: -8px 0 18px; }
.yjs-active a { padding: 6px 12px; border-radius: 999px; background: #eef4ff; color: var(--blue); font-size: 13px; font-weight: 600; }

/* ---------- 상품 그리드 (데스크톱 4열 / 모바일 2열) ---------- */
.yjs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 22px; }
.yjs-card__link { display: block; }
.yjs-card__thumb { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #f4f5f7; border-radius: 6px; margin-bottom: 14px; }
.yjs-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.yjs-card__link:hover .yjs-card__thumb img { transform: scale(1.05); }
.yjs-card__soldout { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.7); font-weight: 800; color: #555; }
.yjs-card__cat { display: block; font-size: 13px; color: #8b93a1; margin-bottom: 3px; }
.yjs-card__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15.5px; font-weight: 500; line-height: 1.45; min-height: 45px; margin-bottom: 8px; word-break: keep-all; }
.yjs-card__link:hover .yjs-card__name { text-decoration: underline; text-underline-offset: 3px; }
.yjs-card__price { font-size: 17px; font-weight: 800; }
.yjs-card__rate { color: var(--red); font-weight: 800; font-size: 17px; margin-right: 4px; }
.yjs-card__reg { color: #9ca3af; font-size: 13px; margin-left: 4px; }

/* 리스트 보기 */
.yjs-grid.is-list { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
.yjs-grid.is-list .yjs-card { border-bottom: 1px solid var(--line); }
.yjs-grid.is-list .yjs-card__link { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 22px; align-items: center; padding: 18px 0; }
.yjs-grid.is-list .yjs-card__thumb { margin: 0; }
.yjs-grid.is-list .yjs-card__name { min-height: 0; font-size: 17px; }

/* 페이지네이션 */
body.yjs-archive .yjs .woocommerce-pagination { margin-top: 44px; }
body.yjs-archive .yjs .woocommerce-pagination ul.page-numbers { display: flex !important; justify-content: center; gap: 6px; flex-wrap: wrap; border: 0 !important; margin: 0; padding: 0; width: auto; }
body.yjs-archive .yjs .woocommerce-pagination ul.page-numbers li { display: block; float: none; width: auto; margin: 0 !important; padding: 0; border: 0 !important; }
body.yjs-archive .yjs .woocommerce-pagination .page-numbers:not(ul) { display: grid; place-items: center; width: auto; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: #444; background: #fff; line-height: 1; }
body.yjs-archive .yjs .woocommerce-pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
body.yjs-archive .yjs .woocommerce-pagination .page-numbers.dots { border-color: transparent; background: none; }
body.yjs-archive .yjs .woocommerce-pagination a.page-numbers:hover { border-color: var(--ink); }

.yjs-empty { display: grid; justify-items: center; gap: 12px; padding: 70px 0; text-align: center; color: #555; }
.yjs-empty p { margin: 0; }
.yjs-empty__ico { width: 54px; height: 54px; border-radius: 50%; background: #e5e7eb; color: #fff; font-size: 30px; font-weight: 800; display: grid; place-items: center; }
.yjs-btn { display: inline-block; padding: 11px 24px; border-radius: 999px; background: var(--ink); color: #fff !important; font-weight: 700; }

.yjs .woocommerce-message, .yjs .woocommerce-info, .yjs .woocommerce-error { margin-bottom: 18px; }

/* ---------- 태블릿/모바일 ---------- */
@media (max-width: 960px) {
	.yjs { padding: 10px 16px 70px; }
	.yjs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 8px; }
	.yjs-title { font-size: 26px; }
	.yjs-main > .yjs-title { display: block; }

	/* 카테고리 칩 + 필터 서랍 */
	.yjs-catchips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px 2px; }
	.yjs-catchips::-webkit-scrollbar { display: none; }
	.yjs-catchips a { flex: none; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: #444; background: #fff; }
	.yjs-catchips a.is-current { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }

	.yjs-side {
		position: fixed; z-index: 1200; top: 0; bottom: 0; left: 0; width: 88%; max-width: 360px; background: #fff;
		padding: 0 20px 30px; overflow-y: auto; transform: translateX(-102%); transition: transform .28s ease; box-shadow: 8px 0 30px rgba(0,0,0,.18);
	}
	.yjs-side.is-open { transform: none; }
	.yjs-side__head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: #fff; padding: 16px 0; margin-bottom: 6px; border-bottom: 1px solid var(--line); z-index: 1; }
	.yjs-side__head strong { font-size: 17px; }
	.yjs-side__close { display: block; border: 0; background: none; font-size: 30px; line-height: 1; cursor: pointer; padding: 0 4px; }
	.yjs-title--side { display: none; }
	.yjs-side .yjs-block:first-of-type { margin-top: 10px; }
	.yjs-filter { margin-top: 24px; }
	.yjs-overlay { position: fixed; inset: 0; z-index: 1150; background: rgba(0,0,0,.45); }
	.yjs-overlay[hidden] { display: none; }
	body.yjs-lock { overflow: hidden; }

	.yjs-toolbar { padding: 10px 12px; gap: 8px; border-radius: 12px; margin-bottom: 18px; flex-wrap: wrap; }
	.yjs-filterbtn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid #d6d8dc; border-radius: 8px; background: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
	.yjs-count { order: 3; flex: 1 0 100%; font-size: 13.5px; }
	.yjs-toolbar__right { margin-left: auto; }
	.yjs-sort { min-width: 0; height: 40px; }
	.yjs-view { display: none; }

	.yjs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
	.yjs-card__name { font-size: 14px; min-height: 41px; }
	.yjs-card__price, .yjs-card__rate { font-size: 15.5px; }
	.yjs-card__cat { font-size: 12px; }
}
@media (min-width: 961px) and (max-width: 1100px) {
	.yjs-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 28px; }
	.yjs-grid { gap: 32px 16px; }
}


/* ---------- 상품 상세: 연관상품 / 함께 보면 좋은 상품 (데스크톱 4열, 모바일 2열) ---------- */
section.related.products, section.up-sells.products {
	--blue: #1f6bff; --ink: #1a1a1a; --sub: #6b7280; --line: #e5e7eb; --red: #e5333d;
	clear: both; margin-top: 64px; color: var(--ink); letter-spacing: -0.01em;
}
section.related.products > h2, section.up-sells.products > h2 { font-size: 26px; font-weight: 800; margin: 0 0 24px; text-align: left; }
section.related.products ul.products, section.up-sells.products ul.products {
	display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 22px;
	list-style: none; margin: 0; padding: 0; width: 100%; float: none;
}
section.related.products ul.products::before, section.related.products ul.products::after,
section.up-sells.products ul.products::before, section.up-sells.products ul.products::after { content: none !important; display: none !important; }
section.related.products .yjs-card, section.up-sells.products .yjs-card { float: none; width: auto; margin: 0; padding: 0; list-style: none; text-align: left; }
section.related.products .yjs-card a, section.up-sells.products .yjs-card a { text-decoration: none; color: inherit; }
section.related.products .yjs-card img, section.up-sells.products .yjs-card img { display: block; max-width: 100%; height: auto; }
@media (max-width: 960px) {
	section.related.products, section.up-sells.products { margin-top: 44px; }
	section.related.products > h2, section.up-sells.products > h2 { font-size: 22px; margin-bottom: 18px; }
	section.related.products ul.products, section.up-sells.products ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
	section.related.products .yjs-card__name, section.up-sells.products .yjs-card__name { font-size: 14px; min-height: 41px; }
	section.related.products .yjs-card__price, section.up-sells.products .yjs-card__price,
	section.related.products .yjs-card__rate, section.up-sells.products .yjs-card__rate { font-size: 15.5px; }
	section.related.products .yjs-card__cat, section.up-sells.products .yjs-card__cat { font-size: 12px; }
}
