/* Shared storefront header, homepage banner, and category navigation. */
.header-main {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 50px;
	min-height: 131px;
	position: relative;
}

.header-main .brand {
	width: 100px;
	transform: translateY(16px);
}

.header-search {
	display: flex;
	width: min(590px, 50vw);
	height: 45px;
	padding-left: 16px;
	border: 2px solid var(--green);
	border-radius: 25px;
	transform: translateY(16px);
}

.header-search input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline-offset: -2px;
	background: transparent;
	font: inherit;
	font-size: 16px;
}

.header-search button {
	width: 46px;
	border: 0;
	background: transparent;
	font-size: 29px;
	line-height: 1;
	cursor: pointer;
}

/* Match the original store's social shortcut in the desktop header. */
.header-instagram {
	position: absolute;
	top: 70px;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
}

.header-instagram img {
	display: block;
	max-width: 100%;
	max-height: 100%;
}

.header-stage {
	color: var(--muted);
	font-size: 12px;
	white-space: nowrap;
}

.header-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	position: absolute;
	top: 15px;
	right: 0;
	font-size: 13px;
	white-space: nowrap;
}

.header-actions a,
.header-actions button {
	color: var(--ink);
	text-decoration: none;
}

.header-actions form {
	margin: 0;
}

.header-actions button {
	padding: 0;
	border: 0;
	background: transparent;
	font: inherit;
	cursor: pointer;
}

.header-actions a:hover,
.header-actions button:hover {
	color: var(--green);
}

.header-member {
	max-width: 90px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.header-nav-wrap {
	border-top: 1px solid var(--line);
	border-bottom: 8px solid #f8f8f8;
}

.header-nav {
	display: flex;
	align-items: center;
	min-height: 60px;
	gap: 30px;
}

.header-nav .top-nav {
	/* 원본처럼 카테고리 링크를 오른쪽에 모아 배치한다. */
	flex: 0 1 auto;
	margin-left: auto;
	align-items: center;
	justify-content: flex-end;
	gap: 32px;
	font-size: 15px;
}

.header-nav .top-nav a {
	white-space: nowrap;
}

.all-categories {
	position: relative;
	flex: none;
	z-index: 10;
}

.all-categories summary {
	list-style: none;
	padding: 17px 12px 17px 0;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}

.all-categories summary::-webkit-details-marker {
	display: none;
}

.category-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(150px, 1fr));
	gap: 24px;
	width: min(1000px, calc(100vw - 40px));
	max-height: 70vh;
	overflow: auto;
	padding: 30px;
	border: 1px solid var(--line);
	background: #fff;
	box-shadow: 0 20px 40px rgb(0 0 0 / 12%);
}

.category-group {
	display: flex;
	flex-direction: column;
	gap: 9px;
	font-size: 13px;
	line-height: 1.4;
}

.category-group-title {
	margin-bottom: 6px;
	font-size: 15px;
	font-weight: 700;
}

.category-group a:hover {
	color: var(--green);
}

/* The source storefront uses a separate compact header and slide menu on phones. */
.mobile-site-header {
	display: none;
}

.mobile-bottom-nav {
	display: none;
}

