/**
 * Bike Brands Scroller Styles - Mobile First
 * 
 * Responsive auto-scrolling bike brand logos with enhanced graphics
 * Uses Palette A CSS variables for consistent theming
 *
 * @package Garage_At_Home
 */

/* Palette A CSS Variables */
:root {
	--gh-bg: #0F1113;
	--gh-surface: #141618;
	--gh-accent: #C62828;
	--gh-accent-2: #FF6F61;
	--gh-text: #F5F6F7;
	--gh-muted: #BFC4C6;
}

/* Brands Section Container - Standardized */
.gh-brands-section {
	background: 
		linear-gradient(180deg, var(--gh-bg) 0%, rgba(20, 22, 24, 0.95) 100%),
		radial-gradient(circle at 50% 0%, rgba(198, 40, 40, 0.05) 0%, transparent 50%);
	padding: 2rem 0;
	position: relative;
	width: 100%;
	max-width: 100vw;
	overflow-x: hidden;
	box-sizing: border-box;
}

/* Mobile: Consistent padding */
@media (max-width: 767px) {
	.gh-brands-section {
		padding: 1.5rem 0;
	}
}

.gh-brands-section::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, rgba(198, 40, 40, 0.3) 50%, transparent 100%);
}

.gh-brands-container {
	max-width: min(1200px, 100%);
	margin: 0 auto;
	padding: 0 1rem;
	width: 100%;
	box-sizing: border-box;
}

/* Brands Header - Standardized */
.gh-brands-header {
	margin-bottom: 1.5rem;
	text-align: center;
	position: relative;
	padding: 1.5rem 1rem;
	background: 
		radial-gradient(circle at 20% 50%, rgba(198, 40, 40, 0.08) 0%, transparent 50%),
		radial-gradient(circle at 80% 50%, rgba(255, 111, 97, 0.06) 0%, transparent 50%),
		linear-gradient(180deg, transparent 0%, rgba(198, 40, 40, 0.03) 100%);
	border-radius: 12px;
	border: 1px solid rgba(198, 40, 40, 0.12);
	box-shadow: 
		inset 0 1px 2px rgba(255, 255, 255, 0.05),
		0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Mobile: Consistent spacing */
@media (max-width: 767px) {
	.gh-brands-header {
		margin-bottom: 1.25rem;
		padding: 1.25rem 0.875rem;
		border-radius: 10px;
	}
}

.gh-brands-header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(90deg, transparent 0%, var(--gh-accent) 50%, transparent 100%);
	border-radius: 16px 16px 0 0;
}

.gh-brands-title {
	font-size: 1.75rem;
	font-weight: 800;
	line-height: 1.2;
	margin: 0;
	letter-spacing: -0.5px;
	color: var(--gh-text);
	position: relative;
	display: inline-block;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile: Smaller brands title */
@media (max-width: 767px) {
	.gh-brands-title {
		font-size: 1.375rem;
	}
}

.gh-brands-title::after {
	content: '';
	position: absolute;
	bottom: -10px;
	left: 50%;
	transform: translateX(-50%);
	width: 60px;
	height: 3px;
	background: linear-gradient(90deg, var(--gh-accent) 0%, var(--gh-accent-2) 100%);
	border-radius: 2px;
	box-shadow: 0 2px 4px rgba(198, 40, 40, 0.4);
}

/* Brands Subtitle Line - Attractive Design */
.gh-brands-subtitle-line {
	margin-top: 1.5rem;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}

.gh-brands-subtitle-line::before,
.gh-brands-subtitle-line::after {
	content: '';
	flex: 1;
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, var(--gh-accent) 50%, transparent 100%);
	max-width: 80px;
}

.gh-brands-subtitle-line::before {
	background: linear-gradient(90deg, transparent 0%, var(--gh-accent) 100%);
}

.gh-brands-subtitle-line::after {
	background: linear-gradient(90deg, var(--gh-accent) 0%, transparent 100%);
}

.gh-brands-subtitle {
	font-size: 0.875rem;
	color: var(--gh-muted);
	font-weight: 400;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	position: relative;
	padding: 0 0.5rem;
}

