/* HamzaBG Mods shared interface layer.
 *
 * Two things the browser would otherwise draw itself: the confirmation dialog
 * for destructive actions, and the validation bubble on a rejected field. Both
 * are replaced with controls built from the theme's own values — the 12px
 * button system from hbg-ui, the 8px input radius, the #e3e3e3 rule, the
 * #6571ff accent — so a prompt here looks like it was made by whoever made
 * the product page.
 *
 * Loaded by the storefront application pages and the back office. The static
 * exported pages do not need it: they have no forms that submit.
 */

/* ------------------------------------------------------------------- modal */

html.hbg-modal-open {
	overflow: hidden;
}

.hbg-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

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

.hbg-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 22, 26, 0.58);
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	animation: hbg-fade-in 0.16s ease-out;
}

.hbg-modal__panel {
	position: relative;
	width: 100%;
	max-width: 460px;
	margin: 0;
	padding: 34px 36px 30px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 30px 80px rgba(16, 18, 22, 0.35);
	animation: hbg-rise-in 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.hbg-modal__title {
	margin: 0 0 12px;
	font-size: 21px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: #2b2b2b;
}

.hbg-modal__body {
	margin: 0 0 28px;
	font-size: 14.5px;
	line-height: 1.7;
	color: #4c4f57;
	text-wrap: pretty;
}

.hbg-modal__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
}

.hbg-modal .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0 18px;
	min-height: 44px;
	border: 1px solid var(--hb-line-strong);
	border-radius: var(--hb-btn-radius);
	background-color: var(--hb-card);
	color: var(--hb-ink);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(16, 18, 24, 0.04);
	transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.18s ease,
		background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, filter 0.18s ease;
}

.hbg-modal .button:hover,
.hbg-modal .button:focus-visible {
	transform: translateY(-1px);
	background-color: var(--hb-soft);
	border-color: color-mix(in srgb, var(--hb-ink) 22%, var(--hb-line-strong));
	color: var(--hb-ink);
	box-shadow: 0 2px 6px rgba(16, 18, 24, 0.06), 0 10px 20px -16px rgba(16, 18, 24, 0.4);
}

.hbg-modal .button.alt {
	border-color: transparent;
	background-color: var(--hb-btn-primary);
	background-image: linear-gradient(180deg, var(--hb-btn-primary-hi), var(--hb-btn-primary) 55%, var(--hb-btn-primary-lo));
	color: var(--hb-btn-primary-ink);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(33, 38, 120, 0.18),
		0 1px 2px rgba(16, 18, 24, 0.1), 0 8px 18px -10px rgba(101, 113, 255, 0.65);
}

.hbg-modal .button.alt:hover,
.hbg-modal .button.alt:focus-visible {
	transform: translateY(-1px);
	background-color: var(--hb-btn-primary);
	color: var(--hb-btn-primary-ink);
	filter: saturate(1.06) brightness(1.03);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -1px 0 rgba(33, 38, 120, 0.18),
		0 3px 6px rgba(16, 18, 24, 0.12), 0 14px 26px -12px rgba(101, 113, 255, 0.75);
}

.hbg-modal .button:focus-visible {
	outline: 2px solid var(--hb-accent);
	outline-offset: 2px;
}

@keyframes hbg-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes hbg-rise-in {
	from { opacity: 0; transform: translateY(10px) scale(0.985); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hbg-modal__backdrop,
	.hbg-modal__panel {
		animation: none;
	}
}

@media (max-width: 520px) {
	.hbg-modal__panel {
		padding: 26px 22px 22px;
	}

	.hbg-modal__actions {
		justify-content: stretch;
	}

	.hbg-modal .button {
		flex: 1 1 auto;
	}
}

/* -------------------------------------------------------------- validation */

.hbg-field-error {
	display: block;
	margin: 2px 0 12px;
	color: #b32d2e;
	font-size: 13px;
	font-style: normal;
	line-height: 1.5;
}

.hbg-invalid,
.woocommerce .hbg-invalid,
.admin .hbg-invalid {
	border-color: #6571ff !important;
	box-shadow: 0 0 0 1px rgba(101, 113, 255, 0.3) !important;
}

.hbg-invalid:focus {
	outline-color: #6571ff;
}

/* ------------------------------------------------------------------- select */

/*
 * A native select keeps the platform's own chrome: the OS arrow, the OS
 * dropdown panel. The control itself is restyled to the theme's input shape so
 * it sits with the text fields; the option list stays native because every
 * custom listbox on the web is worse than the one the operating system draws.
 */
select.input-text,
.woocommerce select,
.admin select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 44px;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238d8d8d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 18px center;
	background-size: 12px 8px;
	background-color: #fff;
	cursor: pointer;
}

