/**
 * Buy Button Pro Widget Styles
 *
 * @package Vime_WooCommerce_Widgets
 * @since 1.7.0
 */

/* =========================================
   Base / Wrapper
   ========================================= */
.vime-buy-button-pro {
	width: 100%;
}

/* =========================================
   Container (holds quantity + button)
   ========================================= */
.vime-buy-button-pro__container {
	display: flex;
	align-items: stretch;
	flex-wrap: nowrap;
}

/* Layout: Inline (quantity beside button) */
.vime-buy-button-pro--layout-inline .vime-buy-button-pro__container {
	flex-direction: row;
	align-items: stretch;
	gap: 15px;
}

/* Layout: Stacked (quantity above button) */
.vime-buy-button-pro--layout-stacked .vime-buy-button-pro__container {
	flex-direction: column;
	align-items: stretch;
}

/* Layout: Buttons Around */
.vime-buy-button-pro--layout-buttons-around .vime-buy-button-pro__container {
	flex-direction: row;
	align-items: stretch;
	gap: 15px;
}

/* =========================================
   Quantity Selector
   ========================================= */
.vime-buy-button-pro__quantity {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	gap: 5px;
	background-color: #F7F7F7;
	border: 1px solid #E0E0E0;
	border-radius: 4px;
	overflow: hidden;
}

/* Stacked layout: full width quantity */
.vime-buy-button-pro--layout-stacked .vime-buy-button-pro__quantity {
	width: 100%;
	justify-content: center;
	margin-bottom: 15px;
}

/* =========================================
   Quantity Buttons (+/-)
   ========================================= */
.vime-buy-button-pro__quantity-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-width: 36px;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	color: #333333;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	flex-shrink: 0;
}

.vime-buy-button-pro__quantity-btn:hover {
	background-color: rgba(0, 0, 0, 0.05);
}

.vime-buy-button-pro__quantity-btn:active {
	background-color: rgba(0, 0, 0, 0.1);
}

.vime-buy-button-pro__quantity-btn span {
	display: flex;
	align-items: center;
	justify-content: center;
}

.vime-buy-button-pro__quantity-btn svg {
	width: 1em;
	height: 1em;
}

/* =========================================
   Quantity Input
   ========================================= */
.vime-buy-button-pro__quantity-input {
	width: 50px;
	height: 100%;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	color: #333333;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	outline: none;
	-webkit-appearance: none;
	-moz-appearance: textfield;
	appearance: none;
	box-shadow: none;
	line-height: 1;
}

/* Remove number input spinners (cross-browser) */
.vime-buy-button-pro__quantity-input::-webkit-outer-spin-button,
.vime-buy-button-pro__quantity-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.vime-buy-button-pro__quantity-input:focus {
	outline: none;
	box-shadow: none;
}

/* =========================================
   Sync Heights (quantity matches button)
   ========================================= */
.vime-buy-button-pro--sync-heights-yes.vime-buy-button-pro--layout-inline .vime-buy-button-pro__quantity {
	align-self: stretch;
}

.vime-buy-button-pro--sync-heights-yes.vime-buy-button-pro--layout-inline .vime-buy-button-pro__quantity-btn {
	height: 100%;
}

.vime-buy-button-pro--sync-heights-yes.vime-buy-button-pro--layout-inline .vime-buy-button-pro__quantity-input {
	height: 100%;
}

/* =========================================
   Button
   ========================================= */
.vime-buy-button-pro__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border: none;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	transition: all 0.3s ease;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	position: relative;
	white-space: nowrap;
}

.vime-buy-button-pro__button:hover {
	opacity: 0.9;
}

.vime-buy-button-pro__button:disabled,
.vime-buy-button-pro__button.disabled {
	cursor: not-allowed;
	opacity: 0.7;
}

/* Full width button */
.vime-buy-button-pro--full-width .vime-buy-button-pro__button {
	width: 100%;
}

/* Inline layout: button takes remaining space */
.vime-buy-button-pro--layout-inline .vime-buy-button-pro__button {
	flex: 1;
}

/* Stacked layout: full width button */
.vime-buy-button-pro--layout-stacked .vime-buy-button-pro__button {
	width: 100%;
}

