/* Shared product-page option fields */
.wcpeo-extra-options {
	margin: 10px 0 16px;
	font-family: var(--wcpeo-font-family, inherit);
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.wcpeo-extra-option-field {
	display: flex;
	align-items: center;
	gap: 9px;
	border: 1px solid #d9d9d9;
	background: #fff;
	border-radius: 6px;
	padding: 9px 12px;
	box-sizing: border-box;
	cursor: pointer;
	font-size: var(--wcpeo-font-size, 14px);
	white-space: nowrap;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.wcpeo-extra-option-field:hover {
	border-color: #bdbdbd;
	background: #fafafa;
}

.wcpeo-extra-option-field input[type="checkbox"],
.wcpeo-extra-option-field input[type="radio"] {
	accent-color: var(--wcpeo-accent-color, #e11);
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	margin: 0;
}

.wcpeo-option-text {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.wcpeo-option-label {
	color: var(--wcpeo-label-color, #222);
	font-weight: 700;
}

.wcpeo-option-price {
	color: var(--wcpeo-price-color, #c0392b);
	font-weight: 700;
}

.wcpeo-extra-option-field.wcpeo-limit-reached {
	opacity: .55;
}

.wcpeo-extra-option-field.wcpeo-limit-reached input:not(:checked) {
	cursor: not-allowed;
}

/* Independent extras (for example XL) stay outside the Select Options popup. */
.wcpeo-grid-independent-options {
	display: flex !important;
	flex-direction: column !important;
	gap: 8px !important;
	width: 100% !important;
	margin: 0 0 10px !important;
	box-sizing: border-box;
}

.wcpeo-grid-independent-options .wcpeo-grid-option-field {
	width: 100% !important;
	margin: 0 !important;
}

.wcpeo-grid-independent-options .wcpeo-extra-option-field {
	white-space: normal !important;
}

/* Cart / checkout */
/* All extra item lines live inside this one wrapper so they always
   stack top-to-bottom in the right order, regardless of whether the
   surrounding theme/checkout markup uses flex, grid, or table layout
   for the row it sits in. */
.wcpeo-cart-extra-wrap {
	display: block !important;
	width: 100% !important;
	flex: 1 1 100% !important;
}
.wcpeo-cart-extra-line { display: block; margin-top: 4px; line-height: 1.4; }
.wcpeo-cart-extra-line:first-child { margin-top: 0; }

/* Keep the "Extra:" label itself dark/neutral, not the accent color
   used for the item lines. */
.wc-item-meta-label,
dt.wc-block-components-product-metadata__description-key,
.wc-block-components-product-metadata__description-key {
	color: #222 !important;
}

.wcpeo-mini-cart-extra,
.wcpeo-mini-cart-extras {
	color: var(--wcpeo-price-color, #c0392b);
	font-size: .85em;
	font-weight: 600;
}

/* Woolentor grid */
.wcpeo-grid-selector {
	width: 100% !important;
	max-width: 100% !important;
	flex: 0 0 100% !important;
	box-sizing: border-box;
	margin: 0 0 10px !important;
	font-family: var(--wcpeo-font-family, inherit);
	position: relative;
	z-index: 30;
}

/* Floating popup: no layout space is reserved. */
.wcpeo-grid-selector-panel {
	display: none !important;
	position: absolute !important;
	bottom: calc(100% + 8px) !important;
	top: auto !important;
	left: 0 !important;
	right: 0 !important;
	width: 100% !important;
	max-height: min(430px, 70vh);
	overflow-y: auto;
	z-index: 999999 !important;
	box-sizing: border-box;
	margin: 0 !important;
	padding: 12px !important;
	border: 1px solid #d7d7d7 !important;
	border-radius: 8px !important;
	background: #fff !important;
	box-shadow: 0 10px 28px rgba(0,0,0,.14) !important;
	gap: 0 !important;
	align-items: stretch !important;
	flex-direction: column !important;
}

.wcpeo-grid-selector.is-open .wcpeo-grid-selector-panel {
	display: flex !important;
}

/* Professional group layout: grouped Meat options are kept together. */
.wcpeo-grid-option-group {
	width: 100%;
	box-sizing: border-box;
}

.wcpeo-grid-option-group + .wcpeo-grid-option-group {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #ececec;
}

.wcpeo-grid-group-title {
	width: 100%;
	box-sizing: border-box;
	margin: 0 0 7px;
	padding: 0 2px;
	font-size: 11px;
	line-height: 1.25;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .02em;
	color: #222;
}

.wcpeo-grid-option-group .wcpeo-grid-option-field {
	border: 1px solid #dedede !important;
	border-radius: 6px !important;
	background: #fff !important;
	margin: 0 0 7px !important;
}

.wcpeo-grid-option-group .wcpeo-grid-option-field:last-child {
	margin-bottom: 0 !important;
}

.wcpeo-grid-ungrouped {
	width: 100%;
	box-sizing: border-box;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #ececec;
}

.wcpeo-grid-ungrouped .wcpeo-grid-option-field {
	border: 1px solid #dedede !important;
	border-radius: 6px !important;
	background: #fff !important;
	margin: 0 0 7px !important;
}

.wcpeo-grid-ungrouped .wcpeo-grid-option-field:last-child {
	margin-bottom: 0 !important;
}

/* The selector and Add to Cart stay vertically stacked. */
.woolentor-product-actions.wcpeo-has-grid-selector {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	justify-content: flex-start !important;
	gap: 10px !important;
	position: relative !important;
	overflow: visible !important;
}

.woolentor-product-actions.wcpeo-has-grid-selector .wcpeo-grid-selector {
	order: 1 !important;
	width: 100% !important;
	flex: 0 0 auto !important;
	margin: 0 !important;
}

.woolentor-product-actions.wcpeo-has-grid-selector > .add_to_cart_button,
.woolentor-product-actions.wcpeo-has-grid-selector > a[data-product_id] {
	order: 3 !important;
	width: 100% !important;
	max-width: 100% !important;
	flex: 0 0 auto !important;
	margin: 0 !important;
}

.woolentor-product-actions.wcpeo-has-grid-selector .wcpeo-grid-independent-options {
	order: 2 !important;
}

/* Do not let the floating popup get clipped by the product card. */
.woolentor-product-card,
.woolentor-product-card .woolentor-product-actions {
	overflow: visible !important;
}

.wcpeo-grid-selector-toggle {
	width: 100% !important;
	min-height: 44px;
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	box-sizing: border-box;
	border: 1px solid #cfcfcf !important;
	background: #fff !important;
	color: #222 !important;
	border-radius: 6px !important;
	padding: 9px 12px !important;
	font-family: inherit;
	font-size: var(--wcpeo-font-size, 14px) !important;
	font-weight: 700 !important;
	cursor: pointer;
	text-align: left;
	box-shadow: none !important;
}

.wcpeo-grid-selector-toggle:hover,
.wcpeo-grid-selector.is-open .wcpeo-grid-selector-toggle {
	border-color: #b9b9b9 !important;
}

.wcpeo-grid-selector-toggle:after {
	content: "▾";
	font-size: 11px;
	line-height: 1;
	flex: 0 0 auto;
}

.wcpeo-grid-selector.is-open .wcpeo-grid-selector-toggle:after {
	content: "▴";
}

.wcpeo-grid-toggle-text {
	flex: 0 0 auto;
}

.wcpeo-grid-selected-summary {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0 !important;
	font-size: 12px;
	font-weight: 600;
	opacity: .72;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: right;
}

.wcpeo-grid-option-field {
	width: 100% !important;
	min-height: 42px;
	padding: 8px 10px !important;
	font-size: 13px !important;
	white-space: normal !important;
}

.wcpeo-grid-option-field .wcpeo-option-text {
	min-width: 0;
}

.wcpeo-grid-option-field.wcpeo-limit-reached {
	opacity: .55;
}

@media (max-width: 480px) {
	.wcpeo-extra-options { width: 100%; }
	.wcpeo-extra-option-field { white-space: normal; }
	.wcpeo-grid-selected-summary { max-width: 48%; }
}

/* Single-choice groups: after one option is selected, the remaining
 * options stay visible but are disabled/greyed out until the selection is cleared. */
.wcpeo-extra-options .wcpeo-extra-option-field.wcpeo-limit-reached {
	opacity: .55;
}
.wcpeo-extra-options .wcpeo-extra-option-field.wcpeo-limit-reached input:not(:checked) {
	cursor: not-allowed;
}
