/**
 * Shoptimizly – Public Styles
 *
 * @package Shoptimizly
 */

/* =========================================================================
   HIDE NATIVE ADD TO CART BUTTON ON SINGLE PRODUCT PAGE
   Our button is injected via woocommerce_before_add_to_cart_button.
   We hide WC's native submit button that renders after our block.
   Both simple and variable product templates are covered.
   ========================================================================= */
.single-product .cart button[name="add-to-cart"],
.single-product .cart input[name="add-to-cart"],
.single-product form.cart .single_add_to_cart_button {
	display: none !important;
}

/* =========================================================================
   OUR BUTTON WRAPPER — single product page
   ========================================================================= */
.shoptimizly-product-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
	box-sizing: border-box;
	margin-bottom: 8px;
}

/* =========================================================================
   PRIMARY ORDER BUTTON — single product page
   ========================================================================= */
.woocommerce div.product .shoptimizly-product-actions button.shoptimizly-primary-btn,
.shoptimizly-product-actions button.shoptimizly-primary-btn,
button.shoptimizly-primary-btn {
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 14px 20px !important;
	font-size: 1em !important;
	font-weight: 700 !important;
	letter-spacing: 0.02em !important;
	text-align: center !important;
	box-sizing: border-box !important;
	cursor: pointer !important;
	border-radius: 3px !important;
	white-space: normal !important;
	line-height: 1.5 !important;
	float: none !important;
	transition: filter 0.15s ease, transform 0.1s ease !important;
}

button.shoptimizly-primary-btn:hover {
	filter: brightness( 1.08 ) !important;
	transform: translateY( -1px ) !important;
	text-decoration: none !important;
}

/* =========================================================================
   SHOP / ARCHIVE PAGE BUTTONS
   ========================================================================= */
.woocommerce ul.products li.product .shoptimizly-primary-btn,
.woocommerce-page ul.products li.product .shoptimizly-primary-btn,
ul.products li.product a.button.shoptimizly-primary-btn,
ul.products li.product button.shoptimizly-primary-btn {
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 14px 16px !important;
	font-size: 0.95em !important;
	font-weight: 700 !important;
	text-align: center !important;
	box-sizing: border-box !important;
	cursor: pointer !important;
	border-radius: 3px !important;
	white-space: normal !important;
	line-height: 1.4 !important;
	float: none !important;
}

ul.products li.product a.button.shoptimizly-primary-btn:hover,
ul.products li.product button.shoptimizly-primary-btn:hover {
	filter: brightness( 1.08 ) !important;
	transform: translateY( -1px ) !important;
	text-decoration: none !important;
}

/* =========================================================================
   WHATSAPP INLINE BUTTON — single product page
   ========================================================================= */
.woocommerce div.product a.shoptimizly-whatsapp-inline-btn,
.shoptimizly-product-actions a.shoptimizly-whatsapp-inline-btn,
a.shoptimizly-whatsapp-inline-btn {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 13px 20px !important;
	background-color: #25d366 !important;
	color: #ffffff !important;
	border: 2px solid #25d366 !important;
	border-radius: 3px !important;
	font-size: 1em !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	cursor: pointer !important;
	box-sizing: border-box !important;
	line-height: 1.5 !important;
	float: none !important;
	transition: background-color 0.2s ease, transform 0.1s ease !important;
}

a.shoptimizly-whatsapp-inline-btn:hover,
a.shoptimizly-whatsapp-inline-btn:focus {
	background-color: #1ebe5d !important;
	border-color: #1ebe5d !important;
	color: #ffffff !important;
	text-decoration: none !important;
	transform: translateY( -1px ) !important;
}

a.shoptimizly-whatsapp-inline-btn svg {
	flex-shrink: 0;
	fill: #ffffff;
}

.shoptimizly-whatsapp-btn-text {
	color: #ffffff !important;
}

/* =========================================================================
   VARIATION ERROR NOTICE
   ========================================================================= */
.shoptimizly-variation-error {
	display: none;
	color: #9b2335;
	font-size: 0.9em;
	padding: 0.5em 0.75em;
	background: #fff5f5;
	border: 1px solid #fca5a5;
	border-radius: 3px;
	margin-bottom: 0.5em;
}

/* =========================================================================
   MODAL OVERLAY
   ========================================================================= */
.shoptimizly-modal {
	position: fixed;
	inset: 0;
	z-index: 999990;
	display: flex;
	align-items: center;
	justify-content: center;
}

.shoptimizly-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.6 );
	cursor: pointer;
}

/* =========================================================================
   MODAL BOX
   ========================================================================= */
.shoptimizly-modal-content {
	position: relative;
	background: #fff;
	border-radius: 6px;
	padding: 2em;
	width: 90%;
	max-width: 480px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 8px 40px rgba( 0, 0, 0, 0.25 );
	z-index: 1;
	box-sizing: border-box;
}

.shoptimizly-modal-title {
	margin: 0 0 1.25em;
	font-size: 1.4em;
	line-height: 1.3;
}

.shoptimizly-modal-close {
	position: absolute;
	top: 0.75em;
	right: 0.75em;
	background: transparent;
	border: none;
	font-size: 1.6em;
	line-height: 1;
	cursor: pointer;
	padding: 0.2em 0.4em;
	color: inherit;
	opacity: 0.6;
	transition: opacity 0.15s;
}

.shoptimizly-modal-close:hover,
.shoptimizly-modal-close:focus {
	opacity: 1;
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* =========================================================================
   MODAL MESSAGES
   ========================================================================= */
.shoptimizly-modal-messages {
	padding: 0.75em 1em;
	border-radius: 4px;
	margin-bottom: 1em;
	font-size: 0.95em;
	box-sizing: border-box;
}

.shoptimizly-modal-messages.is-success {
	background: #f0fff4;
	border: 1px solid #68d391;
	color: #276749;
}

.shoptimizly-modal-messages.is-error {
	background: #fff5f5;
	border: 1px solid #fc8181;
	color: #9b2335;
}

/* =========================================================================
   MODAL FORM FIELDS
   ========================================================================= */
.shoptimizly-order-form .shoptimizly-field {
	margin-bottom: 1.25em;
}

.shoptimizly-order-form label {
	display: block;
	margin-bottom: 0.4em;
	font-weight: 600;
	font-size: 0.9em;
}

.shoptimizly-required {
	color: #e53e3e;
	margin-left: 2px;
}

.shoptimizly-order-form input[type="tel"],
.shoptimizly-order-form input[type="text"],
.shoptimizly-order-form textarea {
	width: 100%;
	box-sizing: border-box;
}

.shoptimizly-field-submit .shoptimizly-submit-btn {
	width: 100%;
	font-size: 1em;
	padding: 0.75em 1.5em;
}

.shoptimizly-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* =========================================================================
   RESPONSIVE — mobile
   ========================================================================= */
@media ( max-width: 768px ) {
	.shoptimizly-modal-content {
		padding: 1.25em;
		width: 94%;
	}

	button.shoptimizly-primary-btn,
	a.shoptimizly-primary-btn,
	a.button.shoptimizly-primary-btn,
	a.shoptimizly-whatsapp-inline-btn {
		width: 100% !important;
		float: none !important;
		box-sizing: border-box !important;
	}

	a.shoptimizly-whatsapp-inline-btn {
		display: flex !important;
	}
}
