/* Smart Free Gifts for WooCommerce — Frontend Styles (Scoped .sfgwc-* for XStore & Elementor Pro compatibility) */

:root {
	--sfgwc-icon-v: 12px;
	--sfgwc-icon-h: 12px;
	--sfgwc-icon-size: 22px;
	--sfgwc-icon-color: #ffffff;
	--sfgwc-icon-bg: #e53935;
	--sfgwc-box-font-size: 14px;
	--sfgwc-title-color: #e53935;
	--sfgwc-item-color: #222222;
	--sfgwc-hover-color: #e53935;
	--sfgwc-box-bg: #ffffff;
	--sfgwc-box-border: #e6e6e6;
}

/* ==========================================================================
   Shop / Archive Product Gift Badge (Compatible with WooCommerce, XStore Grid/Carousel & Elementor Loops)
   ========================================================================== */
.woocommerce ul.products li.product:has(> .sfgwc-shop-badge),
.woocommerce ul.products li.product a.woocommerce-loop-product__link:has(.sfgwc-shop-badge),
.content-product .product-content-image:has(.sfgwc-shop-badge),
.etheme-product-grid-image:has(.sfgwc-shop-badge),
.elementor-widget-woocommerce-products .product:has(.sfgwc-shop-badge) {
	position: relative;
}

.sfgwc-shop-badge {
	position: absolute !important;
	z-index: 25 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: calc(var(--sfgwc-icon-size) + 14px) !important;
	height: calc(var(--sfgwc-icon-size) + 14px) !important;
	min-width: calc(var(--sfgwc-icon-size) + 14px) !important;
	min-height: calc(var(--sfgwc-icon-size) + 14px) !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 50% !important;
	background-color: var(--sfgwc-icon-bg) !important;
	color: var(--sfgwc-icon-color) !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
	pointer-events: none;
	line-height: 1 !important;
	box-sizing: border-box !important;
	transition: transform 0.2s ease;
}

.sfgwc-shop-badge svg {
	width: var(--sfgwc-icon-size) !important;
	height: var(--sfgwc-icon-size) !important;
	max-width: var(--sfgwc-icon-size) !important;
	max-height: var(--sfgwc-icon-size) !important;
	display: block !important;
	flex-shrink: 0 !important;
}

.sfgwc-shop-badge img.sfgwc-custom-gift-img {
	width: var(--sfgwc-icon-size) !important;
	height: var(--sfgwc-icon-size) !important;
	max-width: var(--sfgwc-icon-size) !important;
	max-height: var(--sfgwc-icon-size) !important;
	object-fit: contain !important;
	display: block !important;
	border-radius: 4px;
}

.sfgwc-shop-badge.sfgwc-pos-top_left {
	top: var(--sfgwc-icon-v) !important;
	left: var(--sfgwc-icon-h) !important;
	right: auto !important;
	bottom: auto !important;
}

.sfgwc-shop-badge.sfgwc-pos-top_right {
	top: var(--sfgwc-icon-v) !important;
	right: var(--sfgwc-icon-h) !important;
	left: auto !important;
	bottom: auto !important;
}

.sfgwc-shop-badge.sfgwc-pos-bottom_left {
	bottom: var(--sfgwc-icon-v) !important;
	left: var(--sfgwc-icon-h) !important;
	top: auto !important;
	right: auto !important;
}

.sfgwc-shop-badge.sfgwc-pos-bottom_right {
	bottom: var(--sfgwc-icon-v) !important;
	right: var(--sfgwc-icon-h) !important;
	top: auto !important;
	left: auto !important;
}

/* ==========================================================================
   Single Product Gift Box
   ========================================================================== */
.sfgwc-gift-box {
	background-color: var(--sfgwc-box-bg);
	border: 1px solid var(--sfgwc-box-border);
	border-radius: 6px;
	padding: 16px 18px;
	margin: 18px 0;
	font-size: var(--sfgwc-box-font-size);
	line-height: 1.45;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	clear: both;
}

