/**
 * Summit Mountain Dining Popup
 * 1. Bottom-right popup (.hsp-popup)
 * 2. Right-edge side tab (.hsp-tab)
 */

:root {
	--hsp-accent: #2F4858;
	--hsp-accent-dark: #243845;
	--hsp-on-accent: #ffffff;
	--hsp-font: 'Poltawski Nowy', serif;
	--hsp-offset: 24px;
}

/* ============================================================
   1. BOTTOM-RIGHT POPUP
   ============================================================ */

.hsp-popup {
	position: fixed;
	right: var(--hsp-offset);
	bottom: var(--hsp-offset);
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: var(--hsp-font);
	pointer-events: none;
}

.hsp-popup > * {
	pointer-events: auto;
}

/* ---- Launcher pill ---- */

.hsp-popup__launcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin: 0;
	padding: 14px 22px;
	border: none;
	border-radius: 999px;
	background: var(--hsp-accent);
	color: var(--hsp-on-accent);
	font-family: var(--hsp-font);
	font-size: 1rem;
	line-height: 1;
	letter-spacing: .02em;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
	transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}

.hsp-popup__launcher:hover,
.hsp-popup__launcher:focus-visible {
	background: var(--hsp-accent-dark);
	transform: translateY(-2px);
	box-shadow: 0 14px 32px rgba(0, 0, 0, .34);
}

.hsp-popup__launcher:focus-visible {
	outline: 3px solid var(--hsp-on-accent);
	outline-offset: 3px;
}

.hsp-popup__launcher-icon {
	font-size: 1.2rem;
	line-height: 1;
}

/* Attention ring — runs a few times, then rests. */
.hsp-popup__pulse {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	border: 2px solid var(--hsp-accent);
	opacity: 0;
	pointer-events: none;
	animation: hsp-popup-pulse 2.4s ease-out 6;
}

@keyframes hsp-popup-pulse {
	0%   { transform: scale(1);    opacity: .55; }
	70%  { transform: scale(1.28); opacity: 0; }
	100% { transform: scale(1.28); opacity: 0; }
}

.hsp-popup.is-open .hsp-popup__pulse {
	animation: none;
}

/* ---- Card ---- */

.hsp-popup__card {
	position: relative;
	width: 340px;
	max-width: calc(100vw - 2 * var(--hsp-offset));
	box-sizing: border-box;
	background: #fff;
	border-top: 4px solid var(--hsp-accent);
	border-radius: 6px;
	box-shadow: 0 18px 46px rgba(0, 0, 0, .26);
	overflow: hidden;
	transform-origin: bottom right;
	transform: translateY(16px) scale(.94);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, transform .3s cubic-bezier(.2, .8, .3, 1), visibility 0s linear .3s;
}

.hsp-popup.is-open .hsp-popup__card {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	transition-delay: 0s;
}

.hsp-popup__close {
	position: absolute;
	top: 8px;
	right: 10px;
	z-index: 2;
	width: 30px;
	height: 30px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, .82);
	color: var(--hsp-accent);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	opacity: .7;
	transition: opacity .2s ease, background .2s ease;
}

.hsp-popup__close:hover,
.hsp-popup__close:focus-visible {
	opacity: 1;
	background: #fff;
}

.hsp-popup__media {
	line-height: 0;
}

.hsp-popup__media img {
	display: block;
	width: 100%;
	height: 140px;
	object-fit: cover;
}

.hsp-popup__body {
	padding: 26px 24px 28px;
	text-align: center;
}

.hsp-popup__icon {
	display: block;
	margin-bottom: 8px;
	font-size: 1.9rem;
	line-height: 1;
}

.hsp-popup__heading {
	margin: 0 0 10px;
	color: var(--hsp-accent);
	font-family: var(--hsp-font);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
}

.hsp-popup__message {
	margin: 0 0 20px;
	color: #45535c;
	font-size: .95rem;
	line-height: 1.5;
}

.hsp-popup__btn {
	display: inline-block;
	position: relative;
	padding: 13px 30px;
	border: 2px solid var(--hsp-accent);
	background: var(--hsp-accent);
	color: var(--hsp-on-accent) !important;
	font-family: var(--hsp-font);
	font-size: 1.05rem;
	text-decoration: none;
	transition: background .25s ease, color .25s ease;
}

.hsp-popup__btn::before,
.hsp-popup__btn::after {
	content: '';
	position: absolute;
	width: 10px;
	height: 10px;
	border: 2px solid var(--hsp-on-accent);
}

.hsp-popup__btn::before {
	top: 4px;
	left: 4px;
	border-right: none;
	border-bottom: none;
}

.hsp-popup__btn::after {
	bottom: 4px;
	right: 4px;
	border-left: none;
	border-top: none;
}

.hsp-popup__btn:hover,
.hsp-popup__btn:focus-visible {
	background: #fff;
	color: var(--hsp-accent) !important;
}

