/*
 * Halima Company Showcase Carousel — Frontend styles
 * Design tokens are injected as CSS custom properties on :root by
 * Halima_PS_Assets::build_css_variables() (falls back to these defaults).
 */

.halima-ps-wrapper {
	--halima-bg: #050607;
	--halima-card-bg: #0B0D0F;
	--halima-accent: #ED1C24;
	--halima-accent-2: #B51219;
	--halima-text: #FFFFFF;
	--halima-muted: #A8ADB5;
	--halima-border: rgba(255, 255, 255, 0.12);
	--halima-radius: 16px;
	--halima-title-size: 36px;
	--halima-subtitle-size: 16px;
	--halima-ptitle-size: 20px;
	--halima-desc-size: 14px;
	--halima-hover-speed: 350ms;
	--halima-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
	--halima-glow: 0 0 45px rgba(237, 28, 36, 0.45);

	box-sizing: border-box;
	position: relative;
	display: block;
	width: 100%;
	background: var(--halima-bg);
	color: var(--halima-text);
	padding: 64px 20px;
	border-radius: var(--halima-radius);
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.halima-ps-wrapper *,
.halima-ps-wrapper *::before,
.halima-ps-wrapper *::after {
	box-sizing: border-box;
}

/* Subtle ambient background glow for the "premium" feel */
.halima-ps-wrapper::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 50% 20%, rgba(237, 28, 36, 0.08), transparent 60%);
	pointer-events: none;
}

/* ---------- Header ---------- */
.halima-ps-header {
	position: relative;
	text-align: center;
	max-width: 700px;
	margin: 0 auto 48px;
}

.halima-ps-title {
	margin: 0 0 12px;
	font-size: var(--halima-title-size);
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--halima-text);
}

.halima-ps-subtitle {
	margin: 0;
	font-size: var(--halima-subtitle-size);
	color: var(--halima-muted);
	line-height: 1.6;
}

/* ---------- Empty state ---------- */
.halima-ps-empty {
	text-align: center;
	padding: 60px 20px;
	color: var(--halima-muted);
	font-size: 15px;
}

/* ---------- Carousel shell ---------- */
.halima-ps-carousel {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

.halima-ps-track-viewport {
	position: relative;
	width: 100%;
	height: 460px;
	perspective: 1600px;
	touch-action: pan-y;
	cursor: grab;
}

.halima-ps-track-viewport.is-dragging {
	cursor: grabbing;
}

.halima-ps-track {
	position: relative;
	height: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	transform-style: preserve-3d;
}

/* ---------- Cards ---------- */
.halima-ps-card {
	position: absolute;
	top: 50%;
	left: 50%;
	width: min(300px, 78vw);
	height: 400px;
	transform: translate(-50%, -50%);
	transition:
		transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.5s ease,
		filter 0.5s ease;
	will-change: transform, opacity;
	outline: none;
	user-select: none;
}

.halima-ps-wrapper.halima-ps-reduced-motion .halima-ps-card {
	transition: none;
}

.halima-ps-card.is-hidden {
	pointer-events: none;
}

.halima-ps-card:focus-visible .halima-ps-card-inner {
	outline: 2px solid var(--halima-accent);
	outline-offset: 4px;
}

.halima-ps-card-inner {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 40%),
		var(--halima-card-bg);
	border: 1px solid var(--halima-border);
	border-radius: calc(var(--halima-radius) - 2px);
	box-shadow: var(--halima-shadow);
	overflow: hidden;
	cursor: pointer;
	transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.halima-ps-card.is-active .halima-ps-card-inner {
	border-color: var(--halima-accent);
	box-shadow: var(--halima-shadow), var(--halima-glow);
}

.halima-ps-card.is-prev .halima-ps-card-inner,
.halima-ps-card.is-next .halima-ps-card-inner {
	cursor: pointer;
}

/* ---------- Media (company logo or extra image) ---------- */
.halima-ps-media {
	flex: 1 1 auto;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 24px 12px;
}

.halima-ps-media img {
	max-width: 100%;
	max-height: 200px;
	width: auto;
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}

.halima-ps-media.is-logo img {
	max-height: 120px;
	padding: 12px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.04), transparent 70%);
	border-radius: 12px;
}

.halima-ps-media-placeholder {
	color: var(--halima-muted);
	opacity: 0.5;
}

