/**
 * Frontend styles for Free Gift Rules.
 */

.wfgr-badge {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #0b6e4f;
	background: #e6f6ef;
	border-radius: 3px;
	vertical-align: middle;
}

.wfgr-free-label {
	font-weight: 700;
	color: #0b6e4f;
}

.wfgr-message {
	margin: 0 0 1.25rem;
	padding: 1rem 1.25rem;
	border: 1px solid #c8e6d5;
	background: linear-gradient(135deg, #f3fbf7 0%, #eef6f2 100%);
	border-radius: 6px;
}

.wfgr-message--compact {
	margin: 0.5rem 0;
	padding: 0.75rem 1rem;
	font-size: 0.9em;
}

.wfgr-message__unlocked,
.wfgr-message__progress {
	margin: 0 0 0.5rem;
}

.wfgr-progress {
	height: 8px;
	background: #dce8e1;
	border-radius: 999px;
	overflow: hidden;
}

.wfgr-progress__bar {
	display: block;
	height: 100%;
	background: #0b6e4f;
	border-radius: 999px;
	transition: width 0.35s ease;
}

.wfgr-progress__meta {
	margin: 0.4rem 0 0;
	font-size: 0.85em;
	opacity: 0.85;
}

.wfgr-gift-choice {
	margin: 0 0 1.5rem;
	padding: 1.25rem;
	border: 1px dashed #0b6e4f;
	border-radius: 6px;
	background: #fff;
}

.wfgr-gift-choice h3 {
	margin-top: 0;
}

.wfgr-gift-choice__options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
}

.wfgr-gift-choice__option {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px;
	border: 2px solid #e5e7eb;
	border-radius: 6px;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wfgr-gift-choice__option:has(input:checked) {
	border-color: #0b6e4f;
	box-shadow: 0 0 0 1px #0b6e4f;
}

.wfgr-gift-choice__thumb img {
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.wfgr-gift-choice__name {
	font-size: 0.9em;
	line-height: 1.3;
}

/* Gift lines: no qty stepper / remove (managed by plugin) */
.wfgr-gift-line .pc-cart-item-remove,
.wfgr-gift-line .pc-drawer-item-remove,
.wfgr-gift-line .pc-cart-qty-stepper,
.wfgr-gift-line .product-remove a,
.wfgr-gift-line a.remove,
.pc-drawer-cart-item.wfgr-gift-line .pc-drawer-item-remove {
	display: none !important;
}

.wfgr-gift-qty {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	font-weight: 600;
}

/* Unlock popup */
body.wfgr-popup-open {
	overflow: hidden;
}

.wfgr-popup[hidden] {
	display: none !important;
}

.wfgr-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.wfgr-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 24, 22, 0.55);
}

.wfgr-popup__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 420px);
	padding: 1.75rem 1.5rem 1.5rem;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
	text-align: center;
	animation: wfgr-pop 0.28s ease;
}

@keyframes wfgr-pop {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.wfgr-popup__close {
	position: absolute;
	top: 0.5rem;
	right: 0.65rem;
	border: 0;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: #666;
}

.wfgr-popup__media img {
	max-width: 96px;
	height: auto;
	margin: 0 auto 0.75rem;
	border-radius: 8px;
}

.wfgr-popup__title {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	color: #0b6e4f;
}

.wfgr-popup__message {
	margin: 0 0 0.35rem;
	font-size: 1rem;
}

.wfgr-popup__product {
	margin: 0 0 1.25rem;
	font-weight: 600;
}

.wfgr-popup__cta.button,
.wfgr-popup__cta.button.alt {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box !important;
	width: 100% !important;
	min-width: 160px;
	min-height: 52px !important;
	margin: 0 !important;
	padding: 14px 20px !important;
	border-radius: var(--pc-radius-sm, 8px) !important;
	background: #fff !important;
	color: var(--pc-brand, #2a1810) !important;
	border: 1px solid var(--pc-brand, #2a1810) !important;
	box-shadow: none !important;
	font-family: var(--pc-font-body, inherit) !important;
	font-size: 0.9rem !important;
	font-weight: 700 !important;
	line-height: 1.25 !important;
	text-align: center !important;
	text-transform: none !important;
	text-decoration: none !important;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wfgr-popup__cta.button:hover,
.wfgr-popup__cta.button.alt:hover {
	background: var(--pc-yellow, #f5d76e) !important;
	border-color: var(--pc-yellow, #f5d76e) !important;
	color: var(--pc-brand, #2a1810) !important;
}
