/* WooCommerce Sticky Add to Cart Bar - Frontend CSS */

#wsac-sticky-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	background: #fff;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
	z-index: 999999;
	transform: translateY(100%);
	transition: transform 0.3s ease-in-out;
	padding: 10px 0;
	border-top: 1px solid #eee;
	font-family: inherit;
}

#wsac-sticky-bar.wsac-visible {
	transform: translateY(0);
}

.wsac-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 15px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
}

/* Product Info (3_in_row layout) */
.wsac-product-info {
	display: flex;
	align-items: center;
	gap: 15px;
	flex: 1;
	min-width: 0; /* allows text truncation */
}

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

.wsac-title-wrap {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.wsac-title {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #333;
}

.wsac-stock-status {
	font-size: 12px;
	color: #666;
}
.wsac-stock-status p {
	margin: 0;
}
.wsac-stock-status .in-stock { color: #0f834d; }
.wsac-stock-status .out-of-stock { color: #e2401c; }

/* Actions Area */
.wsac-actions {
	display: flex;
	align-items: center;
	gap: 15px;
}

.wsac-layout-2_in_row .wsac-container {
	justify-content: flex-end; /* right align for 2 in row if we want */
}

.wsac-layout-2_in_row .wsac-actions {
	width: 100%;
	justify-content: center;
}

.wsac-price-wrap {
	font-weight: 700;
	color: #333;
	font-size: 16px;
}

/* Quantity Selector */
.wsac-quantity {
	display: flex;
	align-items: center;
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
	height: 40px;
	background: #fff;
}

.wsac-qty-btn {
	background: #f7f7f7;
	border: none;
	width: 35px;
	height: 100%;
	font-size: 18px;
	color: #333;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.wsac-qty-btn:hover {
	background: #ebebeb;
}

.wsac-qty-input {
	width: 45px;
	height: 100%;
	border: none !important;
	text-align: center;
	font-size: 14px;
	padding: 0;
	-moz-appearance: textfield;
}

.wsac-qty-input::-webkit-outer-spin-button,
.wsac-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Button */
.wsac-add-to-cart-btn {
	background-color: var(--wsac-btn-bg, #000);
	color: var(--wsac-btn-color, #fff);
	border: none;
	padding: 0 25px;
	height: 40px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 4px;
	cursor: pointer;
	transition: opacity 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}

.wsac-add-to-cart-btn:hover {
	opacity: 0.9;
}

.wsac-add-to-cart-btn.disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Loading State */
.wsac-add-to-cart-btn.loading {
	position: relative;
	color: transparent !important;
}

.wsac-add-to-cart-btn.loading::after {
	content: "";
	position: absolute;
	width: 16px;
	height: 16px;
	top: 50%;
	left: 50%;
	margin-top: -8px;
	margin-left: -8px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wsac-spin 1s linear infinite;
}

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

/* Responsive Styles */
@media (max-width: 768px) {
	.wsac-product-info {
		display: none; /* Hide product info on mobile by default to save space */
	}
	
	.wsac-actions {
		width: 100%;
		justify-content: space-between;
	}

	.wsac-layout-2_in_row .wsac-quantity {
		display: none; /* If 2 in row on mobile, maybe hide qty to fit price and button, or let flex wrap */
	}

	.wsac-add-to-cart-btn {
		flex: 1; /* Button takes remaining space */
	}
	
	.wsac-price-wrap {
		font-size: 14px;
	}
}

/* Visibility Control Classes */
@media (min-width: 769px) {
	.wsac-desktop-hide { display: none !important; }
}
@media (max-width: 768px) {
	.wsac-mobile-hide { display: none !important; }
}