.sfgwc-gift-box__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--sfgwc-box-border);
}

.sfgwc-gift-box__title {
	color: var(--sfgwc-title-color);
	font-weight: 700;
	font-size: calc(var(--sfgwc-box-font-size) * 0.95);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.sfgwc-gift-box__list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.sfgwc-gift-item {
	display: flex;
	align-items: center;
	gap: 14px;
}

.sfgwc-gift-item__thumb {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	border-radius: 4px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.08);
	background: #fafafa;
}

.sfgwc-gift-item__thumb img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	display: block;
	margin: 0 !important;
}

.sfgwc-gift-item__info {
	flex: 1 1 auto;
	min-width: 0;
}

.sfgwc-gift-item__name {
	font-weight: 600;
	color: var(--sfgwc-item-color);
	margin-bottom: 4px;
	word-break: break-word;
}

.sfgwc-gift-item__name a {
	color: var(--sfgwc-item-color);
	text-decoration: none;
	transition: color 0.15s ease;
}

.sfgwc-gift-item__name a:hover {
	color: var(--sfgwc-hover-color);
}

.sfgwc-gift-item__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 0.9em;
	color: #666666;
}

.sfgwc-gift-item__variation {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.sfgwc-gift-item__sep {
	opacity: 0.5;
}

/* Variation Edit Pencil Button (Single Product & Cart) */
.sfgwc-edit-variation-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 3px 5px;
	margin: 0 0 0 4px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 4px;
	color: #555555;
	cursor: pointer;
	line-height: 1;
	vertical-align: middle;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.sfgwc-edit-variation-btn:hover,
.sfgwc-edit-variation-btn:focus {
	color: var(--sfgwc-hover-color);
	background: rgba(0, 0, 0, 0.05);
	border-color: rgba(0, 0, 0, 0.1);
	outline: none;
}

.sfgwc-edit-variation-btn svg {
	width: 14px;
	height: 14px;
	display: block;
}

/* ==========================================================================
   Floating Single Product Popup Mode
   ========================================================================== */
.sfgwc-popup-container {
	position: fixed;
	z-index: 99990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	max-width: min(340px, calc(100vw - 24px));
}

.sfgwc-popup-container.sfgwc-popup-bottom_right {
	bottom: 24px;
	right: 24px;
	align-items: flex-end;
}

.sfgwc-popup-container.sfgwc-popup-bottom_left {
	bottom: 24px;
	left: 24px;
	align-items: flex-start;
}

.sfgwc-popup-container.sfgwc-popup-top_right {
	top: 96px;
	right: 24px;
	align-items: flex-end;
}

.sfgwc-popup-container.sfgwc-popup-top_left {
	top: 96px;
	left: 24px;
	align-items: flex-start;
}

.sfgwc-popup-panel {
	width: 320px;
	max-width: calc(100vw - 24px);
	transition: opacity 0.22s ease, transform 0.22s ease;
}

.sfgwc-popup-container.is-collapsed .sfgwc-popup-panel {
	display: none;
}

.sfgwc-popup-container.has-shadow .sfgwc-gift-box--popup {
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

.sfgwc-gift-box--popup {
	margin: 0;
}

.sfgwc-popup-close {
	background: transparent;
	border: none;
	color: #777777;
	font-size: 20px;
	line-height: 1;
	padding: 0 4px;
	cursor: pointer;
}

.sfgwc-popup-close:hover {
	color: #111111;
}

.sfgwc-popup-launcher {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	border: none;
	background-color: var(--sfgwc-icon-bg);
	color: var(--sfgwc-icon-color);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
	cursor: pointer;
	transition: transform 0.2s ease;
}

.sfgwc-popup-launcher:hover {
	transform: scale(1.06);
}

.sfgwc-popup-launcher svg,
.sfgwc-popup-launcher img {
	width: 24px;
	height: 24px;
	display: block;
}

.sfgwc-popup-container.is-open .sfgwc-popup-launcher {
	display: none;
}

/* ==========================================================================
   Cart & Checkout Gift Formatting + Teaser Notices
   ========================================================================== */
.sfgwc-cart-notices-wrap {
	margin-bottom: 18px;
}

.sfgwc-cart-notices-wrap:empty {
	display: none;
	margin: 0;
}

.sfgwc-cart-notice {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	margin-bottom: 10px;
	background: #fff8f6;
	border: 1px solid #f4c7c3;
	border-left: 4px solid var(--sfgwc-title-color);
	border-radius: 4px;
	color: #2c2c2c;
	font-size: 14px;
	line-height: 1.45;
}

.sfgwc-cart-notice__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--sfgwc-title-color);
	flex-shrink: 0;
}

