/* Life brand styling for WooCommerce surfaces: product, cart, checkout, My
   Account (incl. life-members / life-reports endpoints). theme.json handles
   global color/typography/buttons; this file only touches WooCommerce-specific
   markup theme.json cannot reach (form fields, tables, notices, tabs). */

.woocommerce,
.woocommerce-page {
	color: var(--wp--preset--color--life-ink);
}

.woocommerce table.shop_table,
.woocommerce table.shop_table th,
.woocommerce table.shop_table td,
.woocommerce-MyAccount-content table {
	border-color: rgba(199, 162, 74, 0.28);
	color: var(--wp--preset--color--life-ink);
}

.woocommerce table.shop_table thead th {
	background: var(--wp--preset--color--life-bg-soft);
}

.woocommerce div.product p.price,
.woocommerce div.product span.price,
.woocommerce ul.products li.product .price {
	color: var(--wp--preset--color--life-action);
}

/* Form fields: WCAG contrast >= 4.5:1 against the dark panel background. */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-page form .form-row input.input-text,
.select2-container--default .select2-selection--single {
	background-color: #1a232b;
	color: #ffffff;
	border: 1px solid rgba(199, 162, 74, 0.28);
	border-radius: 8px;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
}

/* Long option labels (lidou "One year: lunar 9/1 this year to 8/30 next year") must not widen the
   variation table past the summary column: fix the layout and let the select shrink. */
.woocommerce div.product form.cart table.variations,
.wp-site-blocks form.variations_form table.variations {
	width: 100%;
	table-layout: fixed;
}

.woocommerce div.product form.cart table.variations th.label,
.wp-site-blocks form.variations_form table.variations th.label {
	width: 4.5em;
}

/* Variable products (lidou "number of participants"): WooCommerce paints this select with
   its own light-theme colors, which rendered dark text on the dark panel. Same tokens as the
   form fields above; the arrow is redrawn light because the native one is dark. The
   .wp-site-blocks selectors cover the block template, which may not wrap it in div.product. */
.woocommerce div.product form.cart table.variations td.value select,
.wp-site-blocks form.variations_form table.variations td.value select {
	background-color: #1a232b;
	color: #ffffff;
	border: 1px solid rgba(199, 162, 74, 0.28);
	border-radius: 8px;
	min-height: 44px;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin-right: 0;
	text-overflow: ellipsis;
	padding: 0.5rem 2.5rem 0.5rem 0.75rem;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23eee8da' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	background-size: 12px 8px;
}

.woocommerce div.product form.cart table.variations td.value select option,
.wp-site-blocks form.variations_form table.variations td.value select option {
	background-color: #1a232b;
	color: #ffffff;
}

.woocommerce div.product form.cart table.variations td.value select:focus,
.wp-site-blocks form.variations_form table.variations td.value select:focus {
	outline: 2px solid var(--wp--preset--color--life-action);
	outline-offset: 2px;
}

.woocommerce div.product form.cart table.variations th,
.woocommerce div.product form.cart table.variations label,
.wp-site-blocks form.variations_form table.variations th,
.wp-site-blocks form.variations_form table.variations label {
	color: var(--wp--preset--color--life-ink);
}

.woocommerce form .form-row label {
	color: var(--wp--preset--color--life-ink);
}

.woocommerce form .form-row .required {
	color: var(--wp--preset--color--life-danger);
}

.life-member-legacy-note a {
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	min-width: 44px;
	min-height: 44px;
}

/* WooCommerce paints the eye as a dark SVG on ::before; invert that image as
   well as styling the button. Leave the native toggle handler and icon intact. */
.woocommerce-account .woocommerce form .password-input input.input-text {
	padding-right: 3.5rem;
}

.woocommerce-account .woocommerce form .password-input .show-password-input {
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	border: 1px solid #c7a24a;
	border-radius: 8px;
	background-color: #26323c;
	color: #ffffff;
	cursor: pointer;
}

