/**
 * GP Labo Partners - giao diện trang ngoài.
 */

.gp-labo {
	--gp-labo-cols: 2;
	--gp-labo-accent: #0a6cbf;
	--gp-labo-accent-soft: rgba(10, 108, 191, 0.08);
	--gp-labo-text: #1f2933;
	--gp-labo-muted: #52606d;
	--gp-labo-border: #e3e8ee;
	--gp-labo-radius: 12px;

	box-sizing: border-box;
	color: var(--gp-labo-text);
	max-width: 100%;
}

.gp-labo *,
.gp-labo *::before,
.gp-labo *::after {
	box-sizing: inherit;
}

.gp-labo__title {
	font-size: clamp(20px, 2.4vw, 28px);
	font-weight: 700;
	margin: 0 0 18px;
	text-align: center;
}

/* ---------- Tabs ---------- */

.gp-labo__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin: 0 0 22px;
}

.gp-labo__tab {
	appearance: none;
	background: #f4f6f9;
	border: 1px solid var(--gp-labo-border);
	border-radius: 999px;
	color: var(--gp-labo-muted);
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	margin: 0;
	padding: 11px 26px;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gp-labo__tab:hover {
	background: var(--gp-labo-accent-soft);
	color: var(--gp-labo-accent);
}

.gp-labo__tab:focus-visible {
	outline: 2px solid var(--gp-labo-accent);
	outline-offset: 2px;
}

.gp-labo__tab.is-active {
	background: var(--gp-labo-accent);
	border-color: var(--gp-labo-accent);
	box-shadow: 0 6px 16px rgba(10, 108, 191, 0.25);
	color: #fff;
}

/* ---------- Panels & grid ---------- */

.gp-labo__panel[hidden] {
	display: none;
}

.gp-labo__grid {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(var(--gp-labo-cols), minmax(0, 1fr));
}

.gp-labo__empty {
	color: var(--gp-labo-muted);
	font-style: italic;
	margin: 0;
	padding: 24px 0;
	text-align: center;
}

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

.gp-labo-card {
	background: #fff;
	border: 1px solid var(--gp-labo-border);
	border-radius: var(--gp-labo-radius);
	padding: 18px 20px;
	position: relative;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.gp-labo-card.has-image {
	cursor: pointer;
}

.gp-labo-card.has-image:hover,
.gp-labo-card.has-image:focus-visible,
.gp-labo-card.is-active {
	border-color: var(--gp-labo-accent);
	box-shadow: 0 10px 26px rgba(15, 32, 51, 0.12);
	outline: none;
	transform: translateY(-2px);
}

.gp-labo-card__name {
	color: var(--gp-labo-text);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 8px;
	padding-right: 28px;
}

.gp-labo-card__row {
	color: var(--gp-labo-muted);
	font-size: 15px;
	line-height: 1.6;
	margin: 0 0 4px;
}

.gp-labo-card__row:last-of-type {
	margin-bottom: 0;
}

.gp-labo-card__label {
	color: var(--gp-labo-text);
}

.gp-labo-card__phone {
	color: var(--gp-labo-accent);
	text-decoration: none;
}

.gp-labo-card__phone:hover {
	text-decoration: underline;
}

/* Biểu tượng nhỏ báo hiệu ô này có ảnh */
.gp-labo-card__icon {
	border: 1.5px solid currentColor;
	border-radius: 4px;
	color: #c3ccd8;
	height: 16px;
	position: absolute;
	right: 16px;
	top: 18px;
	transition: color 0.2s ease;
	width: 20px;
}

.gp-labo-card__icon::before {
	background: currentColor;
	border-radius: 50%;
	content: "";
	height: 4px;
	left: 3px;
	position: absolute;
	top: 3px;
	width: 4px;
}

.gp-labo-card__icon::after {
	border-bottom: 6px solid currentColor;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	bottom: 0;
	content: "";
	height: 0;
	position: absolute;
	right: 2px;
	width: 0;
}

.gp-labo-card.has-image:hover .gp-labo-card__icon,
.gp-labo-card.is-active .gp-labo-card__icon {
	color: var(--gp-labo-accent);
}

/* ---------- Ảnh xem trước khi hover ---------- */

.gp-labo-preview {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 18px 44px rgba(15, 32, 51, 0.22);
	left: 0;
	max-width: calc(100vw - 24px);
	opacity: 0;
	padding: 10px;
	pointer-events: none;
	position: fixed;
	top: 0;
	transform: translateY(8px) scale(0.97);
	transition: opacity 0.18s ease, transform 0.18s ease;
	visibility: hidden;

	/* Chiều rộng ảnh xem trước = 60% chiều rộng màn hình. */
	width: var(--gp-labo-preview-width, 60vw);
	z-index: 99999;
}

.gp-labo-preview.is-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
	visibility: visible;
}

.gp-labo-preview__img {
	background: #f2f4f7;
	border-radius: 8px;
	display: block;
	height: auto;

	/* Giới hạn chiều cao để ảnh dọc không tràn ra ngoài màn hình. */
	max-height: var(--gp-labo-preview-max-height, 72vh);
	max-width: 100%;
	min-height: 160px;
	object-fit: contain;
	width: 100%;
}

.gp-labo-preview__caption {
	color: #1f2933;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	padding: 10px 4px 4px;
	text-align: center;
}

.gp-labo-preview__arrow {
	background: #fff;
	height: 12px;
	position: absolute;
	transform: rotate(45deg);
	width: 12px;
}

.gp-labo-preview.is-below .gp-labo-preview__arrow {
	box-shadow: -3px -3px 6px rgba(15, 32, 51, 0.06);
	top: -6px;
}

.gp-labo-preview.is-above .gp-labo-preview__arrow {
	bottom: -6px;
	box-shadow: 3px 3px 6px rgba(15, 32, 51, 0.06);
}

/* Khi ảnh quá lớn, không đủ chỗ phía trên/dưới thì canh giữa màn hình. */
.gp-labo-preview.is-centered .gp-labo-preview__arrow {
	display: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.gp-labo__grid {
		grid-template-columns: repeat(min(var(--gp-labo-cols), 2), minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.gp-labo__grid {
		grid-template-columns: 1fr;
	}

	.gp-labo__tab {
		flex: 1 1 auto;
		font-size: 14px;
		padding: 10px 14px;
	}

	/* Trên điện thoại 60vw quá nhỏ để xem, nên nới rộng ra. */
	.gp-labo-preview {
		width: var(--gp-labo-preview-width-mobile, 90vw);
	}

	.gp-labo-preview__img {
		max-height: var(--gp-labo-preview-max-height-mobile, 60vh);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gp-labo-card,
	.gp-labo__tab,
	.gp-labo-preview {
		transition: none;
	}
}
