/**
 * Public styles for WooCommerce Wholesale Pro
 *
 * @package    WoocommerceWholesalePro
 * @author     NXDPRO Solutions <support@nxdpro.com>
 */

/* Wholesale Price Wrapper */
.wholesale-price-wrapper {
	display: block;
	margin: 10px 0;
	padding: 15px;
	background: #f8f9fa;
	border-left: 4px solid #667eea;
	border-radius: 4px;
}

/* Compact version for product loops/archives */
.woocommerce-loop-product .wholesale-price-wrapper,
.woocommerce ul.products li.product .wholesale-price-wrapper {
	padding: 10px;
	margin: 8px 0;
	font-size: 0.9em;
}

/* Wholesale Price Container */
.wholesale-price-container {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

/* Wholesale Price Badge */
.wholesale-price-badge {
	display: inline-block;
	padding: 5px 12px;
	background: #667eea;
	color: white;
	border-radius: 4px;
	font-size: 0.75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

/* Compact badge for product loops */
.woocommerce-loop-product .wholesale-price-badge,
.woocommerce ul.products li.product .wholesale-price-badge {
	padding: 3px 8px;
	font-size: 0.65em;
}

/* Prices Section */
.wholesale-prices {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

/* Retail Price (Crossed) */
.retail-price {
	color: #999;
	opacity: 0.7;
	font-size: 1.1em;
	text-decoration: line-through;
}

/* Wholesale Amount (Highlighted) */
.wholesale-amount {
	color: #4CAF50;
	font-size: 1.5em;
	font-weight: 700;
}

/* Compact wholesale amount for product loops */
.woocommerce-loop-product .wholesale-amount,
.woocommerce ul.products li.product .wholesale-amount {
	font-size: 1.2em;
}

/* Wholesale Savings Display */
.wholesale-savings {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: #4CAF50;
	color: white;
	border-radius: 4px;
	font-size: 0.9em;
	margin-top: 8px;
	width: fit-content;
}

.wholesale-savings .savings-text {
	font-weight: 500;
}

.wholesale-savings strong {
	font-weight: 700;
	font-size: 1.1em;
}

.wholesale-savings .savings-percent {
	font-weight: 600;
	opacity: 0.9;
}

/* Compact savings for product loops */
.woocommerce-loop-product .wholesale-savings,
.woocommerce ul.products li.product .wholesale-savings {
	padding: 5px 10px;
	font-size: 0.75em;
	margin-top: 5px;
	gap: 4px;
}

.woocommerce-loop-product .wholesale-savings strong,
.woocommerce ul.products li.product .wholesale-savings strong {
	font-size: 1em;
}

/* Shop Loop Specific - Ensure clean display */
.woocommerce ul.products li.product .price,
.woocommerce-loop-product .price {
	clear: both;
	display: block;
}

/* ==========================================
   ULTRA-AGGRESSIVE SALE BADGE HIDING
   For ALL themes including Avada, Divi, etc.
   ========================================== */

/* Target ALL possible sale badge selectors when user is wholesale customer */
body.wholesale-customer .onsale,
body.wholesale-customer span.onsale,
body.wholesale-customer .sale-badge,
body.wholesale-customer .product-badge,
body.wholesale-customer .fusion-onsale,
body.wholesale-customer .et-pb-badge,
body.wholesale-customer .badge-sale,
body.wholesale-customer .product-label-sale,
body.wholesale-customer .sale-label,
body.wholesale-customer [class*="sale"],
body.wholesale-customer [class*="badge"] {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	width: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
}

/* Specific theme overrides */
body.wholesale-customer.avada-theme .fusion-onsale,
body.wholesale-customer.avada-theme .awb-onsale,
body.wholesale-customer.divi-theme .et_pb_badge_onsale,
body.wholesale-customer.oceanwp-theme .owp-onsale,
body.wholesale-customer.astra-theme .astra-shop-thumbnail-wrap .onsale {
	display: none !important;
}

/* WooCommerce native selectors */
body.wholesale-customer .woocommerce span.onsale,
body.wholesale-customer.woocommerce span.onsale,
body.wholesale-customer .woocommerce ul.products li.product .onsale,
body.wholesale-customer.woocommerce ul.products li.product .onsale,
body.wholesale-customer .woocommerce-loop-product__badge .onsale,
body.wholesale-customer .single-product span.onsale {
	display: none !important;
}

/* Additional fallback for stubborn themes */
body.woocommerce-wholesale-pro-active .onsale,
body.woocommerce-wholesale-pro-active span.onsale {
	display: none !important;
}

/* Ensure wholesale wrapper is full width in product loops */
.woocommerce ul.products li.product .wholesale-price-wrapper,
.woocommerce-loop-product .wholesale-price-wrapper {
	width: 100%;
	box-sizing: border-box;
}

/* Stack layout for product loops */
.woocommerce-loop-product .wholesale-price-container,
.woocommerce ul.products li.product .wholesale-price-container {
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin-bottom: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
	.wholesale-price-wrapper {
		padding: 12px;
	}
	
	.wholesale-price-container {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	
	.wholesale-prices {
		width: 100%;
	}
	
	.wholesale-amount {
		font-size: 1.3em;
	}
	
	.wholesale-savings {
		width: 100%;
		justify-content: center;
	}
}
