/* ============================================
   Woo Tabbed Product Cards - Frontend Styles
   Based on Ajax Product Filters styling
   ============================================ */

/* Container */
.wtpc-container {
	max-width: 1440px;
	margin: 0 auto;
	padding: 20px;
	position: relative;
}

/* Filters Wrapper */
.apf-filters-wrapper {
	background: #fff;
	border: 2px solid #eb3337;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 30px;
	box-shadow: 0 2px 8px rgba(235, 51, 55, 0.1);
}

.apf-filters-row {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	align-items: flex-end;
}

/* Filter Item */
.apf-filter-item {
	flex: 1 1 200px;
	min-width: 180px;
}

.apf-filter-label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	color: #333;
	margin-bottom: 8px;
}

.apf-filter-select {
	width: 100%;
	padding: 12px 15px;
	border: 2px solid #ddd;
	border-radius: 6px;
	font-size: 15px;
	color: #333;
	background: #fff;
	cursor: pointer;
	transition: all 0.3s ease;
	appearance: none;
	background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 11L3 6h10z"/></svg>');
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 14px;
	padding-right: 40px;
}

.apf-filter-select:hover {
	border-color: #eb3337;
}

.apf-filter-select:focus {
	outline: none;
	border-color: #eb3337;
	box-shadow: 0 0 0 3px rgba(235, 51, 55, 0.1);
}

/* Clear Filter Button */
.apf-clear-filter {
	flex: 0 0 auto;
}

.apf-apply-filter {
	flex: 0 0 auto;
}

button.apf-apply-btn {
	background: white !important;
	border: 2px solid red !important;
	padding: 10px 30px !important;
	border-radius: 5px !important;
	font-size: 16px !important;
}

button.apf-apply-btn:hover,
button.apf-apply-btn.is-active,
button.apf-apply-btn:focus {
	background: #d42a2e;
	border-color: #d42a2e;
	box-shadow: 0 4px 12px rgba(235, 51, 55, 0.25);
	transform: translateY(-1px);
}

button.apf-apply-btn:disabled {
	background: #f5f5f5;
	border-color: #ddd;
	color: #999;
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
}

.wtpc-container.apf-has-pending button.apf-apply-btn {
	animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(235, 51, 55, 0.2);
	}
	50% {
		box-shadow: 0 0 0 6px rgba(235, 51, 55, 0.05);
	}
}

.apf-clear-btn {
	background: #fff;
	border: 2px solid #ddd;
	color: #666;
	padding: 12px 20px;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 8px;
	height: 48px;
}

.apf-clear-btn:hover {
	background: #f5f5f5;
	border-color: #999;
	color: #333;
}

.apf-clear-btn svg {
	flex-shrink: 0;
}

/* Products Grid */
.apf-products-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 25px;
	margin-bottom: 30px;
	position: relative;
}

/* Product Card */
.apf-product-card {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
}

.apf-product-card:hover {
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
	border-color: #eb3337;
}

/* Product Image */
.apf-product-image {
	position: relative;
	overflow: hidden;
	background: #f9f9f9;
	aspect-ratio: 1;
}

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

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

.apf-product-image a {
	display: block;
	height: 100%;
}

/* Product Info */
.apf-product-info {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.apf-product-title {
	margin: 0 0 12px 0;
	font-size: 16px;
	line-height: 1.4;
	font-weight: 600;
	min-height: 44px;
}

.apf-product-title a {
	color: #333;
	text-decoration: none;
	transition: color 0.3s ease;
}

.apf-product-title a:hover {
	color: #eb3337;
}

.apf-product-price {
	font-size: 20px;
	font-weight: 700;
	color: #eb3337;
	margin-bottom: 15px;
}

.apf-product-price del {
	color: #999;
	font-size: 16px;
	font-weight: 400;
	margin-right: 8px;
}

/* Product Button */
.apf-product-button {
	display: inline-block;
	background: #eb3337;
	color: #fff;
	text-align: center;
	padding: 12px 24px;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: all 0.3s ease;
	border: 2px solid #eb3337;
	margin-top: auto;
}

.apf-product-button:hover {
	background: #d42a2e;
	border-color: #d42a2e;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(235, 51, 55, 0.3);
}

/* Load More Button */
.apf-load-more-wrapper {
	text-align: center;
	padding: 20px 0;
}

.apf-load-more-wrapper.is-hidden {
	display: none;
}

.apf-load-more-btn {
	background: #eb3337;
	color: #fff;
	border: 2px solid #eb3337;
	padding: 15px 40px;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.apf-load-more-btn:hover {
	background: #d42a2e;
	border-color: #d42a2e;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(235, 51, 55, 0.3);
}

.apf-load-more-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.apf-load-more-btn.is-loading {
	opacity: 0.6;
	cursor: progress;
}

/* Loading States */
.apf-loading-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	border-radius: 8px;
}

.apf-spinner svg {
	display: block;
}

/* No Products Message */
.apf-no-products {
	text-align: center;
	padding: 60px 20px;
	font-size: 18px;
	color: #666;
	background: #f9f9f9;
	border-radius: 8px;
	border: 2px dashed #ddd;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
	.apf-products-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 20px;
	}
}

