/**
 * Frontend styles for WooCommerce Upsells Elementor Widget
 */

/* Container */
.wue-upsells-wrapper,
.wue-crosssells-wrapper {
	width: 100%;
	margin: 0 auto;
}

/* Section Title */
.wue-section-title {
	font-size: 2em;
	font-weight: 600;
	margin: 0 0 20px 0;
	line-height: 1.2;
}

/* Grid Layout */
.wue-crosssells-grid .wue-upsells-grid {
	display: grid;
	gap: 20px;
	width: 100%;
}

/* Product Item */
.wue-product-item {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	overflow: hidden;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.wue-product-item.wue-hover-shadow:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.wue-product-item:hover {
	transform: translateY(-2px);
}

/* Product Link */
.wue-product-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

/* Product Image */
.wue-product-image {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #f9f9f9;
	aspect-ratio: 3 / 4;
	display: flex;
	align-items: center;
	justify-content: center;
}

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

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

/* Product Title */
.wue-product-title {
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	margin: 15px 15px 10px;
	color: #333;
	transition: color 0.3s ease;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wue-product-link:hover .wue-product-title {
	color: #0073aa;
}

/* Product Price */
.wue-product-price {
	font-size: 18px;
	font-weight: 600;
	color: #333;
	margin: 0 15px 15px;
}

.wue-product-price del {
	opacity: 0.5;
	font-weight: 400;
	font-size: 0.85em;
	margin-right: 5px;
}

.wue-product-price ins {
	text-decoration: none;
	color: #77a464;
}

.wue-product-price .woocommerce-Price-amount {
	font-weight: 600;
}

/* Product Actions */
.wue-product-actions {
	margin-top: auto;
	padding: 0 15px 15px;
}

/* Add to Cart Button */
.wue-add-to-cart {
	display: inline-block;
	width: 100%;
	padding: 12px 24px;
	background: #0073aa;
	color: #fff;
	text-align: center;
	text-decoration: none;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	cursor: pointer;
	transition: all 0.3s ease;
	box-sizing: border-box;
}

.wue-add-to-cart:hover {
	background: #005a87;
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.wue-add-to-cart:active {
	transform: translateY(0);
}

.wue-add-to-cart.loading {
	opacity: 0.6;
	cursor: wait;
}

.wue-add-to-cart.added {
	background: #77a464;
}

.wue-add-to-cart.added::after {
	content: " ✓";
}

/* Out of Stock */
.wue-add-to-cart:disabled,
.wue-add-to-cart.disabled {
	opacity: 0.5;
	cursor: not-allowed;
	background: #ccc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.wue-section-title {
		font-size: 1.5em;
	}

	.wue-product-title {
		font-size: 14px;
		margin: 12px 12px 8px;
	}

	.wue-product-price {
		font-size: 16px;
		margin: 0 12px 12px;
	}

	.wue-product-actions {
		padding: 0 12px 12px;
	}

	.wue-add-to-cart {
		padding: 10px 20px;
		font-size: 13px;
	}
}

/* Loading State */
.wue-add-to-cart.loading::before {
	content: "";
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-right: 8px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wue-spin 0.6s linear infinite;
}

@keyframes wue-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Sale Badge */
.wue-product-image .onsale {
	position: absolute;
	top: 10px;
	left: 10px;
	background: #77a464;
	color: #fff;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 3px;
	z-index: 1;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Elementor Editor Notices */
.elementor-alert {
	padding: 15px;
	margin: 15px 0;
	border-left: 4px solid;
	background: #f9f9f9;
}

.elementor-alert-warning {
	border-color: #f0ad4e;
	color: #856404;
}

.elementor-alert-info {
	border-color: #5bc0de;
	color: #31708f;
}