select.input-text:focus,
.woocommerce select:focus,
.admin select:focus {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%232b2b2b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

select.input-text::-ms-expand,
.woocommerce select::-ms-expand {
	display: none;
}

select[multiple],
select[size]:not([size="1"]) {
	padding-right: 20px;
	background-image: none;
}

/* -------------------------------------------------------- native decorations */

/*
 * Two more pieces of platform chrome that appear inside otherwise themed
 * controls: the spinner pair on a number input and the clear button on a
 * search input. Both are removed; keyboard arrows and the Escape key still
 * change and clear the value, so nothing is lost but the operating system's
 * drawing.
 */

input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
	-webkit-appearance: none;
	appearance: none;
}

/* Chrome's autofill wash replaces the theme's input background. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
	-webkit-text-fill-color: #2b2b2b;
	-webkit-box-shadow: 0 0 0 1000px #fff inset;
	transition: background-color 5000s ease-in-out 0s;
}

/* ------------------------------------------------- legacy product loop grid
 *
 * The theme lays the WooCommerce loop out with floats and a
 * `li.product:nth-child(2n){float:right}` rule meant for the two-up mobile
 * layout. That rule is not scoped to a breakpoint, so on a four-up grid the
 * second card jumps to the far right of the row and the rest fall into
 * one-per-row. The markup stays WooCommerce-shaped - only the layout changes.
 */

