/**
 * Vehicle Categories Showcase Stylesheet
 * Horizontal Traders - Perth Vehicle Hire
 *
 * Implements pixel-perfect desktop 5-column grid and mobile horizontal scroll snap carousel
 * with custom highway ribbon background, rounded cards, and interactive hover states.
 */

/* ==========================================================================
   1. Section Layout & Background Decoration
   ========================================================================== */

.ht-category-section {
	position: relative;
	background: linear-gradient(180deg, #f0f8fa 0%, #f5f9fb 50%, #ffffff 100%);
	padding: 3.25rem 0 2rem;
	overflow: hidden;
	z-index: 5;
}

.ht-category-section__bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: hidden;
	z-index: 1;
}

.ht-category-section__bg-road {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 100%;
	min-width: 1200px;
	height: 320px;
	opacity: 0.85;
}

.ht-category-section .ht-container {
	position: relative;
	z-index: 2;
	max-width: 1380px;
	margin: 0 auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

/* ==========================================================================
   2. Section Header
   ========================================================================== */

.ht-category-section__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
	margin-bottom: 2.25rem;
}

.ht-category-section__title-wrap {
	display: flex;
	flex-direction: column;
}

.ht-category-section__eyebrow {
	display: block;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	font-size: 0.8125rem;
	font-weight: 700;
	color: #01757f;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	margin-bottom: 0.45rem;
}

.ht-category-section__heading {
	font-family: 'Manrope', 'Inter', system-ui, sans-serif;
	font-size: clamp(2rem, 3.2vw, 2.75rem);
	font-weight: 800;
	color: #00152e;
	line-height: 1.15;
	letter-spacing: -0.025em;
	margin: 0;
}

.ht-category-section__heading-line {
	display: block;
	color: #00152e;
}

.ht-category-section__highlight {
	display: inline;
	color: #01757f;
}

/* Section Description (Desktop & Tablet) */
.ht-category-section__desc {
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	font-size: 0.95rem;
	color: #4b6375;
	line-height: 1.55;
	margin-top: 0.65rem;
	margin-bottom: 0;
	max-width: 620px;
}

/* View All Link */
.ht-category-section__view-all {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 0.95rem;
	font-weight: 700;
	color: #01757f;
	text-decoration: none;
	padding: 0.35rem 0;
	white-space: nowrap;
	transition: color 0.2s ease, transform 0.2s ease;
	margin-bottom: 0.35rem;
}

.ht-category-section__view-all:hover {
	color: #02667c;
	transform: translateX(3px);
}

.ht-category-section__view-all-arrow {
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	flex-shrink: 0;
}

.ht-category-section__view-all:hover .ht-category-section__view-all-arrow {
	transform: translateX(4px);
}

.ht-view-all-text-desktop {
	display: inline;
}

.ht-view-all-text-mobile {
	display: none;
}

.ht-cat-header-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-shrink: 0;
}

.ht-cat-slider-nav {
	display: none;
	align-items: center;
	gap: 0.5rem;
}

.ht-cat-slider-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1.5px solid #d2e3eb;
	background: #ffffff;
	color: #00152e;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 2px 6px rgba(0, 21, 46, 0.05);
	padding: 0;
}

.ht-cat-slider-btn:hover {
	border-color: #01757f;
	background: #01757f;
	color: #ffffff;
	transform: scale(1.08);
	box-shadow: 0 4px 12px rgba(1, 117, 127, 0.3);
}

.ht-category-carousel-wrap {
	width: 100%;
}

.ht-category-cards-track {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 1.15rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.ht-category-card-item {
	display: flex;
	height: 100%;
}

/* ==========================================================================
   4. Category Card Styling
   ========================================================================== */

.ht-category-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: #ffffff;
	border: 1px solid #d2e3eb;
	border-radius: 16px;
	padding: 0.95rem 0.95rem 1.15rem 0.95rem;
	text-decoration: none;
	color: inherit;
	box-shadow:
		0 4px 18px -2px rgba(0, 21, 46, 0.05),
		0 2px 6px -1px rgba(0, 21, 46, 0.02);
	transition:
		transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
		box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
		border-color 0.25s ease;
	position: relative;
	cursor: pointer;
}