/* ---------- Card name / accent line ---------- */
.halima-ps-card-name {
	position: relative;
	width: 100%;
	text-align: center;
	padding: 0 20px 28px;
}

.halima-ps-card-name h3 {
	margin: 0 0 10px;
	font-size: var(--halima-ptitle-size);
	font-weight: 700;
	color: var(--halima-text);
	line-height: 1.3;
}

.halima-ps-accent-line {
	display: inline-block;
	width: 40px;
	height: 3px;
	background: var(--halima-accent);
	border-radius: 2px;
}

/* ---------- Hover / tap information panel (glassmorphism) ---------- */
.halima-ps-hover-panel {
	position: absolute;
	inset: auto 0 0 0;
	padding: 22px 22px 24px;
	background: rgba(5, 6, 7, 0.82);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-top: 1px solid rgba(237, 28, 36, 0.35);
	box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
	transform: translateY(100%);
	opacity: 0;
	transition: transform var(--halima-hover-speed) cubic-bezier(0.22, 1, 0.36, 1), opacity var(--halima-hover-speed) ease;
	max-height: 100%;
	overflow-y: auto;
	pointer-events: none;
}

.halima-ps-card.is-active:hover .halima-ps-hover-panel,
.halima-ps-card.is-active:focus-within .halima-ps-hover-panel,
.halima-ps-card.is-active.is-hovered .halima-ps-hover-panel {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}

.halima-ps-hover-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

.halima-ps-hover-name {
	font-size: 17px;
	font-weight: 700;
	color: var(--halima-text);
}

.halima-ps-hover-badge {
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--halima-accent);
	border: 1px solid rgba(237, 28, 36, 0.5);
	border-radius: 999px;
	padding: 3px 10px;
}

.halima-ps-hover-desc {
	margin: 0 0 14px;
	font-size: var(--halima-desc-size);
	line-height: 1.6;
	color: var(--halima-muted);
}

.halima-ps-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--halima-accent);
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 10px 20px;
	border-radius: 999px;
	transition: background 0.25s ease, transform 0.25s ease;
}

.halima-ps-btn:hover,
.halima-ps-btn:focus-visible {
	background: var(--halima-accent-2);
	color: #fff;
	transform: translateY(-2px);
}

/* ---------- Arrows ---------- */
.halima-ps-arrow {
	position: relative;
	z-index: 50;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	margin: 0 4px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--halima-border);
	border-radius: 50%;
	color: var(--halima-text);
	cursor: pointer;
	transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.halima-ps-arrow:hover,
.halima-ps-arrow:focus-visible {
	background: var(--halima-accent);
	border-color: var(--halima-accent);
	transform: scale(1.06);
	outline: none;
}

.halima-ps-arrow:disabled {
	opacity: 0.3;
	cursor: not-allowed;
	transform: none;
}

.halima-ps-arrow svg {
	pointer-events: none;
}

/* ---------- Pagination dots ---------- */
.halima-ps-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 36px;
}

.halima-ps-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.25);
	border: 1px solid transparent;
	padding: 0;
	cursor: pointer;
	transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.halima-ps-dot:hover,
.halima-ps-dot:focus-visible {
	background: rgba(255, 255, 255, 0.5);
	outline: none;
}

.halima-ps-dot.is-active {
	background: var(--halima-accent);
	border-color: rgba(237, 28, 36, 0.4);
	transform: scale(1.3);
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
	.halima-ps-wrapper {
		padding: 48px 16px;
	}

	.halima-ps-track-viewport {
		height: 420px;
	}

	.halima-ps-card {
		height: 370px;
	}
}

@media (max-width: 600px) {
	.halima-ps-title {
		font-size: calc(var(--halima-title-size) * 0.7);
	}

	.halima-ps-track-viewport {
		height: 380px;
	}

	.halima-ps-card {
		width: min(260px, 82vw);
		height: 340px;
	}

	.halima-ps-arrow {
		width: 40px;
		height: 40px;
	}

	.halima-ps-hover-panel {
		padding: 16px 16px 18px;
	}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.halima-ps-card,
	.halima-ps-hover-panel,
	.halima-ps-btn,
	.halima-ps-arrow,
	.halima-ps-dot {
		transition: none !important;
	}
}