.gillion-woocommerce ul.products[class*="columns-"] {
	display: grid;
	gap: 34px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* WooCommerce's float clearfix pseudo-elements become grid items once the loop
   is a grid, which leaves the first cell empty. */
.gillion-woocommerce ul.products[class*="columns-"]::before,
.gillion-woocommerce ul.products[class*="columns-"]::after {
	content: none;
	display: none;
}

.gillion-woocommerce ul.products.columns-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gillion-woocommerce ul.products.columns-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gillion-woocommerce ul.products.columns-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gillion-woocommerce ul.products.columns-5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.gillion-woocommerce ul.products[class*="columns-"] li.product {
	float: none !important;
	clear: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
}

@media (max-width: 1100px) {
	.gillion-woocommerce ul.products.columns-4,
	.gillion-woocommerce ul.products.columns-5 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 860px) {
	.gillion-woocommerce ul.products[class*="columns-"] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.gillion-woocommerce ul.products[class*="columns-"] {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}
}
/* ------------------------------------------------------------ legal pages */

/* Privacy, terms and refund copy all share the .sh-text-content wrapper that
   came from the old theme. It carried paragraph spacing but no heading
   rhythm, so long documents read as one grey column. This sets the scale and
   leaves the prose alone. */
.sh-text-content .page-content > h2,
.sh-text-content .page-content > h3 {
	letter-spacing: -0.021em;
	line-height: 1.25;
}

.sh-text-content .page-content > h2 {
	margin: 44px 0 14px;
	font-size: 27px;
	font-weight: 650;
}

.sh-text-content .page-content > h3 {
	margin: 34px 0 10px;
	font-size: 18.5px;
	font-weight: 650;
}

.sh-text-content .page-content > h2:first-child {
	margin-top: 0;
}

.sh-text-content .page-content > p {
	margin: 0 0 15px;
}

.sh-text-content .page-content > ul {
	margin: 0 0 18px;
	padding-left: 22px;
}

.sh-text-content .page-content > ul > li {
	margin-bottom: 7px;
	line-height: 1.72;
}

.sh-text-content .page-content > ul > li::marker {
	color: rgba(101, 113, 255, 0.75);
}

/* Cookie and currency codes read as tokens, not prose. */
.sh-text-content .page-content code {
	padding: 1px 6px;
	border-radius: 5px;
	background: rgba(101, 113, 255, 0.09);
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.875em;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

body.dark .sh-text-content .page-content code {
	background: rgba(101, 113, 255, 0.18);
}

@media (max-width: 640px) {
	.sh-text-content .page-content > h2 {
		margin-top: 34px;
		font-size: 23px;
	}

	.sh-text-content .page-content > h3 {
		margin-top: 28px;
		font-size: 17.5px;
	}
}

/* ------------------------------------------------------------- back to top */

/* bundle.css centres this control with `text-align: center` plus a fixed
   line-height on the <i>, which only works while the icon is a text glyph.
   The icon is an inline SVG inside .sa-ico now, so the line box never holds it
   and the chevron settles in the top-left corner of the tile. Flex owns both
   axes instead, and the wrapper is a real <button>, so Enter and Space fire
   the same click handler jQuery already binds. */
.sh-back-to-top {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid var(--hb-line);
	border-radius: var(--hb-radius);
	background-color: var(--hb-card);
	box-shadow: var(--hb-shadow);
	color: var(--hb-ink-2);
	font: inherit;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	/* At opacity 0 the old control still swallowed clicks in the bottom-right
	   corner of every page. visibility and pointer-events take it out of the
	   hit test until .active lands. */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(6px);
	transition:
		opacity var(--hb-dur) var(--hb-ease),
		transform var(--hb-dur) var(--hb-ease),
		background-color var(--hb-dur) var(--hb-ease),
		border-color var(--hb-dur) var(--hb-ease),
		visibility 0s linear var(--hb-dur);
}

.sh-back-to-top.active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
	transition-delay: 0s;
}

/* The vendored rule hands the wrapper line-height: 46px. The SVG is sized at
   1em, so it inherits that 46px height and the glyph rides the top of the
   line box. Flatten it and let the flex row do the centring. */
.sh-back-to-top .sa-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	line-height: 1;
	vertical-align: baseline;
	color: inherit;
}

.sh-back-to-top:hover,
.sh-back-to-top:focus-visible {
	background-color: var(--hb-accent);
	border-color: var(--hb-accent);
	color: var(--hb-on-accent);
}

.sh-back-to-top:hover .sa-ico,
.sh-back-to-top:focus-visible .sa-ico {
	color: var(--hb-on-accent);
}

.sh-back-to-top:active {
	background-color: var(--hb-accent-lo);
	border-color: var(--hb-accent-lo);
}

.sh-back-to-top:focus-visible {
	outline: 0;
	box-shadow: var(--hb-ring);
}

/* theme-dark repaints the hover state back to the muted surface. The accent is
   what every other control on the page uses, so it wins in both themes. */
body.dark .sh-back-to-top {
	background-color: var(--hb-card);
	border-color: var(--hb-line);
	color: var(--hb-ink-2);
}

body.dark .sh-back-to-top:hover,
body.dark .sh-back-to-top:focus-visible {
	background-color: var(--hb-accent);
	border-color: var(--hb-accent);
	color: var(--hb-on-accent);
}

/* theme-dark also dims the icon through --hb-muted; the chevron is the only
   thing in the tile, so it carries the ink weight of a normal control. */
body.dark .sh-back-to-top .sa-ico {
	color: var(--hb-ink-2);
}

body.dark .sh-back-to-top:hover .sa-ico,
body.dark .sh-back-to-top:focus-visible .sa-ico {
	color: var(--hb-on-accent);
}

@media (max-width: 782px) {
	.sh-back-to-top {
		right: 16px;
		bottom: 16px;
		width: 44px;
		height: 44px;
	}
}