/**
 * SliderMax Frontend Styles
 *
 * Styles for frontend slider display - Sephora-style Product Carousel.
 *
 * @package SliderMax
 * @since 1.0.0
 */

/* ==========================================================================
   Base Slider Styles
   ========================================================================== */

.slidermax-slider {
	position: relative;
	width: 100%;
	max-width: 100%;
	overflow: visible;
	margin: 0;
	padding-top: 20px;
	padding-bottom: 20px;
	box-sizing: border-box;
}

.slidermax-slider * {
	box-sizing: border-box;
}

/* Slider Viewport */
.slidermax-viewport {
	position: relative;
	width: 100vw;
	margin-left: calc(-50vw + 50%);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: auto;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE and Edge */
	box-sizing: border-box;
	-webkit-user-select: none;
	user-select: none;
	padding: 0;
	touch-action: none; /* Disable native touch scrolling, use custom handling */
	will-change: scroll-position;
	overscroll-behavior-x: none; /* Prevent overscroll on modern browsers */
	-webkit-overscroll-behavior-x: none; /* Safari/WebKit */
	-webkit-overflow-scrolling: auto; /* Disable momentum scrolling on iOS */
}

.slidermax-viewport::-webkit-scrollbar {
	display: none; /* Chrome, Safari, Opera */
}

/* Mobile-specific overscroll prevention */
@media (max-width: 768px) {
	.slidermax-viewport {
		-webkit-overflow-scrolling: auto !important; /* Force disable momentum scrolling */
		overscroll-behavior: none !important;
		-webkit-overscroll-behavior: none !important;
		touch-action: none !important;
	}
	
	/* Prevent page-level overscroll when interacting with slider */
	body.touched-slidermax,
	html.touched-slidermax {
		overscroll-behavior: none !important;
		-webkit-overscroll-behavior: none !important;
		touch-action: none !important;
	}
}

/* Padding Wrapper - Controls horizontal spacing */
.slidermax-padding-wrapper {
	display: flex;
	flex-direction: column;
	width: 100%;
	box-sizing: border-box;
}

/* Slider Track */
.slidermax-track {
	display: flex;
	gap: 0; /* Controlled by inline style */
	padding: 0;
	transition: none !important; /* Disable JS transitions */
	transform: none !important; /* Disable JS transforms */
	width: max-content;
	box-sizing: border-box;
	flex-wrap: nowrap;
}

/* Individual Slide */
.slidermax-slide {
	/* Width and flex set inline via admin setting */
	margin: 0;
	transition: opacity 0.3s ease;
	min-width: 0; /* Allow shrinking below content size */
	max-width: none; /* Remove any max-width constraints */
}

/* ==========================================================================
   Product Card Styles (Sephora-inspired)
   ========================================================================== */

.slidermax-product-card {
	background: #fff;
	border: 0 solid #e5e5e5; /* Border width and radius controlled by inline style */
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.2s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	position: relative;
	box-shadow: none; /* Controlled by inline style if needed */
}

.slidermax-product-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
	border-color: #d0d0d0;
}

/* Product Image */
.slidermax-product-image {
	position: relative;
	width: 100%;
	height: 180px; /* Default, controlled by inline style */
	background: #fafafa;
	overflow: hidden;
	border-radius: 0;
	margin-bottom: 0; /* Controlled by inline style */
}

.slidermax-product-image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slidermax-product-card:hover .slidermax-product-image img {
	transform: scale(1.05);
}

/* Product Content */
.slidermax-product-content {
	padding: 0; /* Controlled by inline style */
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 100%;
	overflow: hidden;
}

