/* Tinyplugs Category Slider — front-end styles. A scroll-snap carousel:
   up to three slides side by side on desktop, one per view on mobile.
   One or two uploaded slides automatically expand to fill the full row.
   Default height: 340px on desktop and 360px on mobile.
   Override it with: .tpcs-slider { --tpcs-height: 360px; } */

.tpcs-slider {
	--tpcs-height: 340px;
	--tpcs-gap: 8px;
	position: relative;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	margin: 0;
}

.tpcs-track {
	display: flex;
	gap: var(--tpcs-gap);
	height: var(--tpcs-height);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none; /* Firefox */
}

.tpcs-track::-webkit-scrollbar {
	display: none;
}

.tpcs-slide {
	position: relative;
	height: 100%;
	min-width: 0;
	scroll-snap-align: start;
	border-radius: 8px;
	overflow: hidden;
	background: #ffffff;
}

/* Fill the row according to the number of uploaded slides. The track gap is
   8px: two slides need one 8px gap; three slides need two 8px gaps. */
.tpcs-slider.tpcs-cols-1 .tpcs-slide {
	flex: 0 0 100%;
}

.tpcs-slider.tpcs-cols-2 .tpcs-slide {
	flex: 0 0 calc(50% - 4px);
}

.tpcs-slider.tpcs-cols-3 .tpcs-slide {
	flex: 0 0 calc(33.333333% - 5.333333px);
}

.tpcs-link {
	display: block;
	position: absolute;
	inset: 0;
	text-decoration: none;
	color: inherit;
}

/*
 * Make each image fill the complete slide, regardless of source dimensions.
 *
 * Image optimization plugins such as Imagify can replace the normal <img>
 * markup with <picture class="tpcs-image"><img ...></picture>. The media
 * wrapper and the fallback selectors below support both the original
 * WordPress markup and optimized picture markup.
 */
.tpcs-slider .tpcs-track {
	width: 100%;
	min-width: 0;
	align-items: stretch;
}

.tpcs-slider .tpcs-slide {
	min-width: 0;
}

.tpcs-media,
.tpcs-slider .tpcs-slide > img.tpcs-image,
.tpcs-slider .tpcs-slide > picture.tpcs-image,
.tpcs-slider .tpcs-link > img.tpcs-image,
.tpcs-slider .tpcs-link > picture.tpcs-image {
	display: block !important;
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden;
}

.tpcs-media > img,
.tpcs-media > picture {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.tpcs-media img,
.tpcs-slider .tpcs-slide > img.tpcs-image,
.tpcs-slider .tpcs-slide > picture.tpcs-image > img,
.tpcs-slider .tpcs-link > img.tpcs-image,
.tpcs-slider .tpcs-link > picture.tpcs-image > img {
	display: block !important;
	width: 100% !important;
	min-width: 100% !important;
	height: 100% !important;
	min-height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover !important;
	object-position: center center;
	margin: 0 !important;
	padding: 0 !important;
}

.tpcs-content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 40px 28px 22px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
	color: #fff;
}

.tpcs-heading {
	margin: 0 0 4px;
	font-size: 26px;
	line-height: 1.2;
	color: #fff;
}

.tpcs-text {
	margin: 0;
	font-size: 15px;
	line-height: 1.4;
	color: #fff;
}

.tpcs-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: #1f2933;
	font-size: 16px;
	cursor: pointer;
	transition: background-color 0.15s ease;
	z-index: 2;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tpcs-arrow:hover {
	background: #fff;
}

.tpcs-prev { left: 12px; }
.tpcs-next { right: 12px; }

/* Position dots: shown whenever the track can scroll (JS hides them when
   all slides already fit). */
.tpcs-dots {
	display: flex;
	position: absolute;
	left: 0;
	right: 0;
	bottom: 10px;
	justify-content: center;
	gap: 8px;
	z-index: 2;
}

.tpcs-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.6);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.tpcs-dot.tpcs-active {
	background: #fff;
	transform: scale(1.2);
}

@media (max-width: 767px) {
	.tpcs-slider {
		--tpcs-height: 360px;
	}

	.tpcs-slider.tpcs-cols-1 .tpcs-slide,
	.tpcs-slider.tpcs-cols-2 .tpcs-slide,
	.tpcs-slider.tpcs-cols-3 .tpcs-slide {
		flex-basis: 100%; /* One slide per view on mobile. */
	}

	.tpcs-heading { font-size: 20px; }
	.tpcs-text { font-size: 13px; }
	.tpcs-arrow { display: none !important; } /* Native swipe on touch screens. */
}

/* --------------------------------------------------------------------------
   Auto-render wrapper + custom HTML blocks
   -------------------------------------------------------------------------- */

.tpcs-archive-content {
	width: 100%;
	flex: 1 1 100%;
	min-width: 0;
}

.tpcs-html-over-slider {
	width: 100%;
	margin: 0 0 20px;
}

.tpcs-trust-html {
	width: 100%;
	margin: 30px 0 0;
}

/* Shared per-category product texts */
.tpcs-product-short {
	margin: 12px 0;
}

