/**
 * Scoped frontend styles for EDX WooCommerce WhatsApp.
 *
 * All selectors use the `edx-wc-wa-` prefix to prevent collisions with
 * WordPress core, WooCommerce, or active themes (such as Blocksy).
 *
 * @package EDX_WooCommerce_WhatsApp
 */

.edx-wc-wa-block-slot,
.edx-wc-wa-trigger-wrap {
	width: 100%;
	margin: 12px 0;
	box-sizing: border-box;
}

.edx-wc-wa-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 46px;
	padding: 12px 18px;
	border: none;
	border-radius: 6px;
	background-color: #25d366;
	color: #ffffff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, opacity 0.2s ease;
	box-sizing: border-box;
}

.edx-wc-wa-button:hover,
.edx-wc-wa-button:focus {
	background-color: #1ebe5d;
	color: #ffffff;
	text-decoration: none;
}

.edx-wc-wa-button:focus-visible {
	outline: 2px solid #075e54;
	outline-offset: 2px;
}

.edx-wc-wa-button:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.edx-wc-wa-button--secondary {
	background-color: #f0f0f1;
	color: #1d2327;
	border: 1px solid #c3c4c7;
}

.edx-wc-wa-button--secondary:hover,
.edx-wc-wa-button--secondary:focus {
	background-color: #e0e0e2;
	color: #1d2327;
}

.edx-wc-wa-button--inline {
	width: auto;
	padding: 10px 16px;
	font-size: 14px;
}

.edx-wc-wa-button__icon {
	width: 18px;
	height: 18px;
	display: inline-block;
	flex-shrink: 0;
	background-color: currentColor;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38c1.45.79 3.08 1.21 4.74 1.21 5.46 0 9.91-4.45 9.91-9.91C21.95 6.45 17.5 2 12.04 2zm5.82 14.01c-.24.68-1.4 1.3-1.95 1.38-.51.08-1.16.11-1.87-.12-.43-.14-.98-.32-1.69-.63-2.98-1.29-4.93-4.3-5.08-4.5-.15-.2-1.21-1.61-1.21-3.07 0-1.46.77-2.18 1.04-2.48.27-.3.6-.37.8-.37.2 0 .4 0 .57.01.18.01.43-.07.67.51.24.58.82 2 .89 2.15.07.15.12.32.02.52-.1.2-.15.32-.3.5-.15.18-.31.4-.45.54-.15.15-.3.31-.13.6.17.3.76 1.25 1.63 2.02 1.12.99 2.06 1.3 2.36 1.45.3.15.47.13.65-.08.18-.2.75-.87.95-1.17.2-.3.4-.25.67-.15.27.1 1.73.82 2.03.97.3.15.5.22.57.35.08.12.08.72-.16 1.4z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38c1.45.79 3.08 1.21 4.74 1.21 5.46 0 9.91-4.45 9.91-9.91C21.95 6.45 17.5 2 12.04 2zm5.82 14.01c-.24.68-1.4 1.3-1.95 1.38-.51.08-1.16.11-1.87-.12-.43-.14-.98-.32-1.69-.63-2.98-1.29-4.93-4.3-5.08-4.5-.15-.2-1.21-1.61-1.21-3.07 0-1.46.77-2.18 1.04-2.48.27-.3.6-.37.8-.37.2 0 .4 0 .57.01.18.01.43-.07.67.51.24.58.82 2 .89 2.15.07.15.12.32.02.52-.1.2-.15.32-.3.5-.15.18-.31.4-.45.54-.15.15-.3.31-.13.6.17.3.76 1.25 1.63 2.02 1.12.99 2.06 1.3 2.36 1.45.3.15.47.13.65-.08.18-.2.75-.87.95-1.17.2-.3.4-.25.67-.15.27.1 1.73.82 2.03.97.3.15.5.22.57.35.08.12.08.72-.16 1.4z'/%3E%3C/svg%3E");
}

/* Modal overlay and dialog */
body.edx-wc-wa-modal-open {
	overflow: hidden;
}

.edx-wc-wa-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background-color: rgba(15, 23, 42, 0.6);
	box-sizing: border-box;
}

.edx-wc-wa-modal-overlay[hidden] {
	display: none !important;
}

.edx-wc-wa-modal {
	width: 100%;
	max-width: 480px;
	max-height: 92vh;
	overflow-y: auto;
	background: #ffffff;
	color: #1e293b;
	border-radius: 10px;
	box-shadow: 0 20px 38px rgba(0, 0, 0, 0.22);
	box-sizing: border-box;
}

.edx-wc-wa-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 22px;
	border-bottom: 1px solid #e2e8f0;
}

.edx-wc-wa-modal__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: #0f172a;
}

.edx-wc-wa-modal__close {
	background: transparent;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 4px;
}

.edx-wc-wa-modal__close:hover,
.edx-wc-wa-modal__close:focus {
	color: #0f172a;
	background: #f1f5f9;
}