.ht-category-card:hover {
	transform: translateY(-6px);
	box-shadow:
		0 18px 36px -4px rgba(0, 21, 46, 0.12),
		0 6px 16px -2px rgba(0, 21, 46, 0.05);
	border-color: #06c1d5;
}

/* Inner Car Image Box */
.ht-category-card__img-box {
	background: #f0f8fa;
	border-radius: 12px;
	aspect-ratio: 16 / 11;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 0.5rem;
	position: relative;
}

.ht-category-card__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ht-category-card:hover .ht-category-card__img {
	transform: scale(1.05);
}

/* Card Body */
.ht-category-card__body {
	display: flex;
	flex-direction: column;
	padding: 0.85rem 0.25rem 0.25rem;
	flex-grow: 1;
}

.ht-category-card__title {
	font-family: 'Manrope', 'Inter', system-ui, sans-serif;
	font-size: 1.125rem;
	font-weight: 700;
	color: #00152e;
	line-height: 1.25;
	letter-spacing: -0.015em;
	margin: 0 0 0.35rem 0;
	transition: color 0.2s ease;
}

.ht-category-card:hover .ht-category-card__title {
	color: #01757f;
}

.ht-category-card__desc {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 0.84rem;
	color: #4b6375;
	line-height: 1.42;
	margin: 0;
	min-height: 38px;
}

/* Card Footer */
.ht-category-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 0.25rem 0;
	margin-top: auto;
	border-top: 1px solid #eef6f9;
}

.ht-category-card__action-text {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 0.9rem;
	font-weight: 700;
	color: #01757f;
	transition: color 0.2s ease;
}

.ht-category-card__circle-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1.5px solid #d2e3eb;
	background: #ffffff;
	color: #01757f;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition:
		background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
		border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
		color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ht-category-card:hover .ht-category-card__circle-btn {
	background: #01757f;
	border-color: #01757f;
	color: #ffffff;
	transform: translateX(3px);
}

/* ==========================================================================
   5. Tablet Breakpoint (769px - 1100px)
   ========================================================================== */

@media (max-width: 1024px) and (min-width: 769px) {
	.ht-category-cards-track {
		grid-template-columns: repeat(3, 1fr);
		gap: 1rem;
	}
	.ht-category-card-item:nth-child(4),
	.ht-category-card-item:nth-child(5) {
		grid-column: span 1;
	}
	.ht-category-card__title {
		font-size: 1.05rem;
	}
	.ht-category-card__desc {
		font-size: 0.8125rem;
	}
}

/* ==========================================================================
   6. Mobile Carousel & Scroll Snap (max-width: 768px)
   Matching User Reference Image uploaded_media_1_1788636940375.png
   ========================================================================== */