.tpcs-product-desc {
	margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Category circles ([tp_category_circles]) — round category navigation row.
   Override the circle size with: .tpcs-circles { --tpcs-circle: 160px; }
   -------------------------------------------------------------------------- */

.tpcs-circles {
	--tpcs-circle: 180px;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	padding-left: 10px;
	padding-right: 10px;
	box-sizing: border-box;
}

.tpcs-circles-title {
	display: flex;
	align-items: center;
	gap: 16px;
	justify-content: center;
	text-align: center;
	font-weight: 400;
	margin: 0 0 24px;
}

.tpcs-circles-title::before,
.tpcs-circles-title::after {
	content: "";
	flex: 1;
	max-width: 120px;
	border-top: 1px solid #ddd;
}

.tpcs-circles-viewport {
	position: relative;
	width: 100%;
	min-width: 0;
}

.tpcs-circles-track {
	display: flex;
	gap: 24px;
	list-style: none;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 0 4px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
}

.tpcs-circles-track::-webkit-scrollbar {
	display: none;
}

.tpcs-circles-item {
	flex: 0 0 auto;
	width: var(--tpcs-circle);
	scroll-snap-align: start;
	text-align: center;
	margin: 0;
}

.tpcs-circles-item a {
	display: block;
	text-decoration: none;
}

.tpcs-circle {
	display: block;
	width: var(--tpcs-circle);
	height: var(--tpcs-circle);
	border-radius: 50%;
	overflow: hidden;
	background: #f5f5f5;
	margin: 0 auto 14px;
}

.tpcs-circle img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.tpcs-circles-item a:hover .tpcs-circle img {
	transform: scale(1.06);
}

.tpcs-circle-noimg {
	display: block;
	width: 100%;
	height: 100%;
	background: #eee;
}

.tpcs-circle-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #555;
}

/* Center the shared arrow style on the circles, not the whole block. */
.tpcs-circles .tpcs-arrow {
	top: calc(var(--tpcs-circle) / 2);
}

/* Unlike the slideshow, the circles and cards rows keep their arrows on
   mobile (the slideshow's mobile rule hides .tpcs-arrow globally). The
   :not([hidden]) guard keeps the JS end-of-track hiding working. */
@media (max-width: 767px) {
	.tpcs-circles .tpcs-arrow:not([hidden]),
	.tpcs-cards .tpcs-arrow:not([hidden]) {
		display: flex !important;
		width: 36px;
		height: 36px;
	}
}

.tpcs-circles .tpcs-prev { left: -8px; }
.tpcs-circles .tpcs-next { right: -8px; }

@media (max-width: 849px) {
	.tpcs-circles { --tpcs-circle: 130px; }
	.tpcs-circle-label { font-size: 12px; }
}

@media (max-width: 549px) {
	.tpcs-circles { --tpcs-circle: 105px; }
	.tpcs-circles-track { gap: 16px; }
}

/* Shoptimizer renders shop/archive page content inside .page-description,
   a flex item of header.woocommerce-products-header. Flex items default to
   min-width:auto and refuse to shrink below their content, so a wide track
   (9 cards ≈ 2900px) blows the wrapper past the container and the header's
   overflow:hidden clips everything off to one side. The plugin cannot fix
   this from inside its own elements — the guard must sit on the theme
   wrapper itself. */
.woocommerce-products-header > .page-description,
.woocommerce-products-header .page-description {
	min-width: 0;
	width: 100%;
}

/* --------------------------------------------------------------------------
   Category cards ([tp_category_cards]) — rectangular cards with overlay text.
   Override the card width with: .tpcs-cards { --tpcs-card: 340px; }
   -------------------------------------------------------------------------- */

.tpcs-cards {
	--tpcs-card: 302px;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	padding-left: 10px;
	padding-right: 10px;
	box-sizing: border-box;
}

.tpcs-cards-viewport {
	position: relative;
	width: 100%;
	min-width: 0;
}

.tpcs-cards-track {
	display: flex;
	gap: 20px;
	list-style: none;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
}

.tpcs-cards-track::-webkit-scrollbar {
	display: none;
}

.tpcs-cards-item {
	flex: 0 0 auto;
	width: var(--tpcs-card);
	scroll-snap-align: start;
	margin: 0;
}

.tpcs-cards-item a {
	position: relative;
	display: block;
	height: calc(var(--tpcs-card) / 2 + 50px);
	border-radius: 8px;
	overflow: hidden;
	background: #e9e5e0;
	text-decoration: none;
}

.tpcs-cards-item a img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease;
}

.tpcs-cards-item a:hover img {
	transform: scale(1.05);
}

.tpcs-card-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 14px 12px;
}

.tpcs-card-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	max-width: calc(100% - 16px);
	background: #fff;
	color: #1d1d1d;
	padding: 6px 20px;
	border-radius: 5px;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
	text-align: center;
	transition: background-color 0.2s ease;
}

.tpcs-cards-item a:hover .tpcs-card-box {
	background: #f3efec;
}

.tpcs-card-heading {
	color: #1d1d1d;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tpcs-card-price {
	display: flex;
	align-items: baseline;
	gap: 5px;
	color: #1d1d1d;
}

.tpcs-card-price small {
	font-size: 11px;
	font-weight: 600;
}

.tpcs-card-price b {
	font-size: 15px;
	font-weight: 800;
	line-height: 1;
}

.tpcs-cards .tpcs-arrow {
	top: 50%;
}

.tpcs-cards .tpcs-prev { left: -8px; }
.tpcs-cards .tpcs-next { right: -8px; }

@media (max-width: 849px) {
	.tpcs-cards { --tpcs-card: 260px; }
	.tpcs-card-heading { font-size: 13px; }
	.tpcs-card-price b { font-size: 14px; }
}

@media (max-width: 549px) {
	.tpcs-cards { --tpcs-card: 230px; }
	.tpcs-cards-track { gap: 14px; }
	.tpcs-card-overlay { padding: 11px 10px; }
	.tpcs-card-box { padding: 8px 16px; }
	.tpcs-card-heading { font-size: 12px; }
	.tpcs-card-price b { font-size: 13px; }
}