.gh-brands-subtitle::before,
.gh-brands-subtitle::after {
	content: '◆';
	color: var(--gh-accent);
	font-size: 0.5rem;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0.6;
}

.gh-brands-subtitle::before {
	left: -0.75rem;
}

.gh-brands-subtitle::after {
	right: -0.75rem;
}

/* Brands Wrapper - Allow manual scrolling */
.gh-brands-wrapper {
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	position: relative;
	box-sizing: border-box;
	scroll-behavior: smooth;
	scrollbar-width: thin;
	scrollbar-color: var(--gh-accent) transparent;
	-webkit-overflow-scrolling: touch;
}

.gh-brands-wrapper::-webkit-scrollbar {
	height: 6px;
}

.gh-brands-wrapper::-webkit-scrollbar-track {
	background: transparent;
	border-radius: 3px;
}

.gh-brands-wrapper::-webkit-scrollbar-thumb {
	background-color: var(--gh-accent);
	border-radius: 3px;
	opacity: 0.6;
	transition: opacity 0.3s ease;
}

.gh-brands-wrapper::-webkit-scrollbar-thumb:hover {
	opacity: 1;
}

/* Brands Scroller - Mobile: 2 visible logos */
.gh-brands-scroller {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 1rem;
	width: max-content;
	padding: 0 1rem;
	margin: 0;
	list-style: none;
	box-sizing: border-box;
	scroll-snap-type: x mandatory;
}

/* Auto-scroll animation - only when autoplay is enabled */
.gh-brands-wrapper[data-autoplay="true"] .gh-brands-scroller {
	animation: scrollBrands 30s linear infinite;
}

.gh-brands-wrapper[data-autoplay="true"] .gh-brands-scroller:hover {
	animation-play-state: paused;
}

/* Pause auto-scroll when user manually scrolls */
.gh-brands-wrapper.gh-user-scrolling .gh-brands-scroller {
	animation-play-state: paused;
}

/* Brand Link */
.gh-brand-link {
	display: block;
	text-decoration: none;
	color: inherit;
	flex: 0 0 auto;
	scroll-snap-align: start;
	outline: none;
	width: 140px;
	min-width: 140px;
	max-width: 140px;
}

.gh-brand-link:focus-visible {
	outline: 3px solid var(--gh-accent);
	outline-offset: 4px;
	border-radius: 16px;
}

/* Brand Card - Enhanced Graphics with Fixed Size */
.gh-brand-card {
	background: 
		linear-gradient(135deg, rgba(245, 246, 247, 0.98) 0%, rgba(255, 255, 255, 1) 100%),
		radial-gradient(circle at 30% 20%, rgba(198, 40, 40, 0.04) 0%, transparent 50%),
		radial-gradient(circle at 70% 80%, rgba(255, 111, 97, 0.03) 0%, transparent 50%);
	border-radius: 16px;
	padding: 1.25rem 1rem 1rem;
	box-shadow: 
		inset 0 1px 3px rgba(255, 255, 255, 0.9),
		inset 0 -1px 2px rgba(0, 0, 0, 0.05),
		0 4px 12px rgba(0, 0, 0, 0.1),
		0 2px 4px rgba(0, 0, 0, 0.06);
	transition: all 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
	border: 1.5px solid rgba(198, 40, 40, 0.1);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	height: 120px;
	width: 100%;
	box-sizing: border-box;
	position: relative;
	overflow: hidden;
}

.gh-brand-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--gh-accent) 0%, var(--gh-accent-2) 100%);
	opacity: 0;
	transition: opacity 0.4s ease;
	z-index: 1;
}

.gh-brand-link:hover .gh-brand-card::before {
	opacity: 1;
}

.gh-brand-link:hover .gh-brand-card {
	transform: translateY(-4px) scale(1.02);
	background: 
		linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(245, 246, 247, 0.98) 100%),
		radial-gradient(circle at 30% 20%, rgba(198, 40, 40, 0.08) 0%, transparent 50%),
		radial-gradient(circle at 70% 80%, rgba(255, 111, 97, 0.06) 0%, transparent 50%);
	box-shadow: 
		inset 0 1px 3px rgba(255, 255, 255, 0.95),
		inset 0 -1px 2px rgba(0, 0, 0, 0.05),
		0 8px 20px rgba(198, 40, 40, 0.15),
		0 4px 8px rgba(0, 0, 0, 0.1);
	border-color: rgba(198, 40, 40, 0.25);
}