.woocommerce-account .woocommerce form .password-input .show-password-input:hover {
	background-color: #34424d;
}

.woocommerce-account .woocommerce form .password-input .show-password-input:focus-visible {
	outline: 2px solid #c7a24a;
	outline-offset: 2px;
}

.woocommerce-account .woocommerce form .password-input .show-password-input::before {
	filter: invert(1);
	opacity: 1;
}

/* Focus rings: gold, visible against the dark panel. */
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus,
.woocommerce a.button:focus,
.woocommerce button.button:focus,
.woocommerce input[type="submit"]:focus,
.woocommerce-MyAccount-navigation a:focus {
	outline: 2px solid var(--wp--preset--color--life-action);
	outline-offset: 2px;
}

/* Buttons: 44px touch target minimum, gold action color from theme.json. */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input[type="submit"],
.woocommerce #respond input#submit {
	min-height: 44px;
	min-width: 44px;
	border-radius: 8px;
	background-color: var(--wp--preset--color--life-action);
	color: var(--wp--preset--color--life-bg);
}

.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input[type="submit"]:hover {
	background-color: var(--wp--preset--color--life-action-strong);
}

/* My Account navigation, incl. life-members / life-reports endpoints. */
.woocommerce-MyAccount-navigation ul {
	background: linear-gradient(135deg, rgba(26, 35, 43, 0.9), rgba(12, 17, 23, 0.9));
	border: 1px solid rgba(199, 162, 74, 0.28);
	border-radius: 8px;
	padding: 0.5rem;
}

.woocommerce-MyAccount-navigation li a {
	display: block;
	min-height: 44px;
	line-height: 44px;
	padding: 0 1rem; /* the ul's own padding loses to WooCommerce's more specific list reset */
	color: var(--wp--preset--color--life-ink);
}