@media (max-width: 768px) {
	.ht-category-section {
		padding: 2.25rem 0 1.5rem;
	}

	.ht-category-section .ht-container {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.ht-category-section__header {
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		gap: 0.5rem;
		margin-bottom: 1.15rem;
	}

	.ht-category-section__eyebrow {
		font-size: 0.6875rem;
		letter-spacing: 0.14em;
		margin-bottom: 0.25rem;
	}

	.ht-category-section__heading {
		font-size: clamp(1.35rem, 5.2vw, 1.7rem);
		line-height: 1.14;
		letter-spacing: -0.02em;
	}

	.ht-category-section__desc {
		display: none;
	}

	/* Compact View All on Mobile */
	.ht-view-all-text-desktop {
		display: none;
	}

	.ht-view-all-text-mobile {
		display: inline;
	}

	.ht-category-section__view-all {
		font-size: 0.82rem;
		font-weight: 700;
		gap: 0.25rem;
		margin-bottom: 0.15rem;
		flex-shrink: 0;
	}

	.ht-category-section__view-all-arrow {
		width: 15px;
		height: 15px;
	}

	/* Horizontal Scroll Snap Track with Mobile Overflow Peek */
	.ht-category-cards-track {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		scroll-behavior: smooth;
		-webkit-overflow-scrolling: touch;
		gap: 0.75rem;
		padding: 0.35rem 1rem 1.25rem 1rem;
		margin: 0 -1rem;
		scrollbar-width: none; /* Firefox */
		cursor: grab;
	}

	.ht-category-cards-track.ht-is-dragging {
		cursor: grabbing;
		user-select: none;
		scroll-snap-type: none;
	}

	.ht-category-cards-track::-webkit-scrollbar {
		display: none; /* Chrome, Safari */
	}

	/* Card Item Width: Perfectly calibrated so Card 1 & 2 are 100% visible, and Card 3 peeks */
	.ht-category-card-item {
		flex: 0 0 clamp(170px, 47vw, 200px);
		max-width: clamp(170px, 47vw, 200px);
		scroll-snap-align: start;
	}

	.ht-category-card {
		padding: 0.8rem 0.8rem 0.95rem 0.8rem;
		border-radius: 16px;
		border-color: #e2e8f0;
		box-shadow:
			0 3px 14px -2px rgba(0, 21, 46, 0.06),
			0 1px 4px -1px rgba(0, 21, 46, 0.02);
	}

	.ht-category-card__img-box {
		border-radius: 11px;
		padding: 0.35rem;
		aspect-ratio: 16 / 11;
	}

	.ht-category-card__body {
		padding: 0.65rem 0.15rem 0.15rem 0.15rem;
	}

	.ht-category-card__title {
		font-size: 0.98rem;
		line-height: 1.25;
		margin-bottom: 0.25rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.ht-category-card__desc {
		font-size: 0.78rem;
		line-height: 1.36;
		color: #64748b;
		min-height: 32px;
	}

	.ht-category-card__footer {
		padding: 0.55rem 0.1rem 0 0.1rem;
		border-top: 1px solid #f1f5f9;
	}

	.ht-category-card__action-text {
		font-size: 0.82rem;
		font-weight: 700;
	}

	.ht-category-card__circle-btn {
		width: 30px;
		height: 30px;
	}

	.ht-category-card__circle-btn svg {
		width: 13px;
		height: 13px;
	}
}

@media (max-width: 380px) {
	.ht-category-card-item {
		flex: 0 0 160px;
		max-width: 160px;
	}

	.ht-category-section__heading {
		font-size: 1.3rem;
	}
}

/* ==========================================================================
   7. Premium Fade-In-Up Staggered Animation Engine
   Silky smooth, high-end hardware-accelerated scroll reveal
   ========================================================================== */

.ht-animated-ready .ht-category-section__header {
	opacity: 0;
	transform: translateY(28px);
	transition:
		opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
	will-change: opacity, transform;
}

.ht-animated-ready .ht-category-card-item {
	opacity: 0;
	transform: translateY(36px);
	transition:
		opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
	will-change: opacity, transform;
}

/* Staggered Entrance Delays for the 5 Cards */
.ht-animated-ready.ht-is-visible .ht-category-section__header {
	opacity: 1;
	transform: translateY(0);
}

.ht-animated-ready.ht-is-visible .ht-category-card-item:nth-child(1) {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.1s;
}

.ht-animated-ready.ht-is-visible .ht-category-card-item:nth-child(2) {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.2s;
}

.ht-animated-ready.ht-is-visible .ht-category-card-item:nth-child(3) {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.3s;
}

.ht-animated-ready.ht-is-visible .ht-category-card-item:nth-child(4) {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.4s;
}

.ht-animated-ready.ht-is-visible .ht-category-card-item:nth-child(5) {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0.5s;
}

/* Accessibility: Respect Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
	.ht-animated-ready .ht-category-section__header,
	.ht-animated-ready .ht-category-card-item {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}