.gh-brand-link:active .gh-brand-card {
	transform: translateY(-2px) scale(1.01);
}

/* Brand Logo Wrapper - Responsive for different logo sizes */
.gh-brand-logo-wrapper {
	width: 100%;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	min-height: 48px;
	margin-bottom: 0.75rem;
	position: relative;
}

/* Brand Logo - Responsive sizing */
.gh-brand-logo {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	/* Responsive sizing for small/rectangular logos */
	min-width: 60px;
	min-height: 30px;
	/* Allow logos to scale up to fill available space */
	flex-shrink: 0;
}

/* Small logos get more space */
.gh-brand-logo[width][height] {
	/* If logo is small, scale it up proportionally */
	max-width: calc(100% - 16px);
	max-height: calc(100% - 8px);
}

/* Rectangular logos (wide) */
.gh-brand-logo[style*="width"] {
	max-width: 100%;
	max-height: 100%;
}

.gh-brand-placeholder {
	opacity: 0.6;
	filter: grayscale(0.3);
}

/* Brand Placeholder Text */
.gh-brand-placeholder-text {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, rgba(198, 40, 40, 0.12) 0%, rgba(255, 111, 97, 0.1) 100%);
	border-radius: 8px;
	min-height: 48px;
}

.gh-brand-placeholder-text span {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--gh-bg);
	text-align: center;
	line-height: 1.2;
	padding: 0.25rem;
}

/* Brand Name - Below Logo */
.gh-brand-name {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--gh-bg);
	text-align: center;
	line-height: 1.3;
	margin-top: auto;
	padding-top: 0.5rem;
	border-top: 1px solid rgba(198, 40, 40, 0.1);
	width: 100%;
	letter-spacing: 0.2px;
	transition: color 0.3s ease;
}

.gh-brand-link:hover .gh-brand-name {
	color: var(--gh-accent);
}

/* Tablet Layout - 4 visible logos */
@media (min-width: 768px) {
	.gh-brands-section {
		padding: 4.5rem 0;
	}
	
	.gh-brands-container {
		padding: 0 2rem;
		max-width: min(1200px, calc(100% - 4rem));
	}
	
	.gh-brands-header {
		margin-bottom: 3rem;
		padding: 2.5rem 1.5rem;
		border-radius: 20px;
	}
	
	.gh-brands-title {
		font-size: 2.25rem;
	}
	
	.gh-brands-title::after {
		width: 80px;
		height: 4px;
		bottom: -12px;
	}
	
	.gh-brands-scroller {
		gap: 1.5rem;
		padding: 0 1.5rem;
		animation-duration: 35s;
	}
	
	.gh-brands-subtitle {
		font-size: 0.9375rem;
	}
	
	.gh-brands-subtitle-line {
		margin-top: 1.75rem;
	}
	
	.gh-brand-link {
		width: 170px;
		min-width: 170px;
		max-width: 170px;
	}
	
	.gh-brand-card {
		padding: 1.5rem 1.25rem 1.25rem;
		height: 140px;
		border-radius: 18px;
	}
	
	.gh-brand-logo-wrapper {
		height: 80px;
		margin-bottom: 0.875rem;
	}
	
	.gh-brand-logo {
		min-width: 80px;
		min-height: 40px;
	}
	
	.gh-brand-name {
		font-size: 0.8125rem;
		padding-top: 0.625rem;
	}
	
	.gh-brand-placeholder-text span {
		font-size: 0.875rem;
	}
}

