/**
 * WhatsApp Commerce Pro - Frontend Styles
 *
 * @package WhatsAppCommercePro
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

.wcp-button {
	--wcp-bg: #25D366;
	--wcp-text: #FFFFFF;
	--wcp-hover: #128C7E;
}

/* ==========================================================================
   Base Button
   ========================================================================== */

.wcp-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	background-color: var(--wcp-bg);
	color: var(--wcp-text);
	text-decoration: none;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	border: none;
	outline: none;
	white-space: nowrap;
	vertical-align: middle;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.wcp-button:hover {
	background-color: var(--wcp-hover);
	color: var(--wcp-text);
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.wcp-button:active {
	transform: translateY(0);
	box-shadow: 0 2px 6px rgba(37, 211, 102, 0.2);
}

.wcp-button:focus-visible {
	outline: 2px solid var(--wcp-bg);
	outline-offset: 2px;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.wcp-button--rounded {
	border-radius: 8px;
}

.wcp-button--square {
	border-radius: 0;
}

.wcp-button--pill {
	border-radius: 50px;
}

/* ==========================================================================
   Button Sizes
   ========================================================================== */

.wcp-button--small {
	padding: 8px 16px;
	font-size: 13px;
	gap: 6px;
}

.wcp-button--small .wcp-btn-icon {
	width: 16px;
	height: 16px;
}

.wcp-button--medium {
	padding: 12px 24px;
	font-size: 15px;
}

.wcp-button--large {
	padding: 16px 32px;
	font-size: 17px;
	gap: 10px;
}

.wcp-button--large .wcp-btn-icon {
	width: 24px;
	height: 24px;
}

/* ==========================================================================
   Icon
   ========================================================================== */

.wcp-btn-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	fill: currentColor;
}

/* ==========================================================================
   Location-specific Styles
   ========================================================================== */

/* Product page */
.wcp-button--product {
	margin-top: 10px;
	margin-bottom: 10px;
}

/* Ensure it flows properly next to add-to-cart */
.woocommerce div.product form.cart .wcp-button--product {
	display: inline-flex;
	margin-left: 10px;
	vertical-align: middle;
}

/* Fallback: if button is outside the form */
.woocommerce div.product .summary .wcp-button--product {
	margin-top: 12px;
}

/* Cart page */
.wcp-button--cart {
	width: 100%;
	margin-top: 10px;
	text-align: center;
}

/* Checkout page */
.wcp-checkout-wrapper {
	margin: 15px 0;
	text-align: center;
}

.wcp-button--checkout {
	width: 100%;
}

/* ==========================================================================
   Elementor Widget
   ========================================================================== */

.wcp-elementor-wrapper {
	display: inline-block;
}

.wcp-elementor-wrapper .wcp-button {
	display: inline-flex;
}

/* ==========================================================================
   Shortcode
   ========================================================================== */

.wcp-button--shortcode {
	margin: 5px;
}

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

@media (max-width: 768px) {
	.wcp-button {
		font-size: 14px;
		padding: 10px 20px;
	}

	.wcp-button--large {
		padding: 14px 28px;
		font-size: 16px;
	}

	/* Stack button below add-to-cart on mobile */
	.woocommerce div.product form.cart .wcp-button--product {
		display: flex;
		margin-left: 0;
		margin-top: 10px;
		width: 100%;
	}
}

@media (max-width: 480px) {
	.wcp-button {
		font-size: 13px;
		padding: 10px 18px;
		width: 100%;
		justify-content: center;
	}
}

/* ==========================================================================
   Variable Product: Disabled State
   ========================================================================== */

.wcp-button--disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

.wcp-variation-hint {
	display: none;
	margin-top: 6px;
	font-size: 13px;
	color: #e2401c;
}

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

@keyframes wcp-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
	}
	70% {
		box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
	}
}

.wcp-button--pulse {
	animation: wcp-pulse 2s infinite;
}

/* ==========================================================================
   Floating WhatsApp Bubble
   Critical styles are inline via PHP. This file adds hover, transitions,
   and animations that cannot be inlined.
   ========================================================================== */

#wcp-floating-bubble .wcp-floating-bubble__btn {
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
	animation: wcp-bubble-enter 0.4s ease !important;
}

#wcp-floating-bubble .wcp-floating-bubble__btn:active {
	transform: scale(0.95) !important;
}

#wcp-floating-bubble .wcp-floating-bubble__btn:visited {
	color: #fff !important;
}

#wcp-floating-bubble .wcp-floating-bubble__close {
	transition: color 0.15s ease !important;
}

@keyframes wcp-bubble-enter {
	from { opacity: 0; transform: scale(0.5); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes wcp-bubble-pulse {
	0% { transform: scale(1); opacity: 0.4; }
	100% { transform: scale(1.6); opacity: 0; }
}

@keyframes wcp-tooltip-pop {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Dark Theme Compatibility
   ========================================================================== */

@media (prefers-color-scheme: dark) {
	.wcp-button:hover {
		box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
	}
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
	.wcp-button,
	.wcp-floating-bubble {
		display: none !important;
	}
}