@media (max-width: 768px) {
	.wtpc-tabs {
		justify-content: flex-start;
		gap: 18px;
		font-size: 15px;
		margin-right: -15px;
		padding-right: 15px;
	}

	.wtpc-tab-trigger {
		font-size: 15px;
	}

	.wtpc-container {
		padding: 15px;
	}

	.apf-filters-wrapper {
		padding: 15px;
		margin-bottom: 20px;
	}

	.apf-filters-row {
		flex-direction: column;
		gap: 12px;
	}

	.apf-filter-item {
		width: 100%;
		min-width: 100%;
	}

	.apf-clear-btn {
		width: 100%;
		justify-content: center;
	}

	.apf-apply-filter {
		width: 100%;
	}

	.apf-apply-btn {
		width: 100%;
		min-width: 0;
	}

	.apf-products-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 15px;
	}

	.apf-product-info {
		padding: 15px;
	}

	.apf-product-title {
		font-size: 15px;
		min-height: auto;
	}

	.apf-product-price {
		font-size: 18px;
	}
}

@media (max-width: 480px) {
	.wtpc-tabs {
		justify-content: flex-start;
		gap: 12px;
	}

	.apf-products-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.apf-product-card {
		max-width: 100%;
	}

	.apf-load-more-btn {
		width: 100%;
		padding: 14px 30px;
	}
}

/* Animations */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.apf-product-card {
	animation: fadeIn 0.4s ease-out;
}

@media(max-width: 768px) {
	.apf-filter-item {
		flex: 0 0 auto;
		min-width: 180px;
	}
}

/* Tabbed product specific styles */
.wtpc-container {
	padding-top: 0;
}

.wtpc-tabs {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-end;
	gap: clamp(16px, 2.5vw, 32px);
	margin-bottom: 25px;
	padding-bottom: 8px;
	border-bottom: 1px solid #ededed;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x;
	overscroll-behavior: contain;
	padding-inline: 10px;
}

.wtpc-tabs::-webkit-scrollbar {
	display: none;
}

.wtpc-tab-trigger {
	position: relative;
	border: none;
	background: transparent;
	color: #8f8f8f;
	flex: 0 0 auto;
	white-space: nowrap;
	flex-shrink: 0;
	padding: 6px 0;
	font-weight: 600;
	font-size: 16px;
	cursor: pointer;
	transition: color 0.2s ease;
}

.wtpc-tab-trigger::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: -9px;
	width: 100%;
	height: 2px;
	background: transparent;
	transition: background 0.2s ease;
}

.wtpc-tab-trigger:hover,
.wtpc-tab-trigger:focus {
	color: #ff6d2c;
	outline: none;
}

.wtpc-tab-trigger.is-active {
	color: #ff6d2c;
}

.wtpc-tab-trigger.is-active::after {
	background: #ff6d2c;
}

.wtpc-panels {
	position: relative;
}

.wtpc-tab-panel {
	display: none;
	animation: fadeIn 0.4s ease-out;
}

.wtpc-tab-panel.is-active {
	display: block;
}

.wtpc-notice {
	padding: 20px;
	border-radius: 6px;
	border: 1px solid #ffd9d9;
	background: #fff4f4;
	color: #d42a2e;
}