/* Desktop Layout - 6+ visible logos */
@media (min-width: 1024px) {
	.gh-brands-section {
		padding: 5.5rem 0;
	}
	
	.gh-brands-container {
		padding: 0 2rem;
		max-width: min(1200px, calc(100% - 4rem));
	}
	
	.gh-brands-header {
		margin-bottom: 3.5rem;
		padding: 3rem 2rem;
		border-radius: 24px;
	}
	
	.gh-brands-title {
		font-size: 2.5rem;
	}
	
	.gh-brands-title::after {
		width: 100px;
		height: 4px;
		bottom: -14px;
	}
	
	.gh-brands-subtitle {
		font-size: 1rem;
	}
	
	.gh-brands-subtitle-line {
		margin-top: 2rem;
	}
	
	.gh-brands-subtitle-line::before,
	.gh-brands-subtitle-line::after {
		max-width: 120px;
	}
	
	.gh-brands-scroller {
		gap: 2rem;
		padding: 0 2rem;
		animation-duration: 40s;
	}
	
	.gh-brand-link {
		width: 200px;
		min-width: 200px;
		max-width: 200px;
	}
	
	.gh-brand-card {
		padding: 1.75rem 1.5rem 1.5rem;
		height: 160px;
		border-radius: 20px;
	}
	
	.gh-brand-logo-wrapper {
		height: 90px;
		margin-bottom: 1rem;
	}
	
	.gh-brand-logo {
		min-width: 100px;
		min-height: 50px;
	}
	
	.gh-brand-name {
		font-size: 0.875rem;
		padding-top: 0.75rem;
		font-weight: 700;
	}
	
	.gh-brand-placeholder-text span {
		font-size: 1rem;
	}
}

/* Large Desktop */
@media (min-width: 1280px) {
	.gh-brands-scroller {
		gap: 2.5rem;
	}
	
	.gh-brand-link {
		width: 220px;
		min-width: 220px;
		max-width: 220px;
	}
	
	.gh-brand-card {
		padding: 2rem 1.75rem 1.75rem;
		height: 180px;
	}
	
	.gh-brand-logo-wrapper {
		height: 100px;
	}
	
	.gh-brand-logo {
		min-width: 120px;
		min-height: 60px;
	}
	
	.gh-brand-name {
		font-size: 0.9375rem;
	}
}

/* Small Mobile */
@media (max-width: 480px) {
	.gh-brands-section {
		padding: 2.5rem 0;
	}
	
	.gh-brands-container {
		padding: 0 1rem;
		max-width: calc(100% - 2rem);
	}
	
	.gh-brands-header {
		margin-bottom: 2rem;
		padding: 1.75rem 1rem;
		border-radius: 14px;
	}
	
	.gh-brands-title {
		font-size: 1.5rem;
	}
	
	.gh-brands-title::after {
		width: 50px;
		height: 2px;
		bottom: -8px;
	}
	
	.gh-brands-subtitle {
		font-size: 0.75rem;
	}
	
	.gh-brands-subtitle-line {
		margin-top: 1.25rem;
		gap: 0.75rem;
	}
	
	.gh-brands-subtitle-line::before,
	.gh-brands-subtitle-line::after {
		max-width: 50px;
	}
	
	.gh-brands-scroller {
		gap: 0.875rem;
		padding: 0 0.875rem;
		animation-duration: 28s;
	}
	
	.gh-brand-link {
		width: 120px;
		min-width: 120px;
		max-width: 120px;
	}
	
	.gh-brand-card {
		padding: 1rem 0.875rem 0.875rem;
		height: 110px;
		border-radius: 14px;
	}
	
	.gh-brand-logo-wrapper {
		height: 56px;
		margin-bottom: 0.625rem;
		min-height: 40px;
	}
	
	.gh-brand-logo {
		min-width: 50px;
		min-height: 25px;
	}
	
	.gh-brand-name {
		font-size: 0.6875rem;
		padding-top: 0.5rem;
	}
	
	.gh-brand-placeholder-text span {
		font-size: 0.6875rem;
	}
}

/* Auto-scroll animation */
@keyframes scrollBrands {
	0% {
		transform: translateX(0);
	}
	100% {
		transform: translateX(calc(-50% - 1rem));
	}
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
	.gh-brands-scroller {
		animation: none;
	}
	
	.gh-brand-card {
		transition: none;
	}
}

/* Keyboard Navigation Enhancement */
.gh-brand-link:focus-visible {
	outline: 3px solid var(--gh-accent);
	outline-offset: 4px;
	border-radius: 16px;
}