/* =========================================
   Button Icon
   ========================================= */
.vime-buy-button-pro__button-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	line-height: 1;
}

.vime-buy-button-pro__button-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.vime-buy-button-pro__button-icon--before {
	margin-right: 8px;
}

.vime-buy-button-pro__button-icon--after {
	margin-left: 8px;
}

/* =========================================
   Button Text
   ========================================= */
.vime-buy-button-pro__button-text {
	display: inline;
}

/* =========================================
   Button Price
   ========================================= */
.vime-buy-button-pro__button-price {
	display: inline;
}

/* =========================================
   Loading Spinner
   ========================================= */
.vime-buy-button-pro__spinner {
	display: none;
}

.vime-buy-button-pro--loading .vime-buy-button-pro__spinner {
	display: inline-flex;
	align-items: center;
	margin-left: 8px;
}

/* Rotate spinner */
.vime-buy-button-pro__spinner--rotate {
	width: 16px;
	height: 16px;
	border: 2px solid #ffffff;
	border-top-color: transparent;
	border-radius: 50%;
	animation: vime-bbp-spin 0.6s linear infinite;
}

/* Pulse spinner */
.vime-buy-button-pro__spinner--pulse {
	width: 16px;
	height: 16px;
	border: 2px solid #ffffff;
	border-radius: 50%;
	animation: vime-bbp-pulse 1s ease-in-out infinite;
}

/* Dots spinner */
.vime-buy-button-pro__spinner--dots {
	display: none;
	gap: 4px;
}

.vime-buy-button-pro--loading .vime-buy-button-pro__spinner--dots {
	display: inline-flex;
}

.vime-buy-button-pro__spinner--dots span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: #ffffff;
	animation: vime-bbp-dots 1.2s ease-in-out infinite;
}

.vime-buy-button-pro__spinner--dots span:nth-child(2) {
	animation-delay: 0.2s;
}

.vime-buy-button-pro__spinner--dots span:nth-child(3) {
	animation-delay: 0.4s;
}

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

@keyframes vime-bbp-pulse {
	0%, 100% {
		transform: scale(0.8);
		opacity: 0.5;
	}
	50% {
		transform: scale(1);
		opacity: 1;
	}
}

@keyframes vime-bbp-dots {
	0%, 80%, 100% {
		transform: scale(0);
		opacity: 0.5;
	}
	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* =========================================
   Stock Info
   ========================================= */
.vime-buy-button-pro__stock-info {
	font-size: 13px;
	line-height: 1.4;
	color: #666666;
}

.vime-buy-button-pro__stock-info--above {
	display: block;
	margin-bottom: 10px;
}

.vime-buy-button-pro__stock-info--below-quantity {
	display: block;
	width: 100%;
	margin-top: 5px;
	text-align: center;
}

.vime-buy-button-pro__stock-info--below-button {
	display: block;
	margin-top: 10px;
}

.vime-buy-button-pro__stock-info--inline {
	display: inline-flex;
	align-items: center;
	margin-left: 10px;
	white-space: nowrap;
}

/* =========================================
   View Cart Link
   ========================================= */
.vime-buy-button-pro__view-cart {
	margin-top: 10px;
	text-align: center;
}

.vime-buy-button-pro__view-cart-link {
	font-size: 14px;
	text-decoration: underline;
	transition: color 0.2s ease;
}

.vime-buy-button-pro__view-cart-link:hover {
	text-decoration: none;
}

/* =========================================
   Added State
   ========================================= */
.vime-buy-button-pro--added .vime-buy-button-pro__button {
	transition: background-color 0.3s ease;
}

/* =========================================
   Out of Stock State
   ========================================= */
.vime-buy-button-pro--out-of-stock .vime-buy-button-pro__quantity {
	display: none;
}

/* =========================================
   Alignment
   ========================================= */
.vime-buy-button-pro-align-left .vime-buy-button-pro__container {
	justify-content: flex-start;
}

.vime-buy-button-pro-align-center .vime-buy-button-pro__container {
	justify-content: center;
}

.vime-buy-button-pro-align-right .vime-buy-button-pro__container {
	justify-content: flex-end;
}
