/**
 * Simple AI Bundles - Frontend Styles
 *
 * Styles for bundle widgets and recommendations.
 *
 * @package SimpleAIBundles
 * @since 1.0.0
 */

/* ============================================
   Bundle Widget (Product Page)
   ============================================ */

.sab-bundle-widget {
	background: #f9f9f9;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
	margin: 30px 0;
	max-width: 600px;
}

.sab-bundle-header {
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #e0e0e0;
}

.sab-bundle-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.sab-confidence-badge {
	display: inline-block;
	font-size: 12px;
	color: #666;
	background: #e8f4f8;
	padding: 4px 10px;
	border-radius: 12px;
}

/* Products Grid */
.sab-bundle-products {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 15px;
	margin-bottom: 20px;
}

.sab-bundle-product {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	padding: 12px;
	border-radius: 6px;
	border: 1px solid #e0e0e0;
	flex: 1;
	min-width: 200px;
}

.sab-product-checkbox {
	flex-shrink: 0;
}

.sab-product-checkbox input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
}

.sab-product-image {
	flex-shrink: 0;
}

.sab-product-image img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
}

.sab-product-info {
	flex-grow: 1;
	min-width: 0;
}

.sab-product-name {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #333;
	margin-bottom: 4px;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sab-product-price {
	font-size: 13px;
	color: #666;
}

.sab-plus-icon {
	font-size: 24px;
	font-weight: 300;
	color: #999;
	flex-shrink: 0;
}

/* Pricing */
.sab-bundle-pricing {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 15px;
	margin-bottom: 20px;
}

.sab-pricing-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
}

.sab-pricing-row:not(:last-child) {
	border-bottom: 1px dashed #e0e0e0;
}

.sab-pricing-label {
	font-size: 14px;
	color: #666;
}

.sab-regular-price-row .sab-regular-total {
	text-decoration: line-through;
	color: #999;
}

.sab-bundle-price-row .sab-bundle-price {
	font-size: 18px;
	font-weight: 700;
	color: #333;
}

.sab-savings-row .sab-savings {
	font-size: 14px;
	font-weight: 600;
	color: #2e7d32;
}

.sab-savings-percentage {
	font-weight: 400;
}

/* Actions */
.sab-bundle-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.sab-add-bundle-to-cart {
	flex: 1;
	min-width: 200px;
	padding: 12px 24px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
}

.sab-add-bundle-to-cart.sab-success {
	background-color: #2e7d32 !important;
	border-color: #2e7d32 !important;
}

.sab-add-bundle-to-cart:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Social Proof */
.sab-social-proof {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #e0e0e0;
	font-size: 13px;
	color: #666;
	text-align: center;
}

/* ============================================
   Cart Recommendations
   ============================================ */

.sab-cart-recommendations {
	margin: 30px 0;
	padding: 25px;
	background: #f9f9f9;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
}

.sab-cart-recommendations-title {
	margin: 0 0 20px;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.sab-recommendations-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
}

.sab-cart-recommendation {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
	position: relative;
}

.sab-recommendation-header {
	margin-bottom: 15px;
}

.sab-recommendation-badge {
	display: inline-block;
	background: #4caf50;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 12px;
}

.sab-recommendation-products {
	margin-bottom: 15px;
}

.sab-recommendation-product {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
}

.sab-recommendation-product:not(:last-child) {
	border-bottom: 1px solid #f0f0f0;
}

.sab-recommendation-product-image img {
	width: 50px;
	height: 50px;
	object-fit: cover;
	border-radius: 4px;
}

.sab-recommendation-product-info {
	flex-grow: 1;
}

.sab-recommendation-product-name {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #333;
	margin-bottom: 4px;
}

.sab-recommendation-product-price {
	font-size: 13px;
}

.sab-recommendation-product-price del {
	color: #999;
	margin-right: 8px;
}

.sab-recommendation-pricing {
	margin-bottom: 15px;
	padding: 10px;
	background: #e8f5e9;
	border-radius: 4px;
}

.sab-recommendation-savings {
	font-size: 13px;
	color: #2e7d32;
	font-weight: 500;
	text-align: center;
}

.sab-recommendation-actions {
	display: flex;
	gap: 10px;
}

.sab-add-recommendation-to-cart {
	flex: 1;
}

.sab-add-recommendation-to-cart.sab-success {
	background-color: #2e7d32 !important;
	border-color: #2e7d32 !important;
	color: #fff !important;
}

.sab-dismiss-recommendation {
	flex-shrink: 0;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media screen and (max-width: 768px) {
	.sab-bundle-widget {
		max-width: 100%;
	}

	.sab-bundle-products {
		flex-direction: column;
	}

	.sab-bundle-product {
		width: 100%;
		min-width: 0;
	}

	.sab-plus-icon {
		transform: rotate(90deg);
	}

	.sab-bundle-actions {
		flex-direction: column;
	}

	.sab-add-bundle-to-cart {
		width: 100%;
	}

	.sab-recommendations-grid {
		grid-template-columns: 1fr;
	}

	.sab-recommendation-actions {
		flex-direction: column;
	}
}

/* ============================================
   Animation
   ============================================ */

.sab-cart-recommendation {
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.sab-cart-recommendations {
	transition: opacity 0.2s ease;
}

/* ============================================
   WooCommerce Theme Compatibility
   ============================================ */

/* Ensure buttons match WooCommerce style */
.sab-bundle-widget .button.alt,
.sab-cart-recommendations .button.alt {
	background-color: var(--wc-primary, #a46497);
	color: #fff;
	border: none;
}

.sab-bundle-widget .button.alt:hover,
.sab-cart-recommendations .button.alt:hover {
	background-color: var(--wc-primary-hover, #935386);
}

.sab-bundle-widget .button:not(.alt),
.sab-cart-recommendations .button:not(.alt) {
	background-color: #f7f7f7;
	color: #333;
	border: 1px solid #ccc;
}

.sab-bundle-widget .button:not(.alt):hover,
.sab-cart-recommendations .button:not(.alt):hover {
	background-color: #e0e0e0;
}