.sfgwc-cart-notice__icon svg {
	width: 18px;
	height: 18px;
	display: block;
}

.sfgwc-cart-price-wrap {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	vertical-align: middle;
	font-size: 14px !important;
	line-height: 1.35 !important;
	white-space: nowrap;
}

.sfgwc-cart-strike,
.sfgwc-cart-strike .woocommerce-Price-amount,
.sfgwc-cart-strike bdi {
	color: #888888 !important;
	text-decoration: line-through !important;
	font-size: 13.5px !important;
	line-height: 1.3 !important;
}

.sfgwc-cart-gift-icon {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	color: var(--sfgwc-icon-bg) !important;
	width: 20px !important;
	height: 20px !important;
	min-width: 20px !important;
	flex-shrink: 0 !important;
}

.sfgwc-cart-gift-icon svg,
.sfgwc-cart-gift-icon img {
	width: 18px !important;
	height: 18px !important;
	max-width: 18px !important;
	max-height: 18px !important;
	min-width: 18px !important;
	display: block !important;
	object-fit: contain !important;
}

.sfgwc-cart-free-badge,
.sfgwc-checkout-gift-pill {
	display: inline-block !important;
	padding: 3px 9px !important;
	border-radius: 999px !important;
	background: #e8f5e9 !important;
	color: #1b5e20 !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.03em;
	vertical-align: middle;
	white-space: nowrap;
}

.sfgwc-cart-zero-price,
.sfgwc-cart-zero-price .woocommerce-Price-amount,
.sfgwc-cart-zero-price bdi {
	font-size: 14px !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	line-height: 1.3 !important;
}

/* Locked Quantity in Cart (Desktop & Mobile) and Checkout (Desktop & Mobile) */
.sfgwc-locked-qty {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-width: 28px;
	text-align: center;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	color: #222222 !important;
	white-space: nowrap;
}

/* Desktop cart quantity column shows clean number without prefix */
td.product-quantity .sfgwc-qty-mobile-label {
	display: none !important;
}

/* Mobile cart row (.product-price-quantity has font-size:0 in KeepFit/XStore) */
.product-price-quantity .sfgwc-locked-qty {
	display: inline-flex !important;
	font-size: 13px !important;
	padding: 4px 11px !important;
	border: 1px solid #d5dce0 !important;
	border-radius: 6px !important;
	background: #f8f9fa !important;
	color: #06191e !important;
}

.product-price-quantity .sfgwc-qty-mobile-label {
	display: inline !important;
	font-weight: 500;
	margin-right: 3px;
}

/* Checkout ("TU PEDIDO") Locked Qty + Gift Badge — Desktop & Mobile */
.sfgwc-checkout-locked-wrap {
	display: inline-flex !important;
	align-items: center !important;
	flex-wrap: wrap !important;
	gap: 8px !important;
	font-size: 13px !important;
	line-height: 1.35 !important;
}

.sfgwc-checkout-qty-pill {
	padding: 4px 10px !important;
	border: 1px solid #d5dce0 !important;
	border-radius: 6px !important;
	background: #f8f9fa !important;
	color: #06191e !important;
	font-size: 13px !important;
	font-weight: 600 !important;
}

