/**
 * [MARIO] v1.4 | 2026-07-24 | Feature: Phase 5 — Card redesign + slider layout
 * Client: Le Webexy | File: public/css/frontend.css
 * Change: Full rewrite. Bordered card design (image/title/price), title
 *   clamped to 2 lines with ellipsis, horizontal-scroll slider with
 *   settings-driven cards-per-view via CSS custom properties
 *   (--lwcl-cards-desktop / --lwcl-cards-mobile, set inline per-instance
 *   from LWCL_Settings — see class-lwcl-frontend.php). Still deliberately
 *   unbranded (no site colour palette applied) pending design sign-off.
 */

.lwcl-combined-listing {
	margin: 16px 0;
	clear: both;
}

.lwcl-combined-listing__label {
	font-weight: 600;
	margin: 0;
}

.lwcl-slider {
	position: relative;
}

.lwcl-slider__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.lwcl-slider__arrows {
	display: flex;
	gap: 6px;
	flex: 0 0 auto;
}

.lwcl-slider__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none;
	cursor: grab;
	touch-action: pan-y;
	width: 100%;
}

.lwcl-slider__viewport::-webkit-scrollbar {
	display: none; /* Chrome/Safari — drag + arrows are the intended controls, not a visible scrollbar */
}

.lwcl-slider__viewport.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
}

.lwcl-slider__arrow {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid #d0d0d0;
	background: #fff;
	cursor: pointer;
	font-size: 12px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.lwcl-slider__arrow:hover {
	background: #f5f5f5;
}

.lwcl-slider__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.lwcl-combined-listing__grid {
	display: flex;
	gap: 10px;
}

.lwcl-combined-listing__item,
.lwcl-combined-listing__item * {
	box-sizing: border-box;
}

.lwcl-combined-listing__item {
	display: block;
	flex: 0 0 calc( ( 100% - ( var( --lwcl-cards-desktop, 5 ) - 1 ) * 10px ) / var( --lwcl-cards-desktop, 5 ) );
	text-align: left;
	text-decoration: none;
	color: inherit;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	overflow: hidden;
	position: relative;
	background: #fff;
	user-select: none;
	-webkit-user-drag: none;
}

.lwcl-combined-listing__item.is-current {
	border-color: #333;
	border-width: 2px;
}

.lwcl-combined-listing__item.is-out-of-stock {
	opacity: 0.5;
	cursor: not-allowed;
}

.lwcl-combined-listing__thumb {
	display: block;
	aspect-ratio: 1 / 1;
	background: #f7f7f7;
	line-height: 0; /* kills the inline-image baseline gap under the thumbnail */
}

.lwcl-combined-listing__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none; /* dragging the slider shouldn't trigger native image drag-ghosting */
}

.lwcl-combined-listing__body {
	display: block;
	padding: 6px 8px 8px;
	width: 100%;
}

.lwcl-combined-listing__value {
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	max-height: calc( 1.3em * 2 ); /* Fallback for browsers without line-clamp support */
	word-break: break-word;
}

.lwcl-combined-listing__price {
	display: block;
	font-size: 12px;
	margin-top: 3px;
	line-height: 1.2;
}

.lwcl-combined-listing__price .amount {
	font-size: 12px;
}

.lwcl-combined-listing__price del {
	opacity: 0.6;
	margin-right: 3px;
}

.lwcl-combined-listing__stock-label {
	display: inline-block;
	font-size: 10px;
	color: #b32d2e;
	margin-top: 3px;
}

/* Mobile: switch to the mobile cards-per-view custom property, keep tap targets ≥44px */
@media ( max-width: 600px ) {
	.lwcl-combined-listing__item {
		flex-basis: calc( ( 100% - ( var( --lwcl-cards-mobile, 2 ) - 1 ) * 10px ) / var( --lwcl-cards-mobile, 2 ) );
	}

	.lwcl-slider__arrow {
		width: 32px;
		height: 32px;
	}
}