.edx-wc-wa-modal__body {
	padding: 20px 22px 24px;
}

.edx-wc-wa-modal__subtitle {
	margin: 0 0 16px;
	font-size: 14px;
	color: #475569;
	line-height: 1.5;
}

.edx-wc-wa-field {
	margin-bottom: 14px;
}

.edx-wc-wa-field__label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
}

.edx-wc-wa-field__input,
.edx-wc-wa-field__textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background-color: #ffffff;
	color: #0f172a;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.4;
	box-sizing: border-box;
}

.edx-wc-wa-field__input:focus,
.edx-wc-wa-field__textarea:focus {
	outline: none;
	border-color: #25d366;
	box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
}

.edx-wc-wa-field--consent {
	margin-top: 12px;
	font-size: 13px;
	color: #475569;
	line-height: 1.45;
}

.edx-wc-wa-consent-label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	cursor: pointer;
}

.edx-wc-wa-consent-checkbox {
	margin-top: 3px;
	flex-shrink: 0;
}

.edx-wc-wa-privacy-link {
	color: #075e54;
	text-decoration: underline;
}

.edx-wc-wa-privacy-notice {
	margin: 12px 0;
	font-size: 13px;
	color: #475569;
}

.edx-wc-wa-alert {
	padding: 10px 12px;
	margin-bottom: 14px;
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.45;
}

.edx-wc-wa-alert--error {
	background-color: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.edx-wc-wa-modal__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 18px;
}

/* Confirmation state */
.edx-wc-wa-confirm-box {
	padding: 14px 16px;
	margin-bottom: 14px;
	background-color: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 8px;
	text-align: center;
}

.edx-wc-wa-confirm-box__label {
	display: block;
	font-size: 13px;
	color: #166534;
	margin-bottom: 4px;
}

.edx-wc-wa-confirm-box__code {
	display: block;
	font-size: 20px;
	font-weight: 700;
	color: #064e3b;
	letter-spacing: 0.5px;
}

.edx-wc-wa-confirm-message {
	margin: 0 0 10px;
	font-size: 14px;
	line-height: 1.5;
	color: #1e293b;
}

.edx-wc-wa-confirm-disclaimer {
	margin: 0 0 14px;
	padding: 10px 12px;
	background: #f8fafc;
	border-left: 3px solid #94a3b8;
	font-size: 12.5px;
	color: #475569;
	line-height: 1.45;
}

.edx-wc-wa-inline-confirm,
.edx-wc-wa-persistent-banner {
	margin-top: 12px;
	padding: 14px 16px;
	background-color: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 8px;
	font-size: 13.5px;
	color: #14532d;
}

.edx-wc-wa-persistent-banner {
	margin-bottom: 20px;
}

.edx-wc-wa-persistent-banner__title {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 700;
	color: #064e3b;
}

.edx-wc-wa-persistent-banner__desc {
	margin: 0 0 12px;
	font-size: 13px;
	color: #166534;
}

.edx-wc-wa-inline-confirm__ref {
	margin: 0 0 6px;
}

.edx-wc-wa-inline-confirm__link {
	font-weight: 600;
	color: #075e54;
	text-decoration: underline;
}

/*
 * Visually hide the Cart Totals summary ("Cart totals", summary Subtotal, and Total)
 * in WooCommerce Cart/Checkout Blocks and classic/Blocksy cart/checkout when
 * "Mostrar total del carrito en checkout" is OFF, while keeping product unit prices,
 * product line subtotals, and action buttons visible.
 */
body.edx-wc-wa-hide-checkout-total .wc-block-cart__totals-title,
body.edx-wc-wa-hide-checkout-total .wp-block-woocommerce-cart-order-summary-heading-block,
body.edx-wc-wa-hide-checkout-total .wp-block-woocommerce-cart-order-summary-subtotal-block,
body.edx-wc-wa-hide-checkout-total .wp-block-woocommerce-cart-order-summary-totals-block,
body.edx-wc-wa-hide-checkout-total .wp-block-woocommerce-checkout-order-summary-subtotal-block,
body.edx-wc-wa-hide-checkout-total .wp-block-woocommerce-checkout-order-summary-totals-block,
body.edx-wc-wa-hide-checkout-total .wc-block-components-totals-item,
body.edx-wc-wa-hide-checkout-total .wc-block-components-totals-footer-item,
body.edx-wc-wa-hide-checkout-total .cart_totals > h2,
body.edx-wc-wa-hide-checkout-total .cart_totals .shop_table,
body.edx-wc-wa-hide-checkout-total .cart_totals tr.cart-subtotal,
body.edx-wc-wa-hide-checkout-total .cart_totals tr.order-total,
body.edx-wc-wa-hide-checkout-total .woocommerce-checkout-review-order-table tfoot {
	display: none !important;
}

body.edx-wc-wa-hide-checkout-total .wc-block-components-totals-wrapper:not(:has(.edx-wc-wa-block-slot)) {
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
}