.woocommerce-MyAccount-navigation li.is-active a {
	color: var(--wp--preset--color--life-action);
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-noreviews,
.woocommerce-error {
	background: var(--wp--preset--color--life-bg-soft);
	border-top-color: var(--wp--preset--color--life-action);
	color: var(--wp--preset--color--life-ink);
}

.woocommerce-checkout #payment,
.woocommerce-cart-form,
.woocommerce-checkout-review-order {
	background: linear-gradient(135deg, rgba(26, 35, 43, 0.9), rgba(12, 17, 23, 0.9));
	border: 1px solid rgba(199, 162, 74, 0.28);
	border-radius: 8px;
	padding: 1.5rem;
}

/* Product page: no uploaded image -> drop the (empty/placeholder) gallery
   column entirely and let the summary take the full width. functions.php
   adds .life-no-gallery to the product wrapper for the classic template;
   the :has() rule is a browser-native fallback for WooCommerce's
   block-based gallery, which PHP can't remove_action() on. */
.life-no-gallery div.images,
.life-no-gallery .woocommerce-product-gallery {
	display: none;
}

.woocommerce-product-gallery .zoomImg {
	pointer-events: none;
}

.life-no-gallery div.summary {
	width: 100%;
	float: none;
}

@supports selector(:has(*)) {
	.woocommerce-product-gallery:has(img[src*="placeholder"]),
	.wp-block-woocommerce-product-image-gallery:has(img[src*="placeholder"]) {
		display: none;
	}
}

/* Block cart/checkout (wc-block-components): WooCommerce's packages-style.css paints
   inputs white via `.wc-block-components-form .wc-block-components-text-input
   input[type="email"]` while labels inherit the theme's light ink (measured 1.22:1),
   and checkout.css draws the order-summary quantity badge in currentcolor with the
   digit in --wp--preset--color--base, which this theme does not define (white-on-ink).
   The .wp-site-blocks prefix out-ranks those selectors. */
.wp-site-blocks .wc-block-components-form .wc-block-components-text-input input:not([type="checkbox"]),
.wp-site-blocks .wc-block-components-text-input input:not([type="checkbox"]),
.wp-site-blocks .wc-blocks-components-select .wc-blocks-components-select__container,
.wp-site-blocks .wc-block-components-textarea,
.wp-site-blocks .wc-block-components-combobox .wc-block-components-combobox-control input {
	background-color: #1a232b;
	color: #ffffff;
	border-color: rgba(199, 162, 74, 0.28);
}

.wp-site-blocks .wc-blocks-components-select .wc-blocks-components-select__select {
	color: #ffffff;
}

.wp-site-blocks .wc-blocks-components-select .wc-blocks-components-select__select option {
	background-color: #1a232b;
	color: #ffffff;
}

.wp-site-blocks .wc-block-components-text-input label,
.wp-site-blocks .wc-blocks-components-select .wc-blocks-components-select__label,
.wp-site-blocks .wc-block-components-combobox label {
	color: rgba(238, 232, 218, 0.78);
}

.wp-site-blocks .wc-block-components-order-summary .wc-block-components-order-summary-item__quantity {
	background-color: var(--wp--preset--color--life-bg-soft);
	border-color: var(--wp--preset--color--life-action);
	box-shadow: none;
}

.wp-site-blocks .wc-block-components-order-summary .wc-block-components-order-summary-item__quantity span {
	color: var(--wp--preset--color--life-ink);
}

/* My Account used the 760px content width (page.html's constrained layouts), which squeezed
   the nav + content columns; the title and the account block use the site's wide width instead. */
.woocommerce-account main > .wp-block-post-title,
.woocommerce-account main > .wp-block-post-content,
.woocommerce-account .wp-block-post-content > .woocommerce {
	max-width: var(--wp--style--global--wide-size);
}

/* Adaptive Pricing note under the checkout order summary (life-commerce checkout-currency-note.js). */
.life-checkout-currency-note { margin: 12px 16px 16px; font-size: 0.85em; line-height: 1.5; opacity: 0.85; }

.woocommerce-privacy-policy-link {
	white-space: nowrap;
}

html {
	scroll-padding-bottom: 96px;
}

@media (max-width: 480px) {
	.woocommerce div.product form.variations_form,
	.wp-site-blocks form.variations_form,
	.woocommerce div.product form.variations_form table.variations,
	.wp-site-blocks form.variations_form table.variations,
	.woocommerce div.product form.variations_form table.variations tbody,
	.wp-site-blocks form.variations_form table.variations tbody,
	.woocommerce div.product form.variations_form table.variations tr,
	.wp-site-blocks form.variations_form table.variations tr,
	.woocommerce div.product form.variations_form table.variations th.label,
	.wp-site-blocks form.variations_form table.variations th.label,
	.woocommerce div.product form.variations_form table.variations td.value,
	.wp-site-blocks form.variations_form table.variations td.value,
	.woocommerce div.product form.variations_form table.variations td.value select,
	.wp-site-blocks form.variations_form table.variations td.value select,
	.woocommerce div.product .single_variation_wrap,
	.wp-site-blocks .single_variation_wrap,
	.woocommerce div.product .variations_button,
	.wp-site-blocks .variations_button,
	.life-lidou-form {
		box-sizing: border-box;
		width: 100%;
		max-width: 100%;
		min-width: 0;
	}

	.woocommerce div.product form.variations_form table.variations,
	.wp-site-blocks form.variations_form table.variations,
	.woocommerce div.product form.variations_form table.variations tbody,
	.wp-site-blocks form.variations_form table.variations tbody,
	.woocommerce div.product form.variations_form table.variations tr:not([hidden]),
	.wp-site-blocks form.variations_form table.variations tr:not([hidden]),
	.woocommerce div.product form.variations_form table.variations th.label,
	.wp-site-blocks form.variations_form table.variations th.label,
	.woocommerce div.product form.variations_form table.variations td.value,
	.wp-site-blocks form.variations_form table.variations td.value {
		display: block;
	}

	.woocommerce-product-gallery {
		max-width: 100%;
		overflow: hidden;
	}
}
