/* Float Gift Fields – product page styling */

.fgf-fields {
	margin: 1.5em 0 1.75em;
	padding: 1.25em 1.35em;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.04);
	backdrop-filter: blur(4px);
}

.fgf-section + .fgf-section {
	margin-top: 1.5em;
	padding-top: 1.35em;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.fgf-fields .fgf-heading,
.fgf-fields .fgf-field-label,
.fgf-fields .fgf-pair-label,
.fgf-fields .fgf-delivery-option__title {
	display: block;
	margin: 0;
	padding: 0;
	color: #fff !important;
	font-family: inherit;
	font-weight: 400 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.07em;
	line-height: 1.35;
	background: none;
	border: none;
}

.fgf-fields .fgf-heading {
	margin-bottom: 0.35em;
	font-size: 0.93rem !important;
}

.fgf-hint {
	margin: 0 0 1em;
	color: rgba(255, 255, 255, 0.65) !important;
	font-size: 0.78rem;
	font-weight: 400;
	line-height: 1.45;
}

/* Name pairs */

.fgf-pairs {
	display: flex;
	flex-direction: column;
	gap: 0.85em;
}

.fgf-pair {
	display: flex;
	flex-direction: column;
	gap: 0.55em;
	padding: 0.85em 0.9em;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.15);
	opacity: 1;
	max-height: 240px;
	overflow: hidden;
	transition:
		opacity 0.28s ease,
		max-height 0.28s ease,
		margin 0.28s ease,
		padding 0.28s ease,
		background 0.2s ease,
		border-color 0.2s ease;
}

.fgf-pair.fgf-pair--hidden {
	opacity: 0;
	max-height: 0;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	pointer-events: none;
}

.fgf-pair:focus-within {
	background: rgba(0, 0, 0, 0.22);
	border-color: rgba(116, 190, 241, 0.45);
}

.fgf-fields .fgf-pair-label {
	font-size: 0.87rem !important;
	text-align: left;
	padding: 0 0 0.35em;
	margin-bottom: 0.15em;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.fgf-pair-inputs {
	display: flex;
	flex-direction: column;
	gap: 0.55em;
}

.fgf-field {
	display: flex;
	flex-direction: column;
	gap: 0.25em;
	margin: 0;
}

.fgf-fields .fgf-field-label {
	font-size: 0.84rem !important;
}

.fgf-input {
	width: 100%;
	padding: 0.55em 0.75em;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.95);
	color: #1a2a3a;
	font-size: 0.92rem;
	line-height: 1.3;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.fgf-input:focus {
	outline: none;
	border-color: #4a90c4;
	box-shadow: 0 0 0 3px rgba(74, 144, 196, 0.25);
}

/* Delivery toggle */

.fgf-toggle-wrap {
	display: flex;
	align-items: center;
	gap: 0.85em;
	margin: 0.75em 0 0.65em;
}

.fgf-toggle-label {
	font-size: 0.88rem;
	font-weight: 500;
	opacity: 0.5;
	cursor: pointer;
	transition: opacity 0.2s ease, font-weight 0.2s ease;
	user-select: none;
}

.fgf-toggle-label.is-active {
	opacity: 1;
	font-weight: 600;
}

.fgf-toggle {
	position: relative;
	display: inline-block;
	width: 52px;
	height: 28px;
	flex-shrink: 0;
	cursor: pointer;
}

.fgf-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.fgf-toggle-slider {
	position: absolute;
	inset: 0;
	border-radius: 28px;
	background: rgba(255, 255, 255, 0.2);
	transition: background 0.25s ease;
}

.fgf-toggle-slider::before {
	content: '';
	position: absolute;
	height: 22px;
	width: 22px;
	left: 3px;
	bottom: 3px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	transition: transform 0.25s ease;
}

.fgf-toggle input:checked + .fgf-toggle-slider {
	background: #4a90c4;
}

.fgf-toggle input:checked + .fgf-toggle-slider::before {
	transform: translateX(24px);
}

.fgf-toggle input:focus-visible + .fgf-toggle-slider {
	box-shadow: 0 0 0 3px rgba(74, 144, 196, 0.35);
}

.fgf-delivery-desc {
	margin: 0;
	padding: 0.75em 0.9em;
	border-radius: 6px;
	background: rgba(74, 144, 196, 0.12);
	border-left: 3px solid #4a90c4;
	color: rgba(255, 255, 255, 0.88) !important;
	font-size: 0.82rem;
	line-height: 1.5;
	white-space: pre-line;
}

/* Cart / checkout item meta */

.woocommerce-cart .fgf-fields,
.woocommerce-checkout .fgf-fields {
	display: none;
}

/* Admin order column */

.column-fgf_gift_info {
	width: 14%;
}

.column-fgf_gift_info strong {
	display: inline-block;
	margin-bottom: 2px;
}

/* Light theme fallback (if product area is light) */

.single-product .product .fgf-fields {
	border-color: rgba(0, 0, 0, 0.08);
	background: rgba(0, 0, 0, 0.02);
}

.single-product .product .fgf-pair {
	background: rgba(0, 0, 0, 0.04);
	border-color: rgba(0, 0, 0, 0.1);
}

.single-product .product .fgf-section + .fgf-section {
	border-top-color: rgba(0, 0, 0, 0.08);
}

/* Full-width block above qty/button — do not restyle Elementor qty/button. */
.fgf-fields,
form.cart .fgf-fields,
form.variations_form .fgf-fields,
.elementor-widget-woocommerce-product-add-to-cart .fgf-fields {
	display: block !important;
	clear: both !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	margin: 0 0 1.25em !important;
}

/* Delivery choice */
.fgf-delivery-options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.7em;
	margin: 0.8em 0;
}

