/* WooCommerce Subscription Options */
.wcsatt-options-prompt-radios .wcsatt-options-prompt-radio:not(:last-child) {
    margin-bottom: 5px;
}

/* Default border for all radio options */
.wcsatt-options-prompt-radio {
    border: solid 1px var(--nn-color-gray-lighter, #e2e2e2) !important;
    border-radius: 5px;
    padding: 25px;
    transition: border-color 0.3s ease;
    background-color: white;
}

/* Black border on selected radio option (li) */
.wcsatt-options-prompt-radio input[type="radio"]:checked {
    /* Remove default outline for clarity */
    outline: none;
}

.wcsatt-options-prompt-radio input[type="radio"]:checked:focus {
    outline: none;
}

.wcsatt-options-prompt-radio input[type="radio"]:checked:focus-visible {
    outline: none;
}

.wcsatt-options-prompt-radio input[type="radio"]:checked:focus + label,
.wcsatt-options-prompt-radio input[type="radio"]:checked + label {
    outline: none;
}

/* Use :has() to apply black border to li when its input is checked (modern browsers) */
.wcsatt-options-prompt-radio:has(input[type="radio"]:checked) {
    border-color: black !important;
    background-color: var(--nn-color-bg-light-green, #f4f9f3);
}

/* Flexbox for subscribe label and price alignment */
.wcsatt-options-prompt-label {
    display: flex;
    align-items: center;
    width: 100%;
}

.wcsatt-options-prompt-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.wcsatt-options-prompt-action .subscription-price {
    margin-left: 8px;
    text-align: right;
    display: inline-block;
}

li span.subscription-option-details, 
li span.one-time-option-details, 
.wcsatt-options-product-prompt-radio label > span {
    padding-left: 0.8em;
}

.wcsatt-options-prompt-action-input {
    accent-color: var(--nn-color-primary-light, #2D4838);
}


/* WooCommerce Subscriptions - Cart */
.product-subtotal span.subscription-price {
    line-height: 1.5em;
    display: inline-block;
    min-width: unset;
    padding-left: unset;
}

/* Hide subscription options and discount text when product is discounted */
.price:has(del) .wcsatt-sub-options,
.price:has(del) .wcsatt-sub-discount,
.cgkit-as-variation-price:has(del) .wcsatt-sub-options,
.cgkit-as-variation-price:has(del) .wcsatt-sub-discount {
    display: none !important;
}

/* Related Subscriptions Card Layout */
.related-subscriptions-list {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-top: 8px;
	padding: 14px;
	padding-top: 0;
}

.related-subscription-card {
	background-color: var(--nn-color-white, #ffffff);
	border: 1px solid var(--nn-color-gray-lighter-alt, #e2e2e2);
	border-radius: 8px;
	padding: 14px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.related-subscription-card__top {
	display: flex;
	flex-direction: column;
	border-bottom: 1px solid var(--nn-color-gray-lighter-alt, #e5e5e5);
	margin-bottom: 1rem;
	gap: 1rem;
}

.related-subscription-card__product-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
}

.related-subscription-card__product-row:last-child {
	padding-bottom: 1rem;
}

.related-subscription-card__product,
.related-subscription-card__subtotal {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.related-subscription-card__subtotal {
	text-align: right;
}

.related-subscription-card__label {
	font-weight: 400;
	letter-spacing: 0.5px;
	margin-bottom: 0.25rem;
	font-size: 0.875rem;
	color: var(--nn-color-black, #000);
}

.related-subscription-card__product-name {
	margin: 0;
	font-size: 1rem;
	font-weight: 300;
	line-height: 1.5;
}

.related-subscription-card__subtotal-amount {
	margin: 0;
	font-size: 1rem;
	font-weight: 300;
	line-height: 1.5;
}

/* Bottom wrapper for table and button */
.related-subscription-card__bottom-wrapper {
	display: flex;
	align-items: stretch;
	gap: 1rem;
}

/* Table styling within the card */
.related-subscription-card .related-subscription-table {
	margin: 0;
	border: none;
	flex: 1;
	width: auto;
}

.related-subscription-card .related-subscription-table thead {
	display: table-header-group;
}

.related-subscription-card .related-subscription-table tbody {
	display: table-row-group;
}

.related-subscription-card .related-subscription-table th,
.related-subscription-card .related-subscription-table td {
	border: none;
	padding: 0.75rem 1rem;
	vertical-align: middle;
}

.related-subscription-card .related-subscription-table th {
	border-bottom: 1px solid var(--nn-color-gray-lighter-alt, #e5e5e5);
	font-weight: 500;
}

.related-subscription-card .related-subscription-table tbody tr {
	border-bottom: none;
}

.related-subscription-card .related-subscription-table tbody tr:last-child {
	border-bottom: none;
}

/* Actions wrapper - aligns with table body row */
.related-subscription-card__actions-wrapper {
	display: flex;
	align-items: center;
	width: auto;
	flex-shrink: 0;
	padding-top: 0; /* Match th padding + border to align with tbody */
}

.related-subscription-card__actions-wrapper .woocommerce-button.view {
	background-color: var(--nn-color-primary-light, #2D4838);
	color: var(--nn-color-white, #ffffff);
	border: 1px solid var(--nn-color-primary-light, #2D4838);
	border-radius: 4px;
	padding: 0.75rem 1.25rem;
	text-decoration: none;
	font-weight: 500;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}

.related-subscription-card__actions-wrapper .woocommerce-button.view::after {
	content: "";
	display: inline-block;
	width: 12px;
	height: 10px;
	margin-left: 5px;
	background-image: url("data:image/svg+xml,%3Csvg width='12' height='10' viewBox='0 0 12 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.6667 4.66671V4.66671C11.6649 4.7404 11.6511 4.8133 11.6258 4.88254C11.6123 4.90719 11.5967 4.93061 11.5792 4.95254C11.5639 4.98486 11.5464 5.01605 11.5267 5.04588L8.02667 9.12921C7.8912 9.2876 7.68153 9.36169 7.47663 9.32356C7.27173 9.28544 7.10274 9.14091 7.0333 8.9444C6.96386 8.74789 7.00454 8.52926 7.14 8.37088L9.8175 5.25004H0.583333C0.261167 5.25004 0 4.98888 0 4.66671C0 4.34454 0.261167 4.08338 0.583333 4.08338H9.8175L7.14 0.962542C7.00454 0.804155 6.96386 0.58553 7.0333 0.389021C7.10274 0.192513 7.27173 0.0479751 7.47663 0.00985442C7.68153 -0.0282663 7.8912 0.0458213 8.02667 0.204209L11.5267 4.28754C11.5464 4.31737 11.5639 4.34856 11.5792 4.38088C11.5967 4.40281 11.6123 4.42623 11.6258 4.45088C11.6511 4.52012 11.6649 4.59302 11.6667 4.66671Z' fill='white'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	vertical-align: middle;
}

.related-subscription-card__actions-wrapper .woocommerce-button.view:hover {
	background-color: var(--nn-color-primary-dark, #2D4838);
	border-color: var(--nn-color-primary-dark, #2D4838);
	color: var(--nn-color-white, #ffffff);
}

@media (max-width: 768px) {
	.related-subscription-card__product-row {
		flex-direction: column;
	}

	.related-subscription-card__subtotal {
		text-align: left;
	}

	.related-subscription-card__bottom-wrapper {
		flex-direction: column;
		gap: 0;
	}

	.related-subscription-card__actions-wrapper {
		width: 100%;
		padding-top: 0;
		margin-top: 1rem;
	}

	.related-subscription-card__actions-wrapper .woocommerce-button.view {
		width: 100%;
	}
}

.woocommerce-order-details header h2 {
	padding: 14px !important;
	padding-bottom: 0 !important;
	margin-top: 0;
	margin-bottom: 0;
	font-weight: 400 !important;
	font-size: 1.125rem !important;
}
.subscription-total.order-total.woocommerce-orders-table__header.woocommerce-orders-table__header-order-total.woocommerce-orders-table__header-subscription-total,
.subscription-total.order-total.woocommerce-orders-table__cell.woocommerce-orders-table__cell-subscription-total.woocommerce-orders-table__cell-order-total {
	display: none;
}
.related-subscription-card__bottom-wrapper table.shop_table td,
.related-subscription-card__bottom-wrapper table.shop_table th {
	padding: 0.3em 0;
	line-height: 1.4em;
	border: none;
}
.related-subscription-card__bottom-wrapper table.shop_table th {
	font-weight: 300;
	font-size: 0.875rem;
}
.related-subscription-card__bottom-wrapper table.shop_table td{
	font-weight: 400;
	font-size: 1rem;
}
.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout .woocommerce-order-details::before,
.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout .woocommerce-order-details::after {
	display: none;
}

/* Add border to all order items */
.woocommerce-table tbody .woocommerce-table__line-item.order_item {
	border-bottom: 1px solid var(--nn-color-gray-lighter-alt, #e5e5e5);
	padding-bottom: 0.5em;
}

/* Remove border from order items that have a following order item sibling */
.woocommerce-table tbody .woocommerce-table__line-item.order_item:has(+ .woocommerce-table__line-item.order_item) {
	border-bottom: none;
}

/* Add spacing after the last order item before subtotal */
.woocommerce-table tbody .woocommerce-table__line-item.order_item:not(:has(+ .woocommerce-table__line-item.order_item)) + tr th,
.woocommerce-table tbody .woocommerce-table__line-item.order_item:not(:has(+ .woocommerce-table__line-item.order_item)) + tr td {
	padding-top: 8px;
}

/* Reduce spacing between non-order_item rows (Subtotal, Shipping, Total) */
.woocommerce-order-details .woocommerce-table--order-details.shop_table.order_details tbody tr:not(.woocommerce-table__line-item.order_item) + tr:not(.woocommerce-table__line-item.order_item) th,
.woocommerce-order-details .woocommerce-table--order-details.shop_table.order_details tbody tr:not(.woocommerce-table__line-item.order_item) + tr:not(.woocommerce-table__line-item.order_item) td {
	padding-top: 0;
}
.woocommerce-order-details .woocommerce-table--order-details.shop_table.order_details tbody tr:not(.woocommerce-table__line-item.order_item) th,
.woocommerce-order-details .woocommerce-table--order-details.shop_table.order_details tbody tr:not(.woocommerce-table__line-item.order_item) td {
	padding-bottom: 0 !important;
}

/* Make TD content display on one line */
.woocommerce-order-details .woocommerce-table--order-details.shop_table.order_details tbody tr:not(.woocommerce-table__line-item.order_item) td {
	display: flex !important;
	align-items: center;
	flex-wrap: wrap;
	white-space: nowrap;
	float: right;
	justify-content: flex-end;
}
/* Add padding-top to Total row td */
.woocommerce-order-details .woocommerce-table--order-details.shop_table.order_details tbody tr:not(.woocommerce-table__line-item.order_item):last-child td {
	padding-top: 10px !important;
}
.woocommerce-order-details table.shop_table td, .woocommerce-order-details table.shop_table th {
	border:inherit;
}

/* Customer Details Section */
.woocommerce-customer-details .customer-details-table td,
.woocommerce-customer-details .woocommerce-table--customer-details td,
.woocommerce-customer-details .customer-details-table p,
.woocommerce-customer-details .woocommerce-table--customer-details p {
	font-size: 12px !important;
}

/* Desktop: Email, Phone, and Shipping Address in one row */
@media screen and (min-width: 769px) {
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details {
		display: table !important;
		width: 100% !important;
	}
	
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table tbody,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details tbody {
		display: grid !important;
		grid-template-columns: repeat(3, 1fr) !important;
		gap: 0 !important;
	}
	
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table tr,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details tr {
		display: contents !important;
	}
	
	/* Email - column 1 */
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table tr:first-child td:first-child,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details tr:first-child td:first-child {
		grid-column: 1 !important;
		display: block !important;
		width: 100% !important;
		padding-right: 1em !important;
	}
	
	/* Phone - column 2 */
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table tr:first-child td:last-child,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details tr:first-child td:last-child {
		grid-column: 2 !important;
		display: block !important;
		width: 100% !important;
		padding-right: 1em !important;
	}
	
	/* Billing Address - column 1, row 2 */
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table tr.cartflows-customer-details-table-address td.woocommerce-column--billing-address {
		grid-column: 1 !important;
		grid-row: 2 !important;
		display: block !important;
		width: 100% !important;
		padding-right: 1em !important;
	}
	
	/* Shipping Address - column 3, row 1 */
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table tr.cartflows-customer-details-table-address td.woocommerce-column--shipping-address {
		grid-column: 3 !important;
		grid-row: 1 !important;
		display: block !important;
		width: 100% !important;
		padding-right: 1em !important;
	}
	
	/* Fallback for all other tds */
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table td,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details td {
		display: block !important;
		padding-right: 1em !important;
	}
}

/* Mobile/Tablet: Stack each cell on its own line */
@media screen and (max-width: 768px) {
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details {
		display: block !important;
		width: 100% !important;
	}
	
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table tbody,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details tbody {
		display: block !important;
	}
	
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table tr,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details tr {
		display: block !important;
		margin-bottom: 1em !important;
	}
	
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table tr:last-child,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details tr:last-child {
		margin-bottom: 0 !important;
	}
	
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table td,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details td {
		display: block !important;
		width: 100% !important;
		margin-bottom: 0.75em !important;
		padding-right: 0 !important;
	}
	
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .customer-details-table td:last-child,
	.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details .woocommerce-table--customer-details td:last-child {
		margin-bottom: 0 !important;
	}
}

/* Subscription account link paragraph */
.woocommerce-order.wcf-modern-tq-layout > p {
	display: none;
}
.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout ul.woocommerce-order-overview.woocommerce-thankyou-order-details.order_details {
	padding: 1em 1.5em;
}
.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout ul.order_details li{
	margin: 0.5em 0em 0.5em 0;
	padding: 0.5em 3em 0.5em 3em;
}
@media screen and (min-width: 768px) {
	
	.woocommerce-order ul.order_details li{
		position: relative;
		border-right: unset;
	}

	.woocommerce-order ul.order_details li:not(:last-child)::after {
		content: '';
		position: absolute;
		right: 0;
		top: -1em;
		bottom: -0.5em;
		width: 1px;
		background-color: var(--nn-color-gray-lighter-medium, #ccc);
	}
}
.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout .woocommerce-order-details table.woocommerce-table--order-details.shop_table.order_details tbody tr:last-child {
	position: relative;
}
.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout ul.woocommerce-order-overview.woocommerce-thankyou-order-details.order_details{
	margin-bottom: 0 !important;
}

.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout .woocommerce-order-details table.woocommerce-table--order-details.shop_table.order_details tbody tr:last-child::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background-color: var(--nn-color-gray-lighter-alt, #e2e2e2);
}
.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout section.woocommerce-customer-details {
	margin-top: 5px !important;
}
.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout .woocommerce-customer-details__title {
	font-size: 14px !important;
}
.wcf-thankyou-wrap .woocommerce-order.wcf-modern-tq-layout table.customer-details-table tr:not(:first-child) td{
	padding-top: 0 !important;
}
.cartflows-customer-details-table-address .woocommerce-column--billing-address{
	display: none;
}

/* Subscription Options - Expandable Details */
.wcsatt-options-prompt-radio-subscription {
	position: relative;
}

.wcsatt-options-prompt-radio-subscription .wcsatt-subscription-details {
	display: none !important;
}

/* Keep subscription details open whenever "Subscribe" is selected (prevents flicker on variation updates). */
.wcsatt-options-prompt-radio-subscription:has(input[type="radio"][value="yes"]:checked) .wcsatt-subscription-details {
	display: block !important;
}

.wcsatt-subscription-details {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	animation: slideDown 0.3s ease;
}

/* Remove border-top and padding-top from subscription details in radio prompt template */
.wcsatt-options-prompt-radio-subscription .wcsatt-subscription-details {
	border-top: none;
	padding-top: 0;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.wcsatt-subscription-details-content {
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--nn-color-black, #000);
}

/* Style list items with checkmarks - convert any list to checkmark style */
.wcsatt-subscription-details-content ul,
.wcsatt-subscription-details-content ol {
	list-style: none;
	padding: 0;
	margin: 0;
}

.wcsatt-subscription-details-content ul li,
.wcsatt-subscription-details-content ol li {
	position: relative;
	padding-left: 24px;
	margin-bottom: 8px;
}

.wcsatt-subscription-details-content ul li:before,
.wcsatt-subscription-details-content ol li:before {
	content: '';
	position: absolute;
	left: 0;
	width: 16px;
	height: 16px;
	background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.4881 3.78676L5.82143 13.1201C5.69578 13.2556 5.51954 13.3328 5.33476 13.3334V13.3334C5.15756 13.3345 4.98724 13.2649 4.86143 13.1401L1.52809 9.80676C1.26668 9.54535 1.26668 9.12151 1.52809 8.8601C1.78951 8.59868 2.21334 8.59868 2.47476 8.8601L5.33476 11.7068L13.5148 2.8801C13.6717 2.68661 13.9233 2.59674 14.1673 2.64708C14.4113 2.69741 14.6068 2.87957 14.6743 3.11936C14.7418 3.35914 14.67 3.61656 14.4881 3.78676Z' fill='%235A8A00'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	top: 0.2em;
}

.wcsatt-subscription-details-content ul li:last-child,
.wcsatt-subscription-details-content ol li:last-child {
	margin-bottom: 0;
}

/* Style paragraphs if popup text contains them */
.wcsatt-subscription-details-content p {
	margin: 0 0 8px 0;
}

.wcsatt-subscription-details-content p:last-child {
	margin-bottom: 0;
}

/* Add spacing above "Add to an existing subscription?" label */
.wcsatt-add-to-subscription-action-label {
	margin-top: 1.5rem;
	display: inline-block;
}