.slidermax-product-brand {
	font-size: 11px;
	color: #000;
	text-transform: none;
	letter-spacing: 0.01em;
	margin: 0;
	font-weight: 600;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.slidermax-product-title {
	font-size: 11px;
	color: #333;
	font-weight: 400;
	margin: 0;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 30px;
	word-wrap: break-word;
	max-width: 100%;
}

/* Price */
.slidermax-product-price {
	margin: 4px 0 0 0;
	font-weight: 700;
	font-size: 13px;
	color: #000;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.slidermax-product-price .woocommerce-Price-amount {
	font-weight: 700;
	color: #000;
}

.slidermax-price {
	margin: 0;
	font-weight: 700;
	font-size: 14px;
}

.slidermax-price-single {
	color: #000;
}

.slidermax-sale-price {
	color: #cc0000;
	margin-right: 6px;
	font-weight: 700;
}

.slidermax-regular-price {
	color: #999;
	text-decoration: line-through;
	font-size: 12px;
	font-weight: 400;
}

/* Rating and Reviews */
.slidermax-rating-wrapper {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 6px 0 0 0;
}

.slidermax-stars {
	position: relative;
	display: inline-flex;
	line-height: 1;
	font-size: 10px;
	color: #ddd;
	gap: 1px;
}

.slidermax-stars-empty {
	display: flex;
	gap: 1px;
}

.slidermax-stars-filled {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
	color: #000;
	display: flex;
	gap: 1px;
}

.slidermax-star {
	display: inline-block;
	font-size: 12px;
}

.slidermax-reviews {
	font-size: 9px;
	color: #666;
	white-space: nowrap;
}

/* Image Card Styles */
.slidermax-image-card {
	background: #f5f5f5;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.2s ease;
	height: 100%;
	position: relative;
	box-shadow: none; /* Controlled by inline style if needed */
	display: block;
	width: 100%;
}

.slidermax-image-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.slidermax-image-card img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slidermax-image-card:hover img {
	transform: scale(1.05);
}

/* ==========================================================================
   Circle Card Style
   ========================================================================== */

.slidermax-product-card--circle {
	background: transparent;
	border: none;
	border-radius: 0;
	overflow: visible;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: auto;
	text-decoration: none;
	position: relative;
	box-shadow: none;
}

.slidermax-product-card--circle:hover {
	transform: none;
	box-shadow: none;
	border-color: transparent;
}

.slidermax-product-card--circle .slidermax-product-image {
	width: 100%;
	border-radius: 50%;
	overflow: hidden;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
	aspect-ratio: 1 / 1;
	flex-shrink: 0;
}

.slidermax-product-card--circle .slidermax-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.slidermax-product-card--circle:hover .slidermax-product-image img {
	transform: scale(1.08);
}

.slidermax-product-card--circle .slidermax-product-content {
	width: 100%;
	padding: 0;
	text-align: center;
}

.slidermax-product-card--circle .slidermax-product-title {
	margin: 0 0 4px 0;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
}

.slidermax-product-card--circle .slidermax-product-description {
	display: none;
}

.slidermax-product-card--circle .slidermax-product-price {
	margin: 4px 0;
	font-size: 14px;
	font-weight: 600;
	color: #333;
}

.slidermax-product-card--circle .slidermax-rating-wrapper {
	margin-top: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

/* ==========================================================================
   Brand Card Styles
   ========================================================================== */

.slidermax-brand-card {
	background: #fff;
	border: 0 solid #e5e5e5; /* Border width and radius controlled by inline style */
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.2s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	position: relative;
	box-shadow: none; /* Controlled by inline style if needed */
}

.slidermax-brand-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
	border-color: #d0d0d0;
}

/* Brand Image */
.slidermax-brand-image {
	position: relative;
	width: 100%;
	background: #fafafa;
	overflow: hidden;
	border-radius: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.slidermax-brand-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
	display: block;
}

.slidermax-brand-card:hover .slidermax-brand-image img {
	transform: scale(1.05);
}

/* Brand Content */
.slidermax-brand-content {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.slidermax-brand-name {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: #333;
}

/* ==========================================================================
   Circle Brand Card Style
   ========================================================================== */

.slidermax-brand-card--circle {
	background: transparent;
	border: none;
	border-radius: 0;
	overflow: visible;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: auto;
	text-decoration: none;
	position: relative;
	box-shadow: none;
}

.slidermax-brand-card--circle:hover {
	transform: none;
	box-shadow: none;
	border-color: transparent;
}

.slidermax-brand-card--circle .slidermax-brand-image {
	width: 100%;
	border-radius: 50%;
	overflow: hidden;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
	aspect-ratio: 1 / 1;
	flex-shrink: 0;
}

.slidermax-brand-card--circle .slidermax-brand-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.slidermax-brand-card--circle:hover .slidermax-brand-image img {
	transform: scale(1.08);
}

.slidermax-brand-card--circle .slidermax-brand-content {
	width: 100%;
	padding: 0;
	text-align: center;
}

.slidermax-brand-card--circle .slidermax-brand-name {
	margin: 0;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	color: #333;
}

/* ==========================================================================
   Navigation Controls
   ========================================================================== */

/* Arrow Buttons - Hidden on mobile, visible on desktop */
.slidermax-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid #e0e0e0;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: none !important; /* Hidden - using native scroll */
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slidermax-arrow:hover {
	background: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	border-color: #999;
}

.slidermax-arrow.slidermax-disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

.slidermax-prev {
	left: 10px;
}

.slidermax-next {
	right: 10px;
}

.slidermax-arrow svg {
	width: 18px;
	height: 18px;
	fill: #333;
}

.slidermax-prev svg {
	transform: rotate(180deg);
}

/* Dots Navigation - Hidden by default */
.slidermax-dots {
	display: none;
	justify-content: center;
	gap: 6px;
	margin-top: 15px;
	padding: 0;
	list-style: none;
}

.slidermax-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ddd;
	border: none;
	padding: 0;
	cursor: pointer;
	transition: all 0.3s ease;
}

.slidermax-dot:hover {
	background: #999;
}

.slidermax-dot.slidermax-active {
	background: #333;
	width: 24px;
	border-radius: 5px;
}

/* ==========================================================================
   Basic Slider Type (Fade Effect)
   ========================================================================== */

.slidermax-slider.slidermax-basic .slidermax-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	opacity: 0;
	transition: opacity 0.5s ease-in-out;
	pointer-events: none;
}

