/*
 * HS Consent - banner, preferences dialog and revisit button.
 *
 * Tokens fall back to the hs-header values, so hydrasearch.com (no hs-header)
 * renders the same as the two product sites.
 *
 * Every interactive state (:hover, :focus, :focus-visible, :active) is set
 * explicitly and scoped under a parent class: the parent theme's reset paints
 * bare `button:focus` / `[type=button]:hover` pink (#c36), and a plain
 * `.hsc-btn:focus` would only tie that on specificity.
 *
 * Stacking: the banner sits above the sticky header bar (1000) but BELOW the
 * mobile menu (1100) and the cart drawer (1200), so an open drawer dims it like
 * everything else. The dialog uses the browser's top layer via showModal().
 */

.hsc-banner,
.hsc-dialog,
.hsc-revisit {
	--hsc-navy: var(--hsh-navy, #00254d);
	--hsc-accent: var(--hsh-accent, #007cba);
	--hsc-accent-hover: var(--hsh-accent-hover, #005a87);
	--hsc-text: var(--hsh-text, #111b29);
	--hsc-muted: var(--hsh-muted, #5b6573);
	--hsc-line: var(--hsh-line, #e3e7ee);
	--hsc-soft: #eef3f9;
	/* The product sites load these faces as "Franklin Gothic Condensed Demi" /
	   "Franklin Gothic Book"; hydrasearch.com (Elementor) loads the same fonts
	   as "Franklin Gothic Demi Cond Regular" / "Franklin Gothic book regular".
	   Whichever is present wins. */
	--hsc-head: var(--hsh-font-head, "Franklin Gothic Condensed Demi", "Franklin Gothic Demi Cond Regular", "Franklin Gothic Demi Cond", "Arial Narrow", Arial, sans-serif);
	--hsc-body: var(--hsh-font-body, "Franklin Gothic Book", "Franklin Gothic book regular", "Franklin Gothic", Inter, Arial, sans-serif);
	--hsc-shadow: var(--hsh-shadow-panel, 0 14px 40px rgba(0, 37, 77, .18), 0 2px 6px rgba(0, 37, 77, .08));
	box-sizing: border-box;
	font-family: var(--hsc-body);
	color: var(--hsc-text);
	-webkit-font-smoothing: antialiased;
}

.hsc-banner *,
.hsc-dialog *,
.hsc-revisit * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------ banner --- */

.hsc-banner {
	position: fixed;
	left: 24px;
	bottom: 24px;
	z-index: 1050;
	width: min(440px, calc(100vw - 48px));
	padding: 22px 22px 18px;
	background: #fff;
	border: 1px solid var(--hsc-line);
	border-radius: 18px;
	box-shadow: var(--hsc-shadow);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .24s ease-out, transform .24s ease-out;
}

.hsc-banner.is-in {
	opacity: 1;
	transform: none;
}

.hsc-banner .hsc-banner__title {
	margin: 0 0 6px;
	font-family: var(--hsc-head);
	font-size: 21px;
	line-height: 1.2;
	font-weight: normal;
	color: var(--hsc-navy);
}

.hsc-banner .hsc-banner__text {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.55;
	color: #3b4552;
}

.hsc-banner .hsc-policy,
.hsc-dialog .hsc-policy {
	color: var(--hsc-navy);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hsc-banner .hsc-policy:hover,
.hsc-dialog .hsc-policy:hover {
	color: var(--hsc-accent);
}

.hsc-banner .hsc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.hsc-banner .hsc-btn--solid {
	flex: 1 1 140px;
}

.hsc-banner .hsc-btn--link {
	flex: 1 1 100%;
}

/* ----------------------------------------------------------- buttons --- */

.hsc-banner .hsc-btn,
.hsc-dialog .hsc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 10px 18px;
	font-family: var(--hsc-head);
	font-size: 16px;
	font-weight: normal;
	line-height: 1.15;
	letter-spacing: .1px;
	text-align: center;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	white-space: normal;
	border: 2px solid var(--hsc-navy);
	border-radius: 30px;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.hsc-banner .hsc-btn--solid,
.hsc-dialog .hsc-btn--solid,
.hsc-banner .hsc-btn--solid:focus,
.hsc-dialog .hsc-btn--solid:focus {
	background: var(--hsc-navy);
	border-color: var(--hsc-navy);
	color: #fff;
}

.hsc-banner .hsc-btn--solid:hover,
.hsc-dialog .hsc-btn--solid:hover,
.hsc-banner .hsc-btn--solid:active,
.hsc-dialog .hsc-btn--solid:active {
	background: var(--hsc-accent-hover);
	border-color: var(--hsc-accent-hover);
	color: #fff;
}

.hsc-dialog .hsc-btn--ghost,
.hsc-dialog .hsc-btn--ghost:focus {
	background: #fff;
	border-color: var(--hsc-navy);
	color: var(--hsc-navy);
}

.hsc-dialog .hsc-btn--ghost:hover,
.hsc-dialog .hsc-btn--ghost:active {
	background: var(--hsc-soft);
	border-color: var(--hsc-navy);
	color: var(--hsc-navy);
}

.hsc-banner .hsc-btn--link,
.hsc-banner .hsc-btn--link:focus {
	min-height: 32px;
	padding: 4px 6px;
	background: transparent;
	border-color: transparent;
	color: var(--hsc-navy);
	font-family: var(--hsc-body);
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hsc-banner .hsc-btn--link:hover,
.hsc-banner .hsc-btn--link:active {
	background: transparent;
	border-color: transparent;
	color: var(--hsc-accent);
}

.hsc-banner .hsc-btn:focus-visible,
.hsc-dialog .hsc-btn:focus-visible,
.hsc-dialog .hsc-x:focus-visible,
.hsc-dialog .hsc-switch:focus-visible,
.hsc-revisit:focus-visible,
.hsc-banner .hsc-policy:focus-visible,
.hsc-dialog .hsc-policy:focus-visible {
	outline: 3px solid var(--hsc-accent);
	outline-offset: 2px;
}

/* ------------------------------------------------------------ dialog --- */

.hsc-dialog {
	width: min(560px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 32px);
	margin: auto;
	padding: 0;
	background: #fff;
	border: 0;
	border-radius: 18px;
	box-shadow: var(--hsc-shadow);
	overflow: hidden;
}

.hsc-dialog[open] {
	display: flex;
}

.hsc-dialog::backdrop {
	background: rgba(0, 20, 45, .55);
}

.hsc-dialog .hsc-dialog__inner {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: calc(100vh - 32px);
}

.hsc-dialog .hsc-dialog__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 22px 12px;
}

.hsc-dialog .hsc-dialog__title {
	margin: 0;
	font-family: var(--hsc-head);
	font-size: 23px;
	line-height: 1.2;
	font-weight: normal;
	color: var(--hsc-navy);
}

.hsc-dialog .hsc-x,
.hsc-dialog .hsc-x:focus {
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 1px solid var(--hsc-line);
	border-radius: 50%;
	color: var(--hsc-navy);
	box-shadow: none;
	cursor: pointer;
}

.hsc-dialog .hsc-x:hover,
.hsc-dialog .hsc-x:active {
	background: var(--hsc-soft);
	border-color: var(--hsc-accent);
	color: var(--hsc-navy);
}

.hsc-dialog .hsc-x svg {
	width: 18px;
	height: 18px;
}

.hsc-dialog .hsc-dialog__body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 0 22px 8px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.hsc-dialog .hsc-dialog__intro {
	margin: 0 0 8px;
	font-size: 14.5px;
	line-height: 1.55;
	color: #3b4552;
}

.hsc-dialog .hsc-gpc {
	margin: 10px 0 4px;
	padding: 10px 12px;
	font-size: 13.5px;
	line-height: 1.45;
	color: #6b4e11;
	background: #fffaf0;
	border: 1px solid #f0d9a8;
	border-radius: 10px;
}

.hsc-dialog .hsc-gpc[hidden],
.hsc-dialog .hsc-cat[hidden] {
	display: none;
}

.hsc-dialog .hsc-cats {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.hsc-dialog .hsc-cat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	margin: 0;
	padding: 14px 0;
	border-top: 1px solid var(--hsc-line);
}

.hsc-dialog .hsc-cat__text {
	display: block;
	margin: 0;
	cursor: default;
}

.hsc-dialog label.hsc-cat__text {
	cursor: pointer;
}

.hsc-dialog .hsc-cat__text strong {
	display: block;
	margin: 0 0 2px;
	font-family: var(--hsc-head);
	font-size: 17px;
	font-weight: normal;
	line-height: 1.25;
	color: var(--hsc-navy);
}

.hsc-dialog .hsc-cat__text span {
	display: block;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--hsc-muted);
}

.hsc-dialog .hsc-always {
	flex: 0 0 auto;
	padding: 4px 10px;
	font-size: 12.5px;
	line-height: 1.3;
	color: var(--hsc-navy);
	background: var(--hsc-soft);
	border-radius: 20px;
	white-space: nowrap;
}

/* Switch: a real checkbox (role=switch), so keyboard and screen readers get it for free. */
.hsc-dialog .hsc-switch {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	flex: 0 0 auto;
	width: 48px;
	height: 28px;
	margin: 0;
	padding: 0;
	background: #c5ccd6;
	border: 0;
	border-radius: 14px;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .18s ease;
}

.hsc-dialog .hsc-switch::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
	transition: transform .18s ease;
}

.hsc-dialog .hsc-switch:checked {
	background: var(--hsc-navy);
}

.hsc-dialog .hsc-switch:checked::before {
	transform: translateX(20px);
}

.hsc-dialog .hsc-dialog__policy {
	margin: 4px 0 10px;
	font-size: 14px;
}

.hsc-dialog .hsc-dialog__foot {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 16px 22px 20px;
	border-top: 1px solid var(--hsc-line);
}

.hsc-dialog .hsc-dialog__foot .hsc-btn {
	flex: 1 1 150px;
}

/* ----------------------------------------------------------- revisit --- */

/* `body button.` on purpose: hydrasearch.com's Hello Elementor reset styles
   [type="button"] (0,1,0) and [type="button"]:hover/:focus (0,2,0) pink #c36,
   and loads after this file, so a bare .hsc-revisit (0,1,0) lost the tie. */
body button.hsc-revisit,
body button.hsc-revisit:focus {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 1040;
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1px solid var(--hsc-line);
	border-radius: 50%;
	color: var(--hsc-navy);
	box-shadow: 0 6px 18px rgba(0, 37, 77, .16);
	cursor: pointer;
	transition: background-color .18s ease;
}

body button.hsc-revisit:hover,
body button.hsc-revisit:active {
	background: var(--hsc-soft);
	border-color: var(--hsc-line);
	color: var(--hsc-navy);
}

.hsc-revisit svg {
	width: 22px;
	height: 22px;
}

.hsc-footer-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ------------------------------------------------------------ mobile --- */

/* Compact banner (phones): no title, short copy, inline "Preferences", one row
   of buttons. Chosen in JS at render time; see isCompact() in consent.js. */
.hsc-banner.hsc-banner--compact {
	padding: 14px 16px;
	border-radius: 14px;
}

.hsc-banner--compact .hsc-banner__text {
	margin: 0 0 10px;
	font-size: 13.5px;
	line-height: 1.45;
}

.hsc-banner--compact .hsc-banner__actions {
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
}

.hsc-banner.hsc-banner--compact .hsc-btn {
	min-height: 40px;
	padding: 8px 14px;
	font-size: 15px;
}

.hsc-banner--compact .hsc-btn--solid {
	flex: 1 1 0;
}

/* US notice: "Do Not Sell" link on the left, a short OK on the right. */
.hsc-banner.hsc-banner--compact.hsc-banner--optout .hsc-btn--link {
	flex: 1 1 auto;
	justify-content: flex-start;
	min-height: 40px;
	padding: 4px 0;
	font-size: 12.5px;
	line-height: 1.3;
	text-align: left;
}

.hsc-banner--compact.hsc-banner--optout .hsc-btn--solid {
	flex: 0 0 auto;
	min-width: 88px;
}

/* Inline "Preferences" inside the compact text: a real <button>, styled as a link. */
body .hsc-banner button.hsc-inline,
body .hsc-banner button.hsc-inline:focus,
body .hsc-banner button.hsc-inline:hover,
body .hsc-banner button.hsc-inline:active {
	display: inline;
	min-height: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	line-height: inherit;
	text-transform: none;
	letter-spacing: normal;
	color: var(--hsc-navy);
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

body .hsc-banner button.hsc-inline:hover {
	color: var(--hsc-accent);
}

body .hsc-banner button.hsc-inline:focus-visible {
	outline: 3px solid var(--hsc-accent);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.hsc-banner {
		left: 12px;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		width: auto;
		padding: 18px 18px 14px;
	}

	.hsc-banner .hsc-banner__title {
		font-size: 19px;
	}

	.hsc-dialog .hsc-dialog__head {
		padding: 18px 18px 10px;
	}

	.hsc-dialog .hsc-dialog__body {
		padding: 0 18px 8px;
	}

	.hsc-dialog .hsc-dialog__foot {
		padding: 14px 18px 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hsc-banner,
	.hsc-dialog .hsc-switch,
	.hsc-dialog .hsc-switch::before {
		transition: none;
	}
}

@media print {
	.hsc-banner,
	.hsc-revisit {
		display: none !important;
	}
}
