/**
 * Mobile chrome and the overlays — Mobile.dc.html.
 *
 * The tab bar, the sticky buy bar and quick view are rendered for every
 * viewport and hidden here above the breakpoint, rather than branched on a
 * server-side device guess: a cached page has to be right at every width.
 *
 * The variation pills sit here too, because the artboard that draws them is
 * this one.
 */

/* ---- bottom tab bar ---- */

.hp-tabbar {
	position: fixed;
	inset-block-end: 0;
	inset-inline: 0;
	z-index: var(--hp-z-sticky);
	display: none;
	background: var(--hp-surface);
	border-block-start: 1px solid var(--hp-border);
	padding-block-end: env(safe-area-inset-bottom);
}

.hp-tabbar__item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.1875rem;
	padding-block: var(--hp-space-2);
	color: var(--hp-text-muted);
	font-size: 0.6875rem;
	font-weight: 600;
}

.hp-tabbar__item.is-current {
	color: var(--hp-text);
}

.hp-tabbar__item .hp-icon {
	width: 1.375rem;
	height: 1.375rem;
}

/* ---- sticky buy bar ---- */

.hp-buybar {
	position: fixed;
	inset-block-end: 0;
	inset-inline: 0;
	z-index: var(--hp-z-overlay);
	display: none;
	align-items: center;
	gap: var(--hp-space-4);
	padding: var(--hp-space-3) var(--hp-space-4);
	padding-block-end: calc(var(--hp-space-3) + env(safe-area-inset-bottom));
	background: var(--hp-surface);
	border-block-start: 1px solid var(--hp-border);
	box-shadow: 0 -0.5rem 1.5rem rgb(17 17 17 / 0.08);
}

.hp-buybar__price {
	flex: none;
	font-size: var(--hp-text-md);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.hp-buybar__price del {
	font-size: var(--hp-text-sm);
	font-weight: 400;
	color: var(--hp-text-muted);
}

.hp-buybar__price ins {
	text-decoration: none;
}

.hp-buybar__submit {
	flex: 1;
}

/* When both are on screen the buy bar sits above the tab bar. */
@media (max-width: 64rem) {
	.hp-tabbar {
		display: flex;
	}

	.hp-buybar:not([hidden]) {
		display: flex;
		inset-block-end: calc(3.75rem + env(safe-area-inset-bottom));
	}

	/* Room for both, so nothing at the foot of the page is unreachable. */
	body {
		padding-block-end: 3.75rem;
	}

	.single-product body {
		padding-block-end: 8rem;
	}
}

/* ---- quick view ---- */

.hp-quickview-open {
	position: absolute;
	inset-block-end: var(--hp-space-3);
	inset-inline-end: var(--hp-space-3);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	background: var(--hp-surface);
	border: 1px solid var(--hp-border);
	border-radius: var(--hp-radius-pill);
	color: var(--hp-text);
	cursor: pointer;
	opacity: 0;
	transition: opacity var(--hp-duration-fast) var(--hp-ease),
		border-color var(--hp-duration-fast) var(--hp-ease);
}

.woocommerce ul.products li.product:hover .hp-quickview-open,
.hp-quickview-open:focus-visible {
	opacity: 1;
}

.hp-quickview-open:hover {
	border-color: var(--hp-text);
}

/* On touch there is no hover to reveal it, so it is simply always there. */
@media (hover: none) {
	.hp-quickview-open {
		opacity: 1;
	}
}

.hp-quickview-open .hp-icon--eye {
	width: 1.125rem;
	height: 1.125rem;
	background: currentColor;
	mask: var(--hp-icon-eye) center / contain no-repeat;
	-webkit-mask: var(--hp-icon-eye) center / contain no-repeat;
}

.hp-quickview {
	position: fixed;
	inset: 0;
	z-index: var(--hp-z-modal);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--hp-space-4);
}

.hp-quickview__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(13 13 13 / 0.45);
}

.hp-quickview__panel {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
	gap: var(--hp-space-6);
	width: min(46rem, 100%);
	max-height: 90vh;
	overflow-y: auto;
	padding: var(--hp-space-6);
	background: var(--hp-surface);
	border-radius: var(--hp-radius);
	box-shadow: var(--hp-shadow-md);
}

.hp-quickview__close {
	position: absolute;
	inset-block-start: var(--hp-space-3);
	inset-inline-end: var(--hp-space-3);
	z-index: 1;
}

.hp-quickview__body {
	display: contents;
}

.hp-quickview__media img {
	width: 100%;
	border-radius: var(--hp-radius);
	background: var(--hp-surface-subtle);
}

.hp-quickview__summary {
	display: flex;
	flex-direction: column;
	gap: var(--hp-space-4);
}

.hp-quickview__title {
	margin: 0;
	font-size: var(--hp-text-h3);
}

.hp-quickview__more {
	font-size: var(--hp-text-sm);
	font-weight: 600;
}

.hp-quickview__loading {
	grid-column: 1 / -1;
	padding-block: var(--hp-space-10);
	text-align: center;
	color: var(--hp-text-muted);
}

.hp-no-scroll {
	overflow: hidden;
}

@media (max-width: 45rem) {
	.hp-quickview__panel {
		grid-template-columns: 1fr;
		gap: var(--hp-space-4);
	}
}

/* ---- variation pills ----
 * The select stays in the form and stays focusable by its label; it is only
 * taken out of the visual flow, so it is still what submits and still what
 * WooCommerce's variation script reads and writes.
 */

.hp-swatch-cell select {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.hp-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hp-space-3);
}

.hp-swatch {
	padding: var(--hp-space-3) var(--hp-space-6);
	background: transparent;
	border: 1px solid var(--hp-border);
	border-radius: var(--hp-radius-pill);
	color: var(--hp-text-muted);
	font-family: var(--hp-font-ui);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: border-color var(--hp-duration-fast) var(--hp-ease),
		color var(--hp-duration-fast) var(--hp-ease);
}

.hp-swatch:hover {
	border-color: var(--hp-text);
	color: var(--hp-text);
}

.hp-swatch.is-selected {
	border: 2px solid var(--hp-brand);
	color: var(--hp-text);
	font-weight: 700;
}

.hp-swatch.is-unavailable {
	color: var(--hp-text-disabled);
	text-decoration: line-through;
	cursor: not-allowed;
}

.hp-swatch:focus-visible {
	outline: 2px solid var(--hp-focus);
	outline-offset: 2px;
}

/* ---- mobile product gallery dots ---- */

@media (max-width: 45rem) {
	.woocommerce div.product div.images .flex-control-thumbs {
		justify-content: center;
		gap: var(--hp-space-2);
	}

	.woocommerce div.product div.images .flex-control-thumbs li {
		width: 0.5rem;
	}

	.woocommerce div.product div.images .flex-control-thumbs img {
		width: 0.5rem;
		height: 0.5rem;
		border-radius: var(--hp-radius-pill);
		background: var(--hp-border-strong);
		border: none;
		text-indent: -999em;
	}

	.woocommerce div.product div.images .flex-control-thumbs img.flex-active {
		background: var(--hp-brand);
		border: none;
	}
}
