/* ============================================================
   Tomato Lab Shop Facade — inherits theme font/color scheme
   ============================================================ */

/* Product grid
   ---------------------------------------------------------- */
.tlf-product-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
	gap: 1.5rem;
	margin: 1.5rem 0;
}

.tlf-product {
	display: flex;
	flex-direction: column;
}

/* Image slider
   ---------------------------------------------------------- */
.tlf-slider {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #111;
}

/* Transparent cover link — makes the whole image clickable.
   Sits above slides (z-index 1) but below nav buttons (z-index 2). */
.tlf-img-cover-link {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	z-index: 1;
	display: block;
}

/* All slides hidden until JS reveals them after the image fully loads.
   display:none keeps them out of layout AND out of reach of lazy-load
   polyfills that would cause the progressive-render flash. */
.tlf-slider .tlf-slide {
	display: none;
	position: absolute;
	top: 0; left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
}

.tlf-no-image {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background: #222;
}

/* Prev / next arrows
   !important on visual props defeats Bootstrap's button reset */
.tlf-slide-btn {
	all: unset;
	box-sizing: border-box !important;
	position: absolute !important;
	top: 50% !important;
	transform: translateY( -50% ) !important;
	z-index: 2 !important;
	width: 32px !important;
	height: 32px !important;
	border-radius: 50% !important;
	background: rgba( 0, 0, 0, 0.45 ) !important;
	background-image: none !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
	color: #fff !important;
	font-size: 1.3rem !important;
	line-height: 1 !important;
	padding: 0 !important;
	margin: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	user-select: none !important;
	opacity: 0 !important;
	transition: opacity 0.15s !important;
}

.tlf-slider:hover .tlf-slide-btn {
	opacity: 1 !important;
}

.tlf-slide-prev { left: 8px !important; }
.tlf-slide-next { right: 8px !important; }

/* Dot indicators */
.tlf-dots {
	position: absolute;
	bottom: 8px;
	left: 50%;
	transform: translateX( -50% );
	display: flex;
	gap: 5px;
	z-index: 2;
	pointer-events: none;
}

.tlf-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.4 );
	transition: background 0.15s;
}

.tlf-dot.active {
	background: #fff;
}

/* Product info below image
   ---------------------------------------------------------- */
.tlf-product-info {
	padding: 0.6rem 0 0;
}

.tlf-product-name {
	font-size: 0.9rem;
	font-weight: 500;
	margin: 0 0 0.2rem;
	line-height: 1.35;
}

.tlf-product-name a {
	font-family: sans-serif;
	color: inherit;
	text-decoration: none;
}

.tlf-product-name a:hover {
	opacity: 0.7;
}

.tlf-product-price {
	font-family: sans-serif;
	font-size: 0.9rem;
	font-weight: 400;
	margin: 0;
	color: #bbb;
}

/* Cart table
   ---------------------------------------------------------- */
.tlf-cart {
	margin: 1.5rem 0;
}

.tlf-cart-empty {
	color: #999;
	font-style: italic;
}

.tlf-cart-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1rem;
}

.tlf-cart-table th,
.tlf-cart-table td {
	padding: 0.7rem 0.5rem;
	border-bottom: 1px solid rgba( 255, 255, 255, 0.12 );
	text-align: left;
	vertical-align: middle;
}

.tlf-cart-table th {
	font-weight: 600;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #aaa;
	border-bottom-color: rgba( 255, 255, 255, 0.25 );
}

.tlf-cart-product {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.tlf-cart-product img {
	flex-shrink: 0;
	object-fit: cover;
}

.tlf-cart-qty {
	width: 52px;
	padding: 0.3rem 0.4rem;
	border: 1px solid rgba( 255, 255, 255, 0.25 );
	background: transparent;
	color: inherit;
	text-align: center;
}

.tlf-remove-item {
	background: none;
	border: none;
	cursor: pointer;
	color: #666;
	font-size: 1rem;
	padding: 0.2rem 0.4rem;
	line-height: 1;
}

.tlf-remove-item:hover { color: #c00; }

.tlf-cart-footer {
	text-align: right;
	margin-top: 0.5rem;
}

.tlf-cart-total {
	font-size: 1.1rem;
	margin-bottom: 0.75rem;
}

.tlf-checkout-btn {
	padding: 0.65rem 1.5rem;
	background: #0049ff;
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 600;
	transition: background 0.15s;
}

.tlf-checkout-btn:hover { background: #003acc; }
.tlf-checkout-btn:disabled { background: #555; }

.tlf-checkout-note {
	font-size: 0.78rem;
	color: #888;
	margin-top: 0.5rem;
}

.tlf-checkout-note a { color: inherit; }

/* Cart icon + badge
   ---------------------------------------------------------- */
.tlf-cart-icon-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
}

.tlf-cart-badge {
	position: absolute;
	top: -7px;
	right: -10px;
	background: #0049ff;
	color: #fff;
	font-size: 0.62rem;
	font-weight: 700;
	border-radius: 50%;
	min-width: 18px;
	height: 18px;
	line-height: 18px;
	text-align: center;
	padding: 0 3px;
}

/* Error state
   ---------------------------------------------------------- */
.tlf-error {
	padding: 0.5rem 0.75rem;
	border: 1px solid rgba( 255, 80, 80, 0.4 );
	background: rgba( 200, 0, 0, 0.1 );
	color: #f55;
}

/* Responsive
   ---------------------------------------------------------- */
@media ( max-width: 600px ) {
	.tlf-product-grid {
		grid-template-columns: repeat( 2, 1fr );
		gap: 1rem;
	}

	.tlf-cart-table thead {
		display: none;
	}

	.tlf-cart-table tr {
		display: flex;
		flex-wrap: wrap;
		padding: 0.5rem 0;
		border-bottom: 1px solid rgba( 255, 255, 255, 0.12 );
	}

	.tlf-cart-table td {
		border: none;
	}

	.tlf-cart-product {
		width: 100%;
	}
}
