/* GpV — price history trigger and dialog (product page only). */

.bsmarty-product-summary__price--gpv {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* Trigger ---------------------------------------------------------------- */

.bsmarty-gpv-trigger {
	position: relative;
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba(37, 99, 235, 0.32);
	border-radius: 12px;
	color: #2563eb;
	background: rgba(239, 246, 255, 0.72);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	font: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Extends the hit area to 44 × 44 px without enlarging the visual. */
.bsmarty-gpv-trigger::before {
	content: "";
	position: absolute;
	inset: -3px;
}

.bsmarty-gpv-trigger:hover {
	border-color: rgba(37, 99, 235, 0.55);
	background: #eff6ff;
}

.bsmarty-gpv-trigger:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.bsmarty-gpv-trigger__icon {
	display: block;
}

.bsmarty-gpv-trigger__tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	z-index: 5;
	padding: 0.375rem 0.625rem;
	border-radius: 8px;
	color: #fff;
	background: #1e3a5f;
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.3;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, 2px);
	transition: opacity 0.12s ease, transform 0.12s ease;
}

.bsmarty-gpv-trigger:focus-visible .bsmarty-gpv-trigger__tooltip {
	opacity: 1;
	transform: translate(-50%, 0);
}

@media (hover: hover) {
	.bsmarty-gpv-trigger:hover .bsmarty-gpv-trigger__tooltip {
		opacity: 1;
		transform: translate(-50%, 0);
	}
}

/* Dialog ----------------------------------------------------------------- */

html.bsmarty-gpv-open,
html.bsmarty-gpv-open body {
	overflow: hidden;
}

.bsmarty-gpv {
	position: fixed;
	inset: 0;
	width: calc(100% - 2rem);
	max-width: 820px;
	height: fit-content;
	max-height: calc(100dvh - 2rem);
	margin: auto;
	padding: 0;
	border: 0;
	color: #0f2744;
	background: transparent;
	overflow: visible;
}

.bsmarty-gpv:not([open]) {
	display: none;
}

.bsmarty-gpv::backdrop {
	background: rgba(15, 23, 42, 0.4);
}

.bsmarty-gpv__surface {
	display: flex;
	flex-direction: column;
	max-height: calc(100dvh - 2rem);
	border: 1px solid rgba(203, 213, 225, 0.85);
	border-radius: 20px;
	background: rgba(255, 255, 255, 0.98);
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2), 0 2px 8px rgba(15, 23, 42, 0.06);
	overflow: hidden;
}

@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
	.bsmarty-gpv__surface {
		background: rgba(255, 255, 255, 0.86);
		-webkit-backdrop-filter: blur(12px) saturate(1.1);
		backdrop-filter: blur(12px) saturate(1.1);
	}
}

.bsmarty-gpv[open] .bsmarty-gpv__surface {
	animation: bsmarty-gpv-in 0.18s ease-out;
}

@keyframes bsmarty-gpv-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.bsmarty-gpv__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 1.25rem 1rem 1.5rem;
	border-bottom: 1px solid rgba(203, 213, 225, 0.7);
}

.bsmarty-gpv__heading {
	min-width: 0;
}

.bsmarty-gpv__title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	color: #1e3a5f;
}

.bsmarty-gpv__subtitle {
	margin: 0.25rem 0 0;
	font-size: 0.875rem;
	line-height: 1.45;
	color: #475569;
}

.bsmarty-gpv__close {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	margin: -0.25rem -0.25rem 0 0;
	padding: 0;
	border: 0;
	border-radius: 12px;
	color: #334155;
	background: transparent;
	cursor: pointer;
}

.bsmarty-gpv__close:hover {
	background: rgba(241, 245, 249, 0.9);
}

.bsmarty-gpv__close:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 1px;
}

.bsmarty-gpv__body {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding: 1.25rem 1.5rem 1.5rem;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.bsmarty-gpv__notice {
	display: flex;
	gap: 0.75rem;
	padding: 0.875rem 1rem;
	border: 1px solid rgba(147, 197, 253, 0.65);
	border-radius: 14px;
	background: rgba(239, 246, 255, 0.85);
}

.bsmarty-gpv__notice-icon {
	flex: none;
	margin-top: 0.0625rem;
	color: #2563eb;
}

.bsmarty-gpv__notice-title {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.4;
	color: #1e3a5f;
}

.bsmarty-gpv__notice-text {
	margin: 0.25rem 0 0;
	font-size: 0.875rem;
	line-height: 1.55;
	color: #334155;
}

.bsmarty-gpv__cards {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0;
}

.bsmarty-gpv__card {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
	padding: 0.875rem 1rem;
	border: 1px solid rgba(203, 213, 225, 0.8);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.72);
}

.bsmarty-gpv__card dt {
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.35;
	color: #475569;
}

.bsmarty-gpv__card dd {
	margin: 0;
}

.bsmarty-gpv__value {
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	color: #1e3a5f;
}

.bsmarty-gpv__card.is-unavailable .bsmarty-gpv__value {
	font-size: 0.9375rem;
	font-weight: 600;
	color: #475569;
}

.bsmarty-gpv__meta {
	font-size: 0.75rem;
	line-height: 1.4;
	color: #64748b;
}

.bsmarty-gpv__section-title {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: #1e3a5f;
}

.bsmarty-gpv__section p {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.6;
	color: #334155;
}

.bsmarty-gpv__section p + p {
	margin-top: 0.5rem;
}

.bsmarty-gpv__chart-empty {
	padding: 1.5rem 1rem;
	border: 1px dashed rgba(148, 163, 184, 0.8);
	border-radius: 14px;
	background: rgba(248, 250, 252, 0.7);
	font-size: 0.875rem;
	line-height: 1.55;
	text-align: center;
	color: #475569;
}

.bsmarty-gpv__explain {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(203, 213, 225, 0.7);
}

/* Tablet ----------------------------------------------------------------- */

@media (max-width: 760px) {
	.bsmarty-gpv__cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile: bottom sheet --------------------------------------------------- */

@media (max-width: 640px) {
	.bsmarty-gpv {
		width: 100%;
		max-width: none;
		max-height: 92dvh;
		margin: auto 0 0;
	}

	.bsmarty-gpv__surface {
		max-height: 92dvh;
		border-bottom: 0;
		border-radius: 20px 20px 0 0;
	}

	.bsmarty-gpv__header {
		padding: 1rem 0.75rem 0.875rem 1rem;
	}

	.bsmarty-gpv__title {
		font-size: 1.0625rem;
	}

	.bsmarty-gpv__body {
		gap: 1rem;
		padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
	}

	.bsmarty-gpv__cards {
		gap: 0.5rem;
	}

	.bsmarty-gpv__card {
		padding: 0.625rem 0.75rem;
		border-radius: 12px;
	}

	.bsmarty-gpv__card dt {
		font-size: 0.75rem;
	}

	.bsmarty-gpv__value {
		font-size: 1rem;
	}

	.bsmarty-gpv__card.is-unavailable .bsmarty-gpv__value {
		font-size: 0.875rem;
	}

	.bsmarty-gpv__explain {
		grid-template-columns: 1fr;
		gap: 1rem;
		padding-top: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bsmarty-gpv-trigger,
	.bsmarty-gpv-trigger__tooltip {
		transition: none;
	}

	.bsmarty-gpv[open] .bsmarty-gpv__surface {
		animation: none;
	}
}