@media (max-width: 768px) {
	/* Keep content clear of the fixed navigation and phone safe area. */
	body {
		padding-bottom: calc(62px + env(safe-area-inset-bottom));
	}

	.mobile-bottom-nav {
		position: fixed;
		z-index: 40;
		right: 0;
		bottom: 0;
		left: 0;
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		min-height: 62px;
		padding-bottom: env(safe-area-inset-bottom);
		border-top: 1px solid #e5e5e5;
		background: #fff;
		box-shadow: 0 -2px 10px rgb(0 0 0 / 5%);
	}

	.mobile-bottom-nav a,
	.mobile-bottom-nav button {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-height: 62px;
		padding: 5px 0;
		border: 0;
		background: transparent;
		color: #171717;
		font: inherit;
		font-size: 10px;
		font-weight: 600;
		line-height: 1;
		text-decoration: none;
		cursor: pointer;
	}

	.mobile-bottom-nav svg {
		width: 23px;
		height: 23px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.6;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.site-header {
		display: none;
	}

	.mobile-site-header {
		position: relative;
		z-index: 30;
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		align-items: center;
		height: 60px;
		border-bottom: 1px solid var(--line);
		background: #fff;
	}

	.mobile-menu {
		justify-self: start;
	}

	.mobile-menu > summary {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 52px;
		height: 59px;
		cursor: pointer;
		list-style: none;
	}

	.mobile-menu > summary::-webkit-details-marker,
	.mobile-category-group > summary::-webkit-details-marker {
		display: none;
	}

	.mobile-menu > summary img {
		width: 24px;
		height: 24px;
		object-fit: contain;
	}

	.mobile-brand {
		justify-self: center;
		display: flex;
		align-items: center;
		height: 45px;
	}

	.mobile-brand img {
		display: block;
		width: auto;
		height: 34px;
	}

	.mobile-actions {
		justify-self: end;
		display: flex;
		align-items: center;
		gap: 2px;
		padding-right: 10px;
	}

	.mobile-actions a {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 37px;
		height: 42px;
	}

	.mobile-actions img {
		width: 23px;
		height: 23px;
		object-fit: contain;
	}

	/* Native details keep the category menu usable without a script dependency. */
	.mobile-menu-panel {
		position: fixed;
		top: 60px;
		left: 0;
		width: min(88vw, 360px);
		max-height: calc(100vh - 122px);
		overflow-y: auto;
		border-right: 1px solid var(--line);
		border-bottom: 1px solid var(--line);
		background: #fff;
		box-shadow: 12px 15px 28px rgb(0 0 0 / 15%);
	}

	.mobile-account {
		padding: 22px 20px;
		background: #f5f7f4;
	}

	.mobile-account-name {
		display: block;
		margin-bottom: 17px;
		font-size: 17px;
		font-weight: 700;
	}

	.mobile-account-links {
		display: flex;
		flex-wrap: wrap;
		gap: 10px 16px;
		font-size: 13px;
	}

	.mobile-account form {
		margin: 16px 0 0;
	}

	.mobile-account button {
		padding: 0;
		border: 0;
		background: transparent;
		color: var(--muted);
		font: inherit;
		font-size: 13px;
		cursor: pointer;
	}

	.mobile-category-nav {
		display: block;
		padding: 9px 0 20px;
	}

	.mobile-category-link,
	.mobile-category-group > summary {
		display: block;
		width: 100%;
		padding: 15px 20px;
		border-bottom: 1px solid #eef0ec;
		font-size: 15px;
		font-weight: 650;
		line-height: 1.35;
	}

	.mobile-category-group > summary {
		position: relative;
		padding-right: 48px;
		cursor: pointer;
		list-style: none;
	}

	.mobile-category-group > summary::after {
		position: absolute;
		right: 22px;
		content: '+';
		color: var(--muted);
	}

	.mobile-category-group[open] > summary::after {
		content: '−';
	}

	.mobile-category-children {
		display: flex;
		flex-direction: column;
		gap: 0;
		padding: 6px 0;
		background: #fafbf9;
	}

	.mobile-category-children a {
		padding: 10px 28px;
		font-size: 14px;
		line-height: 1.35;
	}

	.mobile-category-children a:hover,
	.mobile-category-link:hover {
		color: var(--green);
	}
}

/* The original banners have separate desktop and mobile image files. */
.home-visual {
	position: relative;
	width: 100%;
	height: 300px;
	background: #eef1ed;
}

.home-visual-slide {
	position: absolute;
	inset: 0;
	display: none;
}

.home-visual-slide.is-active {
	display: block;
}

.home-visual-slide a,
.home-visual-slide picture,
.home-visual-slide img {
	display: block;
	width: 100%;
	height: 100%;
}

.home-visual-slide img {
	object-fit: cover;
	object-position: center;
}

.home-visual-controls {
	position: absolute;
	right: auto;
	bottom: 30px;
	left: 6%;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 11px;
	width: 300px;
	padding: 3px 15px;
	border-radius: 20px;
	color: #fff;
	background: rgb(0 0 0 / 32%);
	font-size: 14px;
	pointer-events: none;
}

.home-visual-controls button {
	width: 32px;
	height: 32px;
	border: 1px solid #fff;
	border-radius: 50%;
	color: #fff;
	background: rgb(0 0 0 / 20%);
	font-size: 24px;
	line-height: 0;
	cursor: pointer;
	pointer-events: auto;
}

.home-icon-menu {
	border-bottom: 1px solid var(--line);
	background: #f0f0f0;
}

.home-icon-grid {
	display: grid;
	grid-template-columns: repeat(10, minmax(0, 1fr));
	gap: 14px;
	padding-top: 24px;
	padding-bottom: 24px;
}

.home-icon-grid a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	text-align: center;
	font-size: 13px;
	white-space: nowrap;
}

.home-icon-grid img {
	width: 70px;
	height: 70px;
	object-fit: contain;
}

.home-icon-grid a:hover {
	color: var(--green);
}

.home-recommendations .product-grid {
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 24px 15px;
}

.more-link {
	font-size: 14px;
	font-weight: 600;
}

.more-link:hover {
	color: var(--green);
}

.category-best {
	margin-bottom: 70px;
	padding-bottom: 55px;
	border-bottom: 1px solid var(--line);
}

.category-best .product-grid {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.search-form {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 24px;
}

.search-form label {
	font-weight: 600;
}

.search-form input {
	flex: 1;
	min-width: 0;
	max-width: 440px;
	min-height: 40px;
	padding: 8px 12px;
	border: 1px solid var(--line);
	font: inherit;
}

.search-form button {
	min-height: 40px;
	padding: 8px 20px;
	border: 0;
	color: #fff;
	background: var(--green);
	font: inherit;
	cursor: pointer;
}

@media (max-width: 950px) {
	.header-nav .top-nav {
		flex-wrap: nowrap;
		overflow-x: auto;
		justify-content: flex-start;
		gap: 20px;
		scrollbar-width: none;
	}

	.header-nav .top-nav::-webkit-scrollbar {
		display: none;
	}

	.home-icon-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.home-recommendations .product-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.category-best .product-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.home-visual {
		height: auto;
		aspect-ratio: 4 / 3;
	}

	.home-visual-controls {
		bottom: 10px;
		left: 12px;
		width: auto;
	}

	.home-icon-grid {
		/* 원본 모바일 메뉴는 다섯 아이콘씩 한 줄에서 옆으로 이동한다. */
		display: flex;
		gap: 0;
		overflow-x: auto;
		padding: 10px 0 8px;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}

	.home-icon-grid::-webkit-scrollbar {
		display: none;
	}

	.home-icon-grid img {
		width: 42px;
		height: 42px;
	}

	.home-icon-grid a {
		flex: 0 0 20%;
		min-width: 0;
		gap: 4px;
		font-size: 11px;
		scroll-snap-align: start;
		white-space: nowrap;
	}

	.home-recommendations .product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.category-best .product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.search-form {
		flex-wrap: wrap;
	}

	.search-form label {
		width: 100%;
	}
}