.slidermax-slider.slidermax-basic .slidermax-slide.slidermax-active {
	opacity: 1;
	position: relative;
	pointer-events: auto;
}

/* ==========================================================================
   Hero Slider Type
   ========================================================================== */

.slidermax-hero-slide {
	position: relative;
	min-height: 400px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-size: cover;
	background-position: center;
	color: #fff;
}

.slidermax-hero-content {
	text-align: center;
	max-width: 600px;
	padding: 40px;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 8px;
}

.slidermax-hero-title {
	font-size: 36px;
	font-weight: 700;
	margin-bottom: 15px;
	line-height: 1.2;
}

.slidermax-hero-caption {
	font-size: 18px;
	margin-bottom: 20px;
	line-height: 1.5;
}

.slidermax-hero-button {
	display: inline-block;
	padding: 12px 30px;
	background: #fff;
	color: #333;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
	transition: all 0.3s ease;
}

.slidermax-hero-button:hover {
	background: #f0f0f0;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Error Message
   ========================================================================== */

.slidermax-error {
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	padding: 15px;
	margin: 20px 0;
}

.slidermax-error p {
	margin: 0;
	color: #856404;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1200px) {
	.slidermax-slide {
		width: 33.333% !important;
	}
}

@media (max-width: 992px) {
	.slidermax-slide {
		width: 50% !important;
	}
	
	.slidermax-prev {
		left: 10px;
	}
	
	.slidermax-next {
		right: 10px;
	}
	
	.slidermax-hero-title {
		font-size: 28px;
	}
	
	.slidermax-hero-caption {
		font-size: 16px;
	}
}

@media (max-width: 768px) {
	.slidermax-slide {
		width: 100% !important;
		/* padding controlled by inline style */
	}
	
	.slidermax-product-title {
		font-size: 13px;
		min-height: 36px;
	}
	
	.slidermax-product-content {
		/* padding controlled by inline style */
	}
	
	.slidermax-arrow {
		width: 36px;
		height: 36px;
	}
	
	.slidermax-arrow svg {
		width: 16px;
		height: 16px;
	}
	
	.slidermax-hero-content {
		padding: 30px 20px;
	}
	
	.slidermax-hero-title {
		font-size: 24px;
	}
	
	.slidermax-hero-caption {
		font-size: 14px;
	}
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.slidermax-slider.slidermax-loading {
	min-height: 300px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f9f9f9;
}

.slidermax-loading-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #333;
	border-radius: 50%;
	animation: slidermax-spin 1s linear infinite;
}

@keyframes slidermax-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.slidermax-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Focus Styles */
.slidermax-arrow:focus,
.slidermax-dot:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.slidermax-product-card:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}
/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Mobile First - Default styles above are for mobile */

