/*
 * biomed-gift-coupons frontend styles.
 *
 * Scope: product-page recipient form only (enqueued via
 * BioMed_GC_Product_Page::enqueue_assets). Checkout input styling lives
 * in a separate stylesheet in Phase 5.
 */

.biomed-gc-recipient-form {
	margin: 1.5em 0;
	padding: 1.25em 1.25em 1em;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fafafa;
}

/*
 * Hide the hook-rendered form until product-page.js has resolved whether a
 * shortcode instance exists on the page. JS either removes the hook form
 * (if shortcode present) or strips this attribute (if shortcode absent),
 * revealing it. Prevents the flash of two visible forms even when
 * server-side shortcode detection misses.
 */
.biomed-gc-recipient-form[data-biomed-gc-hook-pending] {
	display: none;
}

.biomed-gc-recipient-form__title {
	margin: 0 0 0.75em;
	font-size: 1.05em;
	font-weight: 600;
}

.biomed-gc-field {
	display: block;
	margin: 0 0 0.9em;
}

.biomed-gc-field label {
	display: block;
	margin-bottom: 0.35em;
	font-weight: 500;
	font-size: 0.95em;
}

.biomed-gc-field label .required {
	color: #c0392b;
	margin-left: 2px;
}

.biomed-gc-field__optional {
	color: #777;
	font-weight: 400;
	font-size: 0.9em;
	margin-left: 4px;
}

.biomed-gc-field input[type="text"],
.biomed-gc-field textarea {
	width: 100%;
	padding: 0.85em 1em;
	border: 1px solid #ccc;
	/* Match Woodmart textarea rounding on the webshop for visual
	   consistency between the name input and the message textarea.
	   Previously 4px which didn't match the heavily-rounded default
	   Woodmart form field styling. */
	border-radius: 25px;
	background: #fff;
	font: inherit;
	box-sizing: border-box;
}

.biomed-gc-field textarea {
	/* textarea gets softer corners because the element is tall — the
	   same full pill radius looks odd on a multi-line box. */
	border-radius: 25px;
}

.biomed-gc-field textarea {
	resize: vertical;
	min-height: 3.2em;
}

.biomed-gc-field input:focus,
.biomed-gc-field textarea:focus {
	outline: 2px solid var(--wd-primary-color, #83b735);
	outline-offset: 1px;
	border-color: transparent;
}

.biomed-gc-field__hint {
	display: block;
	margin-top: 0.3em;
	font-size: 0.85em;
	color: #666;
}

.biomed-gc-field__counter {
	font-variant-numeric: tabular-nums;
}

.biomed-gc-field__counter.is-near-limit {
	color: #c0392b;
}

/* Quantity locked state for gift-coupon products.
   Woodmart's qty widget uses .quantity wrapper + +/- buttons.
   Disabling via readonly + pointer-events:none covers classic + theme. */
.woocommerce-product-gallery ~ form.cart .quantity.biomed-gc-qty-locked input.qty {
	background: #f0f0f0;
	cursor: not-allowed;
}
form.cart .quantity.biomed-gc-qty-locked button {
	opacity: 0.4;
	pointer-events: none;
}

/* v1.4.3 (c) — the gift-coupon label is rendered on two lines via our
   filter_coupon_label(): plain "Dovanų kuponas" on top, the code on a
   span below. Giving the code a mono/subtle treatment keeps the <th>
   column narrow enough that the shipping-method <td> stops wrapping
   its "Pristatymas į namus su Venipak" label mid-phrase. */
.cart_totals .shop_table tr.cart-discount th {
	line-height: 1.35;
}
.cart_totals .shop_table tr.cart-discount th .biomed-gc-code-inline {
	display: block;
	margin-top: 2px;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.88em;
	font-weight: 500;
	letter-spacing: 0.02em;
	word-break: break-all;
	overflow-wrap: anywhere;
	color: inherit;
	opacity: 0.85;
}
