/* ==========================================================================
   Solace - Elementor WooCommerce widgets compatibility
   --------------------------------------------------------------------------
   Targeted layout fixes for the default Elementor / Elementor Pro
   WooCommerce widgets when they are rendered inside the Solace theme.

   Fixes issues that look clean on Hello Elementor but break here:
   1. Cart     - product-remove column (th/td) off-center vs link.
   2. Cart     - coupon input + Apply button misaligned / clipped.
   3. Checkout - coupon grid squeezes input, clips Apply label.
   4. Product  - Reviews author name/avatar vertical misalignment.

   Everything is scoped to the Elementor widget containers so plain
   WooCommerce pages rendered by the theme are untouched.
   ========================================================================== */

/* 1) CART - product-remove column: center th label and per-row link */
body.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table th.product-remove,
body.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table td.product-remove {
	text-align: center;
	vertical-align: middle;
}

body.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form table.shop_table td.product-remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin: 0 auto;
	font-size: 20px;
	line-height: 1;
}

/* 2) CART - coupon: input and Apply button share one row, equal height */
body.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form td.actions .coupon {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 10px;
	margin-bottom: 10px;
}

body.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form td.actions .coupon .input-text {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: auto;
	margin: 0;
}

body.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form td.actions .coupon .button {
	flex: 0 0 auto;
	width: auto;
	height: auto;
	margin: 0;
	white-space: nowrap;
	line-height: 1.2;
}

body.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form td.actions > button[name="update_cart"] {
	margin: 0;
}

/* Small screens: stack the coupon input above its button, both full width */
@media (max-width: 768px) {

	body.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form td.actions .coupon {
		flex-wrap: wrap;
	}

	body.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form td.actions .coupon .input-text {
		flex: 1 1 100%;
	}

	body.woocommerce-cart .elementor-widget-woocommerce-cart .woocommerce-cart-form td.actions .coupon .button {
		flex: 1 1 auto;
	}
}

/* 3) CHECKOUT - Elementor coupon box (e-coupon-box): give the input column
   the remaining space and let the button size to its label. */
.woocommerce-checkout .elementor-widget-woocommerce-checkout-page .e-coupon-box .coupon-container-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: stretch;
	column-gap: 10px;
}

.woocommerce-checkout .elementor-widget-woocommerce-checkout-page .e-coupon-box .coupon-container-grid .coupon-col-1 {
	padding: 0;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	flex-basis: auto;
}

.woocommerce-checkout .elementor-widget-woocommerce-checkout-page .e-coupon-box .coupon-container-grid .coupon-col-1 .input-text {
	width: 100%;
	min-width: 0;
	height: 100%;
	margin: 0;
}

.woocommerce-checkout .elementor-widget-woocommerce-checkout-page .e-coupon-box .coupon-container-grid .coupon-col-2 {
	padding: 0;
	width: auto;
}

.woocommerce-checkout .elementor-widget-woocommerce-checkout-page .e-coupon-box .coupon-container-grid .coupon-col-2 .button,
.woocommerce-checkout .elementor-widget-woocommerce-checkout-page .e-coupon-box .coupon-container-grid .e-apply-coupon {
	width: auto;
	min-width: fit-content;
	height: 100%;
	white-space: nowrap;
	margin: 0;
}

/* 4) SINGLE PRODUCT - Reviews: author + avatar alignment. WC core lets the
   star rating and the author meta overlap the floated avatar; with the
   round avatar re-style the author line sits off-center. Make the comment
   text a flex column: meta row (author - date) vertically centered against
   the 48px avatar, star rating pulled to the right of that same row. */
.woocommerce #reviews #comments ol.commentlist,
.woocommerce #reviews #comments ol.commentlist li.review {
	list-style: none;
	padding-left: 0;
}

.woocommerce #reviews #comments ol.commentlist li img.avatar {
	position: static;
	float: left;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
}

.woocommerce #reviews #comments ol.commentlist li .comment-text {
	display: flex;
	flex-direction: column;
	margin: 0 0 0 68px;
	padding: 0;
	border: 0;
}

.woocommerce #reviews #comments ol.commentlist li .comment-text p.meta {
	order: 1;
	display: flex;
	align-items: center;
	min-height: 48px;
	margin: 0;
}

.woocommerce #reviews #comments ol.commentlist li .comment-text .star-rating {
	order: 2;
	float: none;
	margin: -30px 0 8px auto;
}

.woocommerce #reviews #comments ol.commentlist li .comment-text .description {
	order: 3;
	margin: 0;
}