.woocommerce-checkout-review-order-table tr.sfgwc-is-gift-item .quantity,
.woocommerce-checkout-review-order-table tr.sfgwc-is-gift-item .quantity-wrapper,
.woocommerce-checkout-review-order-table tr.sfgwc-is-gift-item .et-quantity {
	display: none !important;
}

/* ==========================================================================
   XStore / KeepFit Off-Canvas Mini-Cart Gift Item Lock & Alignment
   ========================================================================== */
.woocommerce-mini-cart-item.sfgwc-is-gift-item .quantity-wrapper,
.woocommerce-mini-cart-item.sfgwc-is-gift-item .et-quantity,
.woocommerce-mini-cart-item.sfgwc-is-gift-item .remove,
.woocommerce-mini-cart-item.sfgwc-is-gift-item .remove_from_cart_button {
	display: none !important;
}

.woocommerce-mini-cart-item.sfgwc-is-gift-item .sfgwc-mini-cart-gift-row,
.sfgwc-mini-cart-gift-row {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 10px !important;
	margin-top: 8px !important;
	width: 100% !important;
	font-size: 13.5px !important;
	line-height: 1.35 !important;
	box-sizing: border-box !important;
}

.sfgwc-mini-cart-qty-pill {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 4px 10px !important;
	border: 1px solid #d5dce0 !important;
	border-radius: 6px !important;
	background: #f8f9fa !important;
	color: #06191e !important;
	font-size: 12.5px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	white-space: nowrap !important;
	flex-shrink: 0 !important;
}

.sfgwc-mini-cart-gift-price {
	margin-left: auto !important;
	display: inline-flex !important;
	align-items: center !important;
	flex-shrink: 0 !important;
}

/* Full-width spacing when relocated cleanly below Elementor Add-to-Cart + Wishlist row */
.sfgwc-gift-box.sfgwc-relocated-box {
	width: 100%;
	flex-basis: 100%;
	margin-top: 14px;
	margin-bottom: 14px;
}

/* ==========================================================================
   Variation Switcher Modal (Accessible, Centered, Above XStore / Elementor Layers)
   ========================================================================== */
.sfgwc-modal {
	position: fixed;
	inset: 0;
	z-index: 100050;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.sfgwc-modal.is-open {
	display: flex;
}

.sfgwc-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.52);
	backdrop-filter: blur(2px);
}

.sfgwc-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 380px;
	background: #ffffff;
	border-radius: 8px;
	padding: 24px;
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
	box-sizing: border-box;
	animation: sfgwcFadeScale 0.18s ease-out;
}

@keyframes sfgwcFadeScale {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.sfgwc-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: transparent;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: #777777;
	cursor: pointer;
	padding: 4px;
}

.sfgwc-modal__close:hover {
	color: #111111;
}

.sfgwc-modal__header {
	margin-bottom: 16px;
	padding-right: 24px;
}

.sfgwc-modal__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #1f1f1f;
}

.sfgwc-modal__loading {
	text-align: center;
	padding: 18px 0;
	color: #666666;
	font-size: 14px;
}

.sfgwc-modal__field {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.sfgwc-modal__field label {
	font-size: 14px;
	font-weight: 500;
	color: #333333;
	margin: 0;
	flex: 0 0 38%;
}

.sfgwc-modal__field select {
	flex: 1 1 auto;
	width: 100%;
	min-height: 38px;
	padding: 6px 10px;
	border: 1px solid #d4d4d4;
	border-radius: 4px;
	background: #ffffff;
	color: #222222;
	font-size: 14px;
}

.sfgwc-modal__error {
	background: #fdecea;
	color: #b71c1c;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	padding: 8px 12px;
	font-size: 13px;
	margin-top: 8px;
}

.sfgwc-modal__footer {
	margin-top: 18px;
	text-align: center;
}

.sfgwc-modal__submit {
	width: 100%;
	min-height: 42px;
	background-color: #111111;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.sfgwc-modal__submit:hover:not(:disabled) {
	opacity: 0.88;
}

.sfgwc-modal__submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
