/**
 * WooCommerce Dynamic Product Showcases
 * Theme-Inherited Styles with Enhanced Visuals
 */

/* ============================================
   Container
   ============================================ */
.wdps-showcase-container {
	margin: 2rem 0;
	width: 100%;
}

/* ============================================
   Grid Layout
   ============================================ */
.wdps-grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.wdps-columns-2 { grid-template-columns: repeat(2, 1fr); }
.wdps-columns-3 { grid-template-columns: repeat(3, 1fr); }
.wdps-columns-4 { grid-template-columns: repeat(4, 1fr); }
.wdps-columns-5 { grid-template-columns: repeat(5, 1fr); }
.wdps-columns-6 { grid-template-columns: repeat(6, 1fr); }

/* Responsive columns */
@media (max-width: 1200px) {
	.wdps-columns-5,
	.wdps-columns-6 {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 992px) {
	.wdps-columns-4,
	.wdps-columns-5,
	.wdps-columns-6 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.wdps-columns-3,
	.wdps-columns-4,
	.wdps-columns-5,
	.wdps-columns-6 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.wdps-grid {
		grid-template-columns: 1fr;
	}
}

/* ============================================
   Product Card
   ============================================ */
.wdps-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: transparent;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 8px;
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wdps-product-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.wdps-product-image {
	position: relative;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.02);
}

.wdps-product-image img {
	width: 100%;
	height: auto;
	display: block;
	transition: transform 0.4s ease;
}

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