.fgf-delivery-option {
	display: block;
	position: relative;
	margin: 0;
	cursor: pointer;
}

.fgf-delivery-option input {
	position: absolute;
	opacity: 0 !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	border: 0 !important;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	overflow: hidden;
	pointer-events: none !important;
}

.fgf-delivery-option__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	min-height: 62px;
	padding: 0.7em 0.8em;
	box-sizing: border-box;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.12);
	transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.single-product form.cart .fgf-delivery-option__content {
	width: 100%;
}

.fgf-delivery-option:hover .fgf-delivery-option__content {
	transform: translateY(-1px);
	border-color: rgba(116, 190, 241, 0.75);
}

.fgf-delivery-option input:checked + .fgf-delivery-option__content {
	border-color: #59a9df;
	background: rgba(74, 144, 196, 0.26);
	box-shadow: inset 0 0 0 1px rgba(116, 190, 241, 0.25);
}

.fgf-delivery-option input:focus-visible + .fgf-delivery-option__content {
	outline: 3px solid rgba(116, 190, 241, 0.45);
	outline-offset: 2px;
}

.fgf-delivery-option__title,
.fgf-delivery-option__sub {
	display: block;
}

.fgf-fields .fgf-delivery-option__title {
	font-size: 0.93rem !important;
}

.fgf-fields .fgf-delivery-option__sub {
	margin-top: 0.15em;
	color: rgba(255, 255, 255, 0.7) !important;
	font-size: 0.87rem !important;
	font-weight: 400 !important;
	line-height: 1.25;
	text-transform: none !important;
	letter-spacing: normal;
}

/* Guard against theme / Elementor form styles leaking into this component. */
.single-product form.cart .fgf-fields label,
.single-product form.cart .fgf-fields input,
.single-product form.cart .fgf-fields span,
.single-product form.cart .fgf-fields p,
.elementor-widget-woocommerce-product-add-to-cart .fgf-fields label,
.elementor-widget-woocommerce-product-add-to-cart .fgf-fields p {
	float: none;
}

@media (max-width: 600px) {
	.fgf-delivery-options {
		grid-template-columns: 1fr;
	}
}
