/*
 * HANIWA Store Enhancements — front end.
 *
 * Every rule is scoped to a .hse- class. No element, tag or utility selectors
 * that could reach theme or WooCommerce markup. Typography inherits from the
 * theme so the brand face is used throughout; only size, spacing and tracking
 * are set here.
 */

:root {
	--hse-ink: #1a1a1a;
	--hse-ink-soft: #6f6f6f;
	--hse-rule: rgba(26, 26, 26, 0.14);
	--hse-surface: #ffffff;
	--hse-backdrop: rgba(20, 20, 20, 0.46);
	--hse-z: 2147482000;
}

/* ------------------------------------------------------------------
 * Product purchase area — delivery + returns link
 * --------------------------------------------------------------- */

.hse-product-info {
	margin: 22px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--hse-rule);
	font-family: inherit;
}

.hse-product-info__delivery {
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.6;
	letter-spacing: 0.01em;
	color: var(--hse-ink-soft);
}

.hse-size-guide {
	margin: 14px 0 4px;
}

/* Shared trigger button. A button, styled as editorial text. */
.hse-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	font-family: inherit;
	font-size: 12px;
	line-height: 1.5;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hse-ink);
	cursor: pointer;
	text-decoration: none;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 0;
	min-height: 44px; /* comfortable tap target without a visible box */
}

.hse-trigger:hover .hse-trigger__label,
.hse-trigger:focus-visible .hse-trigger__label {
	border-bottom-color: var(--hse-ink);
}

.hse-trigger__label {
	border-bottom: 1px solid var(--hse-rule);
	padding-bottom: 2px;
	transition: border-color 150ms ease;
}

.hse-trigger__arrow {
	font-size: 12px;
	line-height: 1;
}

.hse-trigger:focus {
	outline: none;
}

.hse-trigger:focus-visible {
	outline: 2px solid var(--hse-ink);
	outline-offset: 4px;
}

/* The size guide sits with the purchase controls, so it reads as an action. */
.hse-trigger--size .hse-trigger__label {
	border-bottom-color: var(--hse-ink);
}

/* The policy link is secondary information, so it stays quieter until hover. */
.hse-trigger--link {
	color: var(--hse-ink-soft);
	letter-spacing: 0.06em;
	text-transform: none;
	font-size: 13px;
	min-height: 36px;
}

.hse-trigger--link:hover,
.hse-trigger--link:focus-visible {
	color: var(--hse-ink);
}

/* ------------------------------------------------------------------
 * Modal
 * --------------------------------------------------------------- */

.hse-modal[hidden] {
	display: none !important;
}

.hse-modal {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: var(--hse-z);
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 24px;
	padding: calc(24px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
	font-family: inherit;
	-webkit-font-smoothing: inherit;
}

.hse-modal__backdrop {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: var(--hse-backdrop);
	-webkit-backdrop-filter: saturate(100%) blur(1px);
	backdrop-filter: saturate(100%) blur(1px);
}

.hse-modal__dialog {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 100%;
	max-width: 540px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	display: flex;
	flex-direction: column;
	background: var(--hse-surface);
	color: var(--hse-ink);
	border-radius: 0;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
	outline: none;
	overflow: hidden;
}

.hse-modal__dialog:focus-visible {
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18), 0 0 0 2px var(--hse-ink);
}

.hse-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 26px 28px 14px;
	border-bottom: 1px solid var(--hse-rule);
	flex: 0 0 auto;
}

.hse-modal__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hse-ink);
}

.hse-modal__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: -10px -12px 0 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--hse-ink);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 0;
}

.hse-modal__close:focus {
	outline: none;
}

.hse-modal__close:focus-visible {
	outline: 2px solid var(--hse-ink);
	outline-offset: -2px;
}

.hse-modal__body {
	flex: 1 1 auto;
	padding: 20px 28px 28px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	font-size: 14px;
	line-height: 1.75;
	color: var(--hse-ink);
}

.hse-modal__body p {
	margin: 0 0 1em;
}

.hse-modal__body p:last-child {
	margin-bottom: 0;
}

.hse-modal__body ul,
.hse-modal__body ol {
	margin: 0 0 1em;
	padding-left: 1.2em;
}

.hse-modal__body li {
	margin: 0 0 0.35em;
}

.hse-modal__body a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Size charts are usually tables; keep them readable and scrollable. */
.hse-modal__body table {
	width: 100%;
	margin: 0 0 1em;
	border-collapse: collapse;
	font-size: 13px;
}

.hse-modal__body table th,
.hse-modal__body table td {
	padding: 8px 10px;
	border: 1px solid var(--hse-rule);
	text-align: left;
	white-space: nowrap;
}

.hse-modal__body table th {
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	font-size: 11px;
}

.hse-modal__body img {
	max-width: 100%;
	height: auto;
}

@media (max-width: 600px) {
	.hse-modal {
		padding: 12px;
		padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
		align-items: flex-end;
	}

	.hse-modal__dialog {
		max-width: 100%;
		max-height: calc(100vh - 24px);
		max-height: calc(100dvh - 24px);
	}

	.hse-modal__head {
		padding: 20px 18px 12px;
	}

	.hse-modal__body {
		padding: 16px 18px 22px;
	}
}

/* Scroll lock. Position-fixed body preserves the scroll offset, which is
   restored in JavaScript on close. */
html.hse-scroll-locked {
	overflow: hidden;
}

body.hse-scroll-locked {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
	overflow: hidden;
	overscroll-behavior: none;
}

@media (prefers-reduced-motion: reduce) {
	.hse-trigger__label {
		transition: none;
	}
}

/* ------------------------------------------------------------------
 * Shop category navigation
 * --------------------------------------------------------------- */

.hse-catnav {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0 0 28px;
	font-family: inherit;
}

.hse-catnav__list {
	display: flex;
	align-items: center;
	gap: 26px;
	margin: 0;
	padding: 0 0 10px;
	list-style: none;
	border-bottom: 1px solid var(--hse-rule);
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	scroll-snap-type: x proximity;
}

.hse-catnav__list::-webkit-scrollbar {
	display: none;
}

.hse-catnav__item {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
}

.hse-catnav__item::before,
.hse-catnav__item::marker {
	content: none;
}

.hse-catnav__link {
	display: inline-block;
	padding: 4px 0;
	border-bottom: 1px solid transparent;
	font-size: 12px;
	line-height: 1.4;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--hse-ink-soft);
	text-decoration: none;
	box-shadow: none;
	transition: color 150ms ease;
}

.hse-catnav__link:hover,
.hse-catnav__link:focus {
	color: var(--hse-ink);
	text-decoration: none;
}

.hse-catnav__link:focus-visible {
	outline: 2px solid var(--hse-ink);
	outline-offset: 3px;
}

.hse-catnav__link.is-current {
	color: var(--hse-ink);
	border-bottom-color: var(--hse-ink);
}

.hse-catnav__link.is-ancestor {
	color: var(--hse-ink);
}

@media (max-width: 782px) {
	.hse-catnav {
		margin-bottom: 22px;
	}

	.hse-catnav__list {
		gap: 20px;
	}

	.hse-catnav__link {
		font-size: 11px;
		letter-spacing: 0.09em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hse-catnav__link {
		transition: none;
	}
}