.hsp-popup__btn:hover::before,
.hsp-popup__btn:hover::after,
.hsp-popup__btn:focus-visible::before,
.hsp-popup__btn:focus-visible::after {
	border-color: var(--hsp-accent);
}

/* ---- Small screens ---- */

@media (max-width: 600px) {
	.hsp-popup {
		--hsp-offset: 14px;
		left: var(--hsp-offset);
		align-items: stretch;
	}

	.hsp-popup__card {
		width: 100%;
		max-width: none;
	}

	.hsp-popup__media img {
		height: 118px;
	}

	.hsp-popup__body {
		padding: 22px 20px 24px;
	}

	.hsp-popup__heading {
		font-size: 1.32rem;
	}

	.hsp-popup__launcher {
		align-self: flex-end;
		padding: 13px 20px;
		font-size: .95rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hsp-popup__pulse {
		animation: none;
	}

	.hsp-popup__card,
	.hsp-popup__launcher {
		transition-duration: .01ms;
	}
}

/* ============================================================
   2. RIGHT-EDGE SIDE TAB
   ============================================================ */

.hsp-tab {
	position: fixed;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	z-index: 9998;
	display: flex;
	align-items: center;
	font-family: var(--hsp-font);
}

.hsp-tab__tab {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 20px 11px;
	border: none;
	border-radius: 8px 0 0 8px;
	background: var(--hsp-accent);
	color: var(--hsp-on-accent);
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	font-family: var(--hsp-font);
	font-size: 1rem;
	letter-spacing: .04em;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: -4px 0 14px rgba(0, 0, 0, .18);
	transition: background .25s ease;
}

.hsp-tab__tab:hover {
	background: var(--hsp-accent-dark);
}

.hsp-tab__tab-icon {
	font-size: 1.15rem;
	line-height: 1;
}

.hsp-tab__panel {
	width: 0;
	overflow: hidden;
	background: #fff;
	border-top: 2px solid var(--hsp-accent);
	border-bottom: 2px solid var(--hsp-accent);
	border-left: 2px solid var(--hsp-accent);
	box-shadow: -6px 0 22px rgba(0, 0, 0, .2);
	transition: width .35s ease;
}

.hsp-tab.is-open .hsp-tab__panel {
	width: 230px;
}

.hsp-tab__panel-inner {
	position: relative;
	width: 230px;
	box-sizing: border-box;
	padding: 26px 22px;
	text-align: center;
}

.hsp-tab__close {
	position: absolute;
	top: 6px;
	right: 9px;
	padding: 0;
	border: none;
	background: none;
	color: var(--hsp-accent);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	opacity: .55;
	transition: opacity .2s ease;
}

.hsp-tab__close:hover {
	opacity: 1;
}

.hsp-tab__heading {
	margin: 2px 0 18px;
	color: var(--hsp-accent);
	font-family: var(--hsp-font);
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.2;
}

.hsp-tab__btn {
	display: inline-block;
	position: relative;
	padding: 12px 26px;
	border: 2px solid var(--hsp-accent);
	background: var(--hsp-accent);
	color: var(--hsp-on-accent) !important;
	font-family: var(--hsp-font);
	font-size: 1.05rem;
	text-decoration: none;
	transition: background .25s ease, color .25s ease;
}

.hsp-tab__btn::before,
.hsp-tab__btn::after {
	content: '';
	position: absolute;
	width: 10px;
	height: 10px;
	border: 2px solid var(--hsp-on-accent);
}

.hsp-tab__btn::before {
	top: 4px;
	left: 4px;
	border-right: none;
	border-bottom: none;
}

.hsp-tab__btn::after {
	bottom: 4px;
	right: 4px;
	border-left: none;
	border-top: none;
}

.hsp-tab__btn:hover {
	background: #fff;
	color: var(--hsp-accent) !important;
}

.hsp-tab__btn:hover::before,
.hsp-tab__btn:hover::after {
	border-color: var(--hsp-accent);
}

@media (max-width: 600px) {
	.hsp-tab__tab {
		padding: 16px 9px;
		font-size: .9rem;
	}

	.hsp-tab.is-open .hsp-tab__panel {
		width: 200px;
	}

	.hsp-tab__panel-inner {
		width: 200px;
		padding: 22px 18px;
	}

	.hsp-tab__heading {
		font-size: 1.25rem;
		margin-bottom: 14px;
	}

	.hsp-tab__btn {
		font-size: .98rem;
		padding: 11px 22px;
	}
}

/* Keep the side tab clear of an open bottom-right card on short screens. */
@media (max-height: 700px) {
	.hsp-tab {
		top: 38%;
	}
}

/* On phones the open card spans the viewport — get the tab out of its way. */
@media (max-width: 782px) {
	.hsp-tab {
		transition: opacity .25s ease, transform .25s ease;
	}

	.hsp-popup-is-open .hsp-tab {
		opacity: 0;
		transform: translate(100%, -50%);
		pointer-events: none;
	}
}
