/*!
 * HEPI Sports Core — front-end styles.
 * Small on purpose: the theme provides the design tokens.
 */

[hidden] { display: none !important; }

/* Fallback tokens so the plugin still looks right under another theme. */
.hp-chatbtn,
.hp-toast,
.hp-qv {
	--hpc-ink: var(--hp-ink, #0b0b0c);
	--hpc-accent: var(--hp-accent, #ffcd4e);
	--hpc-accent-ink: var(--hp-accent-ink, #0b0b0c);
	--hpc-paper: var(--hp-paper, #fff);
	--hpc-radius: var(--hp-radius, 0px);
}

/* ------------------------------------------------------- Chat / help widget */
.hp-chat {
	position: fixed;
	bottom: 18px;
	z-index: 76;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	--hpc-ink: var(--hp-ink, #0b0b0c);
	--hpc-accent: var(--hp-accent, #ffcd4e);
	--hpc-accent-ink: var(--hp-accent-ink, #0b0b0c);
	--hpc-paper: var(--hp-paper, #fff);
	--hpc-radius: var(--hp-radius, 0px);
}

.hp-chat--right { right: 18px; }
.hp-chat--left { left: 18px; align-items: flex-start; }

/* ---- Launcher ---- */
.hp-chatbtn {
	display: inline-flex;
	align-items: center;
	gap: 0;
	height: 56px;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: var(--hpc-accent);
	color: var(--hpc-accent-ink);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
	transition: gap .22s ease, padding .22s ease, transform .2s ease, box-shadow .2s ease;
	overflow: hidden;
	white-space: nowrap;
	cursor: pointer;
}

/* The single-link variant is a plain anchor and still positions itself. */
a.hp-chatbtn {
	position: fixed;
	bottom: 18px;
	z-index: 75;
	height: 52px;
}

a.hp-chatbtn.hp-chatbtn--right { right: 18px; }
a.hp-chatbtn.hp-chatbtn--left { left: 18px; }

.hp-chatbtn__icon { display: inline-flex; }
.hp-chatbtn__icon--close { display: none; }

.hp-chatbtn__label {
	max-width: 0;
	opacity: 0;
	font-size: .8125rem;
	font-weight: 800;
	letter-spacing: .03em;
	transition: max-width .26s ease, opacity .2s ease;
}

.hp-chatbtn:hover,
.hp-chatbtn:focus-visible {
	gap: 10px;
	padding-right: 22px;
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, .26);
}

.hp-chatbtn:hover .hp-chatbtn__label,
.hp-chatbtn:focus-visible .hp-chatbtn__label {
	max-width: 220px;
	opacity: 1;
}

/* Open state: swap to the close icon and keep the label hidden. */
.hp-chat.is-open .hp-chatbtn__icon--open { display: none; }
.hp-chat.is-open .hp-chatbtn__icon--close { display: inline-flex; }
.hp-chat.is-open .hp-chatbtn { gap: 0; padding-right: 16px; transform: none; }
.hp-chat.is-open .hp-chatbtn__label { max-width: 0; opacity: 0; }

/* ---- Panel ---- */
.hp-chat__panel {
	width: min(340px, calc(100vw - 36px));
	max-height: min(70vh, 560px);
	overflow-y: auto;
	background: var(--hpc-paper);
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .28);
	animation: hp-chat-in .2s ease;
	overscroll-behavior: contain;
}

@keyframes hp-chat-in {
	from { opacity: 0; transform: translateY(10px); }
}

.hp-chat__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 16px 16px 20px;
	background: var(--hpc-accent);
	color: var(--hpc-accent-ink);
	border-radius: 14px 14px 0 0;
}

.hp-chat__title {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 800;
	letter-spacing: -.01em;
}

.hp-chat__intro {
	margin: 4px 0 0;
	font-size: .8125rem;
	opacity: .8;
	line-height: 1.4;
}

.hp-chat__close {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 999px;
	background: rgba(0, 0, 0, .08);
	color: inherit;
	cursor: pointer;
}

.hp-chat__close:hover { background: rgba(0, 0, 0, .16); }

.hp-chat__list {
	list-style: none;
	margin: 0;
	padding: 8px;
}

.hp-chat__option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-radius: 10px;
	color: var(--hpc-ink);
	text-decoration: none;
	transition: background-color .15s ease;
}

.hp-chat__option:hover { background: rgba(0, 0, 0, .05); }

.hp-chat__option-icon {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	background: var(--hpc-accent);
	color: var(--hpc-accent-ink);
}

.hp-chat__option-text { display: grid; gap: 1px; min-width: 0; }
.hp-chat__option-text strong { font-size: .875rem; font-weight: 700; }
.hp-chat__option-text span {
	font-size: .75rem;
	color: #6e6e76;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hp-chat__option-go { margin-left: auto; color: #b5b5bd; flex: 0 0 auto; }
.hp-chat__option:hover .hp-chat__option-go { color: var(--hpc-ink); }

.hp-chat__hours {
	margin: 0;
	padding: 4px 20px 18px;
	font-size: .6875rem;
	color: #6e6e76;
}

/* Keep the scroll-to-top button clear of the widget. */
body.hp-has-chat.hp-chat-right .hp-totop { bottom: 86px; }
body.hp-has-chat.hp-chat-left .hp-totop { bottom: 18px; }

@media (max-width: 767px) {
	body.single-product .hp-chat,
	body.single-product a.hp-chatbtn { bottom: 84px; }
	body.single-product.hp-has-chat .hp-totop { bottom: 152px; }
}

/* ------------------------------------------------------------ Wishlist */
.hp-wishlist-btn svg { transition: fill .18s ease, transform .18s ease; }
.hp-wishlist-btn.is-on svg { fill: currentColor; }
.hp-wishlist-btn.is-busy { opacity: .5; pointer-events: none; }

.hp-wishlist-grid { margin-top: 24px; }

/* --------------------------------------------------------------- Toast */
.hp-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translate(-50%, 16px);
	z-index: 120;
	padding: 12px 18px;
	border-radius: var(--hpc-radius);
	background: var(--hpc-ink);
	color: #fff;
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .02em;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}

.hp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------- Quick view */
.hp-qv {
	position: fixed;
	inset: 0;
	z-index: 110;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(0, 0, 0, .5);
}

.hp-qv__box {
	position: relative;
	width: min(920px, 100%);
	max-height: 88vh;
	overflow-y: auto;
	background: var(--hpc-paper);
	border-radius: var(--hp-radius-lg, 2px);
	box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
	padding: 28px;
}

.hp-qv__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.hp-qv__grid { display: grid; gap: 24px; }

@media (min-width: 760px) {
	.hp-qv__grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

.hp-qv__img { width: 100%; height: auto; }
.hp-qv__loading { padding: 40px; text-align: center; color: #6e6e76; }
.hp-qv__link { margin-top: 16px; }