.wdps-product-content {
	padding: 1.25rem;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.wdps-product-category {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.6;
	margin-bottom: 0.5rem;
}

.wdps-product-title {
	margin: 0 0 0.75rem;
	font-size: 1.1rem;
	line-height: 1.4;
}

.wdps-product-title a {
	color: inherit;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.wdps-product-title a:hover {
	opacity: 0.7;
}

.wdps-product-rating {
	margin-bottom: 0.75rem;
}

.wdps-product-excerpt {
	margin-bottom: 1rem;
	font-size: 0.9rem;
	line-height: 1.6;
	opacity: 0.8;
}

.wdps-product-excerpt p {
	margin-bottom: 0.5rem;
}

.wdps-product-excerpt p:last-child {
	margin-bottom: 0;
}

.wdps-custom-fields {
	margin-bottom: 1rem;
	font-size: 0.85rem;
}

.wdps-custom-field {
	margin-bottom: 0.375rem;
	display: flex;
	gap: 0.5rem;
}

.wdps-field-label {
	font-weight: 600;
}

.wdps-field-value {
	opacity: 0.8;
}

.wdps-product-price {
	margin-bottom: 1rem;
	font-size: 1.2rem;
	font-weight: 600;
}

.wdps-product-price del {
	opacity: 0.5;
	margin-right: 0.5rem;
}

.wdps-product-price ins {
	text-decoration: none;
	color: #e74c3c;
}

.wdps-product-actions {
	margin-top: auto;
}

.wdps-product-card .button {
	width: 100%;
}

/* ============================================
   Badges
   ============================================ */
.wdps-badge {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	padding: 0.35rem 0.75rem;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	border-radius: 3px;
	z-index: 1;
}

.wdps-sale-badge {
	background: #e74c3c;
	color: #fff;
}

.wdps-featured-badge {
	background: #3498db;
	color: #fff;
	top: auto;
	bottom: 0.75rem;
}

/* ============================================
   Hero Grid Layout
   ============================================ */
.wdps-hero-grid {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.wdps-hero-product {
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	gap: 2.5rem;
	padding: 2rem;
	background: rgba(0, 0, 0, 0.02);
	border-radius: 12px;
	align-items: center;
}

@media (max-width: 900px) {
	.wdps-hero-product {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
}

.wdps-hero-image {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
}

.wdps-hero-image img {
	width: 100%;
	height: auto;
	display: block;
}

.wdps-hero-content {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.wdps-hero-category {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.6;
	margin-bottom: 0.75rem;
}

.wdps-hero-title {
	margin: 0 0 1rem;
	font-size: 2rem;
	line-height: 1.2;
}

.wdps-hero-title a {
	color: inherit;
	text-decoration: none;
}

.wdps-hero-title a:hover {
	opacity: 0.8;
}

.wdps-hero-excerpt {
	margin-bottom: 1.5rem;
	font-size: 1rem;
	line-height: 1.7;
	opacity: 0.85;
}

.wdps-hero-price {
	margin-bottom: 1.5rem;
	font-size: 1.75rem;
	font-weight: 700;
}

.wdps-hero-actions {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}

.wdps-hero-actions .button {
	padding: 0.875rem 1.5rem;
}

.wdps-view-details {
	background: transparent;
	border: 2px solid currentColor;
}

/* ============================================
   Spotlight Layout
   ============================================ */
.wdps-spotlight {
	display: flex;
	flex-direction: column;
	gap: 3rem;
}

.wdps-spotlight-item {
	display: grid;
	grid-template-columns: 1.5fr 1fr;
	gap: 0;
	border-radius: 12px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.03);
	min-height: 400px;
}

.wdps-spotlight-reversed {
	grid-template-columns: 1fr 1.5fr;
}

.wdps-spotlight-reversed .wdps-spotlight-image {
	order: 2;
}

.wdps-spotlight-reversed .wdps-spotlight-content {
	order: 1;
}

@media (max-width: 900px) {
	.wdps-spotlight-item,
	.wdps-spotlight-reversed {
		grid-template-columns: 1fr;
		min-height: auto;
	}
	
	.wdps-spotlight-reversed .wdps-spotlight-image,
	.wdps-spotlight-reversed .wdps-spotlight-content {
		order: unset;
	}
}

.wdps-spotlight-image {
	position: relative;
	overflow: hidden;
}

.wdps-spotlight-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.wdps-spotlight-item:hover .wdps-spotlight-image img {
	transform: scale(1.03);
}

.wdps-spotlight-badges {
	position: absolute;
	top: 1rem;
	right: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.wdps-spotlight-badges .wdps-badge {
	position: static;
}

.wdps-spotlight-content {
	display: flex;
	align-items: center;
	padding: 2.5rem;
}

.wdps-spotlight-inner {
	width: 100%;
}

.wdps-spotlight-category {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.6;
	margin-bottom: 0.75rem;
}

.wdps-spotlight-title {
	margin: 0 0 1rem;
	font-size: 1.75rem;
	line-height: 1.25;
}

.wdps-spotlight-title a {
	color: inherit;
	text-decoration: none;
}

.wdps-spotlight-title a:hover {
	opacity: 0.8;
}

.wdps-spotlight-excerpt {
	margin-bottom: 1.5rem;
	font-size: 1rem;
	line-height: 1.7;
	opacity: 0.85;
}

.wdps-spotlight-fields {
	padding: 1rem;
	background: rgba(0, 0, 0, 0.03);
	border-radius: 6px;
	margin-bottom: 1.5rem;
}

.wdps-spotlight-price {
	margin-bottom: 1.5rem;
	font-size: 1.5rem;
	font-weight: 700;
}

.wdps-spotlight-actions {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}

/* ============================================
   Masonry Layout
   ============================================ */
.wdps-masonry {
	column-count: 4;
	column-gap: 1.5rem;
}

.wdps-masonry.wdps-columns-2 { column-count: 2; }
.wdps-masonry.wdps-columns-3 { column-count: 3; }
.wdps-masonry.wdps-columns-5 { column-count: 5; }
.wdps-masonry.wdps-columns-6 { column-count: 6; }

@media (max-width: 1200px) {
	.wdps-masonry.wdps-columns-5,
	.wdps-masonry.wdps-columns-6 {
		column-count: 4;
	}
}

@media (max-width: 992px) {
	.wdps-masonry.wdps-columns-4,
	.wdps-masonry.wdps-columns-5,
	.wdps-masonry.wdps-columns-6 {
		column-count: 3;
	}
}

@media (max-width: 768px) {
	.wdps-masonry {
		column-count: 2;
	}
}

@media (max-width: 480px) {
	.wdps-masonry {
		column-count: 1;
	}
}

.wdps-masonry-item {
	break-inside: avoid;
	margin-bottom: 1.5rem;
}

/* ============================================
   Carousel Layout
   ============================================ */
.wdps-carousel-wrapper {
	position: relative;
	padding: 0 3.5rem;
}

.wdps-carousel {
	display: flex;
	gap: 1.5rem;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
	scroll-snap-type: x mandatory;
}

.wdps-carousel::-webkit-scrollbar {
	display: none;
}

.wdps-carousel-item {
	flex: 0 0 auto;
	width: calc((100% - 4.5rem) / 4);
	min-width: 260px;
	scroll-snap-align: start;
}

@media (max-width: 1200px) {
	.wdps-carousel-item {
		width: calc((100% - 3rem) / 3);
	}
}

@media (max-width: 768px) {
	.wdps-carousel-item {
		width: calc((100% - 1.5rem) / 2);
	}
	
	.wdps-carousel-wrapper {
		padding: 0 2.5rem;
	}
}

@media (max-width: 480px) {
	.wdps-carousel-item {
		width: calc(100% - 2rem);
	}
}

.wdps-carousel-prev,
.wdps-carousel-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 50%;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	z-index: 2;
	color: currentColor;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wdps-carousel-prev:hover,
.wdps-carousel-next:hover {
	background: #333;
	color: #fff;
	border-color: #333;
}

.wdps-carousel-prev {
	left: 0;
}

.wdps-carousel-next {
	right: 0;
}

.wdps-carousel-prev:disabled,
.wdps-carousel-next:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

/* ============================================
   No Products Message
   ============================================ */
.wdps-no-products {
	text-align: center;
	padding: 3rem 2rem;
	opacity: 0.6;
	font-size: 1.1rem;
}

/* ============================================
   Utility Classes
   ============================================ */
.wdps-hidden {
	display: none !important;
}

/* ============================================
   Accessibility
   ============================================ */
.wdps-product-card a:focus,
.wdps-carousel-prev:focus,
.wdps-carousel-next:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ============================================
   WooCommerce Integration
   ============================================ */
.wdps-product-card .add_to_cart_button,
.wdps-hero-actions .add_to_cart_button,
.wdps-spotlight-actions .add_to_cart_button {
	width: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.wdps-product-card .added_to_cart {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.85rem;
}

/* Star ratings */
.wdps-product-rating .star-rating {
	font-size: 0.9rem;
}

/* ============================================
   Animation on scroll (optional enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
	.wdps-product-card,
	.wdps-spotlight-item {
		opacity: 1;
		transform: translateY(0);
	}
}
