/* ── Banner ──────────────────────────────────────────────────────────── */
/* Uses theme secondary-light background (#d9e0d1) and secondary text (#365d00) */
.wcfgt-banner {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #d9e0d1;
	border: 1px solid #b5c7a3;
	border-radius: 6px;
	padding: 14px 18px;
	margin-bottom: 20px;
	font-size: 15px;
	line-height: 1.5;
	color: #1a1a1a;
}

.wcfgt-banner-icon {
	font-size: 20px;
	flex-shrink: 0;
}

.wcfgt-banner-link {
	font-weight: 700;
	color: #365d00;
	text-decoration: underline;
}

.wcfgt-banner-link:hover {
	color: #2a4600;
}

/* ── Modal overlay ───────────────────────────────────────────────────── */
.wcfgt-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.wcfgt-modal {
	background: #fff;
	border-radius: 10px;
	padding: 32px 28px 24px;
	max-width: 680px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.wcfgt-modal-close {
	position: absolute;
	top: 16px;
	right: 18px;
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #555;
	padding: 0;
}

.wcfgt-modal-close:hover {
	color: #000;
}

.wcfgt-modal-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 20px;
	padding-right: 32px;
}

/* Compact modal when only 1 product is offered */
@media ( min-width: 481px ) {
	.wcfgt-modal--single {
		max-width: 360px;
	}
}

/* ── Product grid ────────────────────────────────────────────────────── */
.wcfgt-modal-products {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 16px;
	margin-bottom: 20px;
}

.wcfgt-modal-product {
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	cursor: pointer;
	transition: border-color 0.15s;
	text-align: center;
}

.wcfgt-modal-product:hover {
	border-color: #365d00;
}

/* Selected state uses theme secondary */
.wcfgt-modal-product--selected {
	border-color: #365d00;
	background: #f0f5ec;
}

.wcfgt-modal-product-img {
	width: 100%;
	max-height: 180px;
	object-fit: contain;
	margin-bottom: 10px;
	border-radius: 4px;
}

.wcfgt-modal-product-name {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 12px;
	line-height: 1.35;
}

/* ── Variation selectors ─────────────────────────────────────────────── */
.wcfgt-modal-variation {
	margin-top: 10px;
	text-align: left;
}

.wcfgt-modal-variation-label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 4px;
}

.wcfgt-required {
	color: #c0392b;
}

.wcfgt-modal-variation-select {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
	margin-top: 4px;
}

/* ── "Add to cart" button — theme btn--secondary ─────────────────────── */
/* We emit btn btn--secondary classes on the button so the theme handles most
   of the styling. These rules are a safe fallback if the theme CSS isn't loaded. */
.wcfgt-modal-add-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 12px 20px;
	background: #365d00;
	color: #fff;
	border: none;
	border-radius: 32px;        /* theme $border-radius */
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.3s ease;
}

.wcfgt-modal-add-btn:hover:not(:disabled) {
	background: #2a4600;        /* darken(#365d00, 8) */
	transform: scale(1.02);
}

.wcfgt-modal-add-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ── Footer error ────────────────────────────────────────────────────── */
.wcfgt-modal-error {
	color: #c0392b;
	font-size: 14px;
	margin-bottom: 12px;
}

/* ── Classic cart row overrides ──────────────────────────────────────── */
body.wcfgt-modal-open {
	overflow: hidden;
}

/* Placeholder rows: hide remove and quantity (system items, not user-removable) */
.wcfgt-placeholder-row .product-remove {
	display: none !important;
}

.wcfgt-placeholder-row .product-quantity {
	display: none !important;
}

/* Gift rows: hide quantity column (locked to 1), keep remove visible */
.wcfgt-gift-row .product-quantity {
	display: none !important;
}

.wcfgt-placeholder-row td.product-name {
	vertical-align: middle;
}

.wcfgt-slot-label {
	display: block;
	font-weight: 700;
	margin-bottom: 8px;
	font-size: 15px;
}

/* "Kies hier je gratis cadeau" button inherits theme btn btn--secondary;
   add only the small extras that the theme doesn't cover in this context. */
.wcfgt-choose-btn {
	margin-top: 4px;
}

/* GRATIS badge — classic cart (PHP injects a <span class="wcfgt-gratis-badge">) */
.wcfgt-gratis-badge {
	display: inline-block;
	background: #365d00;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 32px;
	margin-left: 8px;
	vertical-align: middle;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

/* GRATIS badge — block cart (CSS ::after, no DOM manipulation needed) */
.wcfgt-gift-row .wc-block-components-product-name::after {
	content: 'GRATIS CADEAU';
	display: inline-block;
	background: #365d00;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 32px;
	margin-left: 8px;
	vertical-align: middle;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media ( max-width: 480px ) {
	.wcfgt-modal {
		padding: 24px 16px 16px;
	}
	.wcfgt-modal-products {
		grid-template-columns: 1fr;
	}
}