/* Small Mobile (320px+) */
@media (min-width: 320px) {
	.slidermax-track {
		padding: 0 12px;
	}
}

/* Mobile (375px+) */
@media (min-width: 375px) {
	.slidermax-track {
		/* Gap controlled by inline style */
	}
	
	.slidermax-product-brand {
		font-size: 12px;
	}
	
	.slidermax-product-title {
		font-size: 12px;
	}
	
	.slidermax-product-price {
		font-size: 14px;
	}
}

/* Large Mobile (425px+) */
@media (min-width: 425px) {
	.slidermax-product-title {
		font-size: 13px;
	}
}

/* Tablet (768px+) */
@media (min-width: 768px) {
	.slidermax-track {
		/* padding controlled by gap setting */
	}
	
	.slidermax-product-brand {
		font-size: 13px;
	}
	
	.slidermax-product-title {
		font-size: 13px;
		min-height: 36px;
	}
	
	.slidermax-product-price {
		font-size: 15px;
	}
	
	.slidermax-product-content {
		gap: 8px;
	}
	
	/* Keep arrows hidden - using native scroll */
	.slidermax-arrow {
		display: none !important;
	}
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
	.slidermax-track {
		/* padding controlled by gap setting */
	}
	
	.slidermax-product-brand {
		font-size: 14px;
	}
	
	.slidermax-product-title {
		font-size: 14px;
	}
	
	.slidermax-product-price {
		font-size: 16px;
	}
	
	.slidermax-product-content {
		gap: 8px;
	}
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
	.slidermax-track {
		padding: 0 24px;
	}
	
	.slidermax-product-brand {
		font-size: 15px;
	}
	
	.slidermax-product-title {
		font-size: 15px;
	}
}

/* Extra Large Desktop (1920px+) */
@media (min-width: 1920px) {
	/* Width controlled by admin setting */
}

/* ==========================================================================
   View More Button Styles
   ========================================================================== */

.slidermax-button-wrapper {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	max-width: 100%;
	padding: 20px 20px 15px;
	margin: 10px auto 0;
	box-sizing: border-box;
	text-align: center;
}

.slidermax-view-more-button {
	display: inline-block;
	font-size: 16px;
	font-weight: 600;
	text-decoration: underline;
	color: #333;
	background: none;
	border: none;
	cursor: pointer;
	transition: color 0.2s ease;
	padding: 0;
	text-align: center;
	margin: 0 auto;
}

.slidermax-view-more-button:hover {
	color: #666;
}

.slidermax-view-more-button:active {
	color: #333;
}

/* Mobile Button Styles */
@media (max-width: 768px) {
	.slidermax-button-wrapper {
		padding: 15px 15px 12px;
		justify-content: center;
	}

	.slidermax-view-more-button {
		font-size: 14px;
	}
}

/* Tablet Button Styles */
@media (min-width: 769px) and (max-width: 1023px) {
	.slidermax-button-wrapper {
		padding: 18px 20px 12px;
		justify-content: center;
	}

	.slidermax-view-more-button {
		font-size: 15px;
	}
}