/**
 * WPFreshCode Elementor Addon Styles
 */

/* Font Awesome Icons */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

.wpfreshcode-carousel-wrapper {
	width: 100%;
	overflow: hidden;
}

.wpfreshcode-carousel {
	position: relative;
	width: 100%;
}

/* Product Item Styles */
.wpfreshcode-product-item {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 545px;
	background-color: #ffffff;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	overflow: hidden;
	transition: all 0.3s ease;
	text-align: center;
}

.wpfreshcode-product-item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	border-color: #d0d0d0;
}

/* Product Image */
.wpfreshcode-product-image {
	position: relative;
	width: 100%;
	overflow: hidden;
	background-color: #f5f5f5;
	min-height: 200px;
	max-height: 240px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.wpfreshcode-product-image img {
	width: 100%;
	height: auto;
	object-fit: cover;
	transition: all 0.4s ease;
}

.wpfreshcode-product-item:hover .wpfreshcode-product-image img {
	transform: scale(1.05);
}

/* Product Gallery Images (hidden by default) */
.wpfreshcode-product-gallery-images {
	display: none;
}

/* Image Counter */
.wpfreshcode-image-counter {
	position: absolute;
	top: 10px;
	right: 10px;
	background-color: rgba(0, 0, 0, 0.7);
	color: #ffffff;
	padding: 4px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	opacity: 0;
	transition: opacity 0.3s ease;
}

/* Product Title */
.wpfreshcode-product-title {
	margin: 12px 15px 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	color: #333333;
	min-height: 50px;
	max-height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.wpfreshcode-product-title a {
	text-decoration: none;
	color: inherit;
	transition: color 0.3s ease;
}

.wpfreshcode-product-title a:hover {
	color: #d32f2f;
}

/* Product Rating */
.wpfreshcode-product-rating {
	margin: 8px auto 0;
	font-size: 14px;
	text-align: center;
}

.wpfreshcode-product-rating .star-rating {
	display: inline-block;
}

/* Product Price */
.wpfreshcode-product-price {
	margin: 8px auto;
	font-size: 18px;
	font-weight: 700;
	color: #e91e63;
	text-align: center;
}

.wpfreshcode-product-price .price {
	color: inherit;
	font-weight: 700;
}

.wpfreshcode-product-price del {
	color: #999999;
	text-decoration: line-through;
	margin-right: 5px;
	font-size: 14px;
	font-weight: normal;
}

/* Add to Cart Button */
.wpfreshcode-product-button {
	margin: 0 auto 15px;
	margin-top: auto;
	width: 90%;
}

.wpfreshcode-product-button .button {
	width: 100%;
	padding: 10px 15px;
	background-color: #333333;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease;
	text-decoration: none;
	display: inline-block;
	text-align: center;
}

.wpfreshcode-product-button .button:hover {
	background-color: #555555;
}

.wpfreshcode-product-button .button.loading::after {
	content: '...';
	animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
	0%, 20% {
		content: '';
	}
	40% {
		content: '.';
	}
	60% {
		content: '..';
	}
	80%, 100% {
		content: '...';
	}
}

/* Product Category */
.wpfreshcode-product-category {
	margin: 8px auto 0;
	font-size: 12px;
	font-weight: 500;
	color: #666666;
	background-color: #f0f0f0;
	padding: 4px 8px;
	border-radius: 3px;
	display: inline-block;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Product Description */
.wpfreshcode-product-description {
	margin: 8px 15px;
	font-size: 13px;
	color: #999999;
	line-height: 1.5;
	min-height: 40px;
	max-height: 52px;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	text-align: center;
	flex-shrink: 0;
}

/* Action Buttons */
.wpfreshcode-product-actions {
	display: flex;
	gap: 8px;
	margin: 8px auto;
	flex-wrap: wrap;
	justify-content: center;
	width: 90%;
}

.wpfreshcode-share-button,
.wpfreshcode-inquiry-button {
	flex: 1;
	min-width: 80px;
	padding: 8px 10px;
	border: 1px solid #e0e0e0;
	background-color: #f5f5f5;
	color: #666666;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	white-space: nowrap;
	text-align: center;
}

.wpfreshcode-share-button:hover {
	background-color: #e0e0e0;
	border-color: #d0d0d0;
	color: #333333;
}

.wpfreshcode-inquiry-button {
	background-color: #f44336;
	color: #ffffff;
	cursor: pointer;
	border-color: #f44336;
	border: none;
}

.wpfreshcode-inquiry-button:hover {
	background-color: #da190b;
	border-color: #da190b;
	color: #ffffff;
}

.wpfreshcode-inquiry-button:active {
	transform: scale(0.98);
}

.wpfreshcode-inquiry-button.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

.wpfreshcode-share-button i,
.wpfreshcode-inquiry-button i {
	font-size: 12px;
}

/* Share Modal */
.wpfreshcode-share-modal {
	display: none;
	position: fixed;
	z-index: 10000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	animation: fadeIn 0.3s ease;
}

.wpfreshcode-share-modal.active {
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpfreshcode-share-content {
	background-color: #ffffff;
	padding: 30px;
	border-radius: 8px;
	max-width: 500px;
	width: 90%;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	animation: slideIn 0.3s ease;
}

.wpfreshcode-share-content h3 {
	margin: 0 0 10px 0;
	font-size: 20px;
	font-weight: 600;
	color: #333333;
	text-align: center;
}

.wpfreshcode-share-subtitle {
	margin: 0 0 20px 0;
	font-size: 14px;
	color: #666666;
	text-align: center;
}

.wpfreshcode-share-icons {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
	gap: 15px;
	margin-bottom: 20px;
}

.wpfreshcode-share-icon {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 15px;
	background-color: #f5f5f5;
	border-radius: 8px;
	text-decoration: none;
	color: #333333;
	transition: all 0.3s ease;
	border: 2px solid transparent;
}

.wpfreshcode-share-icon i {
	font-size: 28px;
	margin-bottom: 8px;
	transition: transform 0.3s ease;
}

.wpfreshcode-share-icon span {
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}

.wpfreshcode-share-icon.facebook {
	color: #1877f2;
}

.wpfreshcode-share-icon.facebook:hover {
	background-color: #1877f2;
	color: #ffffff;
}

.wpfreshcode-share-icon.twitter {
	color: #000000;
}

.wpfreshcode-share-icon.twitter:hover {
	background-color: #000000;
	color: #ffffff;
}

.wpfreshcode-share-icon.linkedin {
	color: #0a66c2;
}

.wpfreshcode-share-icon.linkedin:hover {
	background-color: #0a66c2;
	color: #ffffff;
}

.wpfreshcode-share-icon.google {
	color: #dc4e41;
}

.wpfreshcode-share-icon.google:hover {
	background-color: #dc4e41;
	color: #ffffff;
}

.wpfreshcode-share-icon.email {
	color: #f44336;
}

.wpfreshcode-share-icon.email:hover {
	background-color: #f44336;
	color: #ffffff;
}

.wpfreshcode-share-icon:hover i {
	transform: scale(1.15);
}

.wpfreshcode-share-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #999999;
	transition: color 0.3s ease;
}

.wpfreshcode-share-close:hover {
	color: #333333;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes slideIn {
	from {
		transform: translateY(-50px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Swiper Navigation */
.wpfreshcode-carousel .swiper-button-next,
.wpfreshcode-carousel .swiper-button-prev {
	top: 50%;
	transform: translateY(-50%);
	width: 45px;
	height: 45px;
	background-color: #ffffff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transition: all 0.3s ease;
	border: 1px solid #e0e0e0;
}

.wpfreshcode-carousel .swiper-button-next:hover,
.wpfreshcode-carousel .swiper-button-prev:hover {
	background-color: #f5f5f5;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wpfreshcode-carousel .swiper-button-next::after,
.wpfreshcode-carousel .swiper-button-prev::after {
	font-size: 20px;
	color: #333333;
	font-weight: bold;
}

.wpfreshcode-carousel .swiper-button-next {
	right: 10px;
}

.wpfreshcode-carousel .swiper-button-prev {
	left: 10px;
}

/* Swiper Pagination */
.wpfreshcode-carousel .swiper-pagination {
	bottom: 0;
	position: relative;
	padding: 20px 0 0;
}

.wpfreshcode-carousel .swiper-pagination-bullet {
	width: 12px;
	height: 12px;
	background-color: #d0d0d0;
	opacity: 0.7;
	transition: all 0.3s ease;
}

.wpfreshcode-carousel .swiper-pagination-bullet-active {
	background-color: #d4af37;
	opacity: 1;
}

.wpfreshcode-carousel .swiper-pagination-bullet:hover {
	opacity: 0.9;
}

/* Responsive Styles */
@media (max-width: 1024px) {
	.wpfreshcode-product-item {
		padding: 10px;
		min-height: 480px;
	}

	.wpfreshcode-product-title {
		font-size: 14px;
	}

	.wpfreshcode-product-price {
		font-size: 16px;
	}

	.wpfreshcode-product-category {
		font-size: 11px;
		padding: 3px 6px;
	}

	.wpfreshcode-product-description {
		font-size: 12px;
	}

	.wpfreshcode-share-button,
	.wpfreshcode-inquiry-button {
		font-size: 11px;
		padding: 6px 8px;
	}

	.wpfreshcode-carousel .swiper-button-next,
	.wpfreshcode-carousel .swiper-button-prev {
		width: 40px;
		height: 40px;
	}

	.wpfreshcode-carousel .swiper-button-next::after,
	.wpfreshcode-carousel .swiper-button-prev::after {
		font-size: 18px;
	}
}

@media (max-width: 768px) {
	.wpfreshcode-product-item {
		min-height: 450px;
	}

	.wpfreshcode-product-image {
		min-height: 150px;
	}

	.wpfreshcode-product-title {
		font-size: 13px;
		margin: 8px auto 0;
	}

	.wpfreshcode-product-rating {
		margin: 5px auto 0;
	}

	.wpfreshcode-product-category {
		margin: 6px auto 0;
		font-size: 10px;
		padding: 3px 6px;
	}

	.wpfreshcode-product-description {
		margin: 6px auto;
		font-size: 12px;
	}

	.wpfreshcode-product-price {
		font-size: 14px;
		margin: 5px auto;
	}

	.wpfreshcode-product-actions {
		margin: 6px auto;
		gap: 6px;
		width: 95%;
	}

	.wpfreshcode-share-button,
	.wpfreshcode-inquiry-button {
		min-width: 70px;
		font-size: 11px;
		padding: 6px 8px;
	}

	.wpfreshcode-product-button {
		margin: 0 auto 10px;
		width: 95%;
	}

	.wpfreshcode-carousel .swiper-button-next,
	.wpfreshcode-carousel .swiper-button-prev {
		width: 35px;
		height: 35px;
		display: none;
	}

	.wpfreshcode-carousel .swiper-button-next::after,
	.wpfreshcode-carousel .swiper-button-prev::after {
		font-size: 16px;
	}

	.wpfreshcode-share-icons {
		grid-template-columns: repeat(3, 1fr);
		gap: 12px;
	}
}

@media (max-width: 576px) {
	.wpfreshcode-carousel-wrapper {
		margin: 0 -10px;
	}

	.wpfreshcode-product-item {
		min-height: 400px;
	}

	.wpfreshcode-product-image {
		min-height: 120px;
        max-height: 480px;
	}

	.wpfreshcode-product-title {
		font-size: 12px;
		margin: 6px auto 0;
	}

	.wpfreshcode-product-category {
		margin: 4px auto 0;
		font-size: 9px;
		padding: 2px 5px;
	}

	.wpfreshcode-product-description {
		margin: 4px auto;
		font-size: 11px;
	}

	.wpfreshcode-product-price {
		font-size: 13px;
		margin: 4px auto;
	}

	.wpfreshcode-product-actions {
		margin: 4px auto;
		gap: 4px;
		width: 98%;
	}

	.wpfreshcode-share-button,
	.wpfreshcode-inquiry-button {
		min-width: 60px;
		font-size: 10px;
		padding: 5px 6px;
	}

	.wpfreshcode-product-button {
		margin: 0 auto 8px;
		width: 98%;
	}

	.wpfreshcode-product-button .button {
		padding: 8px 10px;
		font-size: 12px;
	}

	.wpfreshcode-carousel .swiper-pagination {
		padding: 15px 0 0;
	}

	.wpfreshcode-carousel .swiper-pagination-bullet {
		width: 10px;
		height: 10px;
	}

	.wpfreshcode-share-icons {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.wpfreshcode-share-content {
		max-width: 90vw;
		padding: 20px;
	}
}

/* Elementor Editor Styles */
.elementor-editor-active .wpfreshcode-carousel {
	pointer-events: none;
}

.elementor-editor-active .wpfreshcode-carousel .swiper-slide {
	pointer-events: auto;
}

/* Accessibility */
.wpfreshcode-carousel .swiper-button-next:focus,
.wpfreshcode-carousel .swiper-button-prev:focus {
	outline: 2px solid #333333;
	outline-offset: 2px;
}

.wpfreshcode-carousel .swiper-pagination-bullet:focus {
	outline: 2px solid #333333;
	outline-offset: 2px;
}

/* Skeleton Loading State (for lazy loading) */
.wpfreshcode-product-item.loading {
	opacity: 0.6;
	pointer-events: none;
}

.wpfreshcode-product-item.loading::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		#f0f0f0 25%,
		#e0e0e0 50%,
		#f0f0f0 75%
	);
	background-size: 200% 100%;
	animation: loading 1.5s infinite;
}

@keyframes loading {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}
