/**
 * Enliven WooCommerce customisations
 *
 * Contents
 * 1. Design tokens
 * 2. Shared Cart and Checkout Blocks
 * 3. Cart Block
 * 4. Checkout Block
 * 5. Empty Cart Block
 * 6. Order Received / Thank-you page
 * 7. Conditional Elementor components
 * 8. Order Pay endpoint (reserved)
 * 9. Responsive adjustments
 */


/* =========================================================
   1. DESIGN TOKENS
   ========================================================= */

:root {
	--ntp-woo-primary: var(--e-global-color-primary, #003234);
	--ntp-woo-primary-hover: var(--e-global-color-b752695, #eff5f1);
	--ntp-woo-ink: #000000;
	--ntp-woo-muted: #777777;
	--ntp-woo-soft-text: #898781;
	--ntp-woo-border: #cccccc;
	--ntp-woo-border-soft: #d8d8d5;
	--ntp-woo-panel: #ffffff;
	--ntp-woo-selection: #eff5f1;
	--ntp-woo-radius: 18px;
	--ntp-woo-image-radius: 12px;
}


/* =========================================================
   2. SHARED CART AND CHECKOUT BLOCKS
   ========================================================= */

.woocommerce-cart .utility-corners,
.woocommerce-checkout .utility-corners {
	background-color: var(--ntp-woo-panel) !important;
}

.woocommerce-cart .wc-block-components-title.wc-block-components-title,
.woocommerce-checkout .wc-block-components-title.wc-block-components-title {
	color: var(--ntp-woo-ink);
	font-family: 'aktiv-grotesk', sans-serif;
	font-size: 20px;
	font-weight: 600 !important;
}

.woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image img,
.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-order-summary-item__image img {
	border-radius: var(--ntp-woo-image-radius);
}

.woocommerce-cart .wc-block-components-checkbox__input,
.woocommerce-checkout .wc-block-components-checkbox__input {
	padding: 0 !important;
	border-radius: 4px !important;
}

.woocommerce-cart .wc-block-components-radio-control__input,
.woocommerce-checkout .wc-block-components-radio-control__input {
	padding: 0 !important;
	border-radius: 100px !important;
}

.woocommerce-cart .wc-block-components-radio-control--highlight-checked label.wc-block-components-radio-control__option--checked-option-highlighted,
.woocommerce-cart .wc-block-components-radio-control--highlight-checked div.wc-block-components-radio-control-accordion-option,
.woocommerce-checkout .wc-block-components-radio-control--highlight-checked label.wc-block-components-radio-control__option--checked-option-highlighted,
.woocommerce-checkout .wc-block-components-radio-control--highlight-checked div.wc-block-components-radio-control-accordion-option {
	background-color: var(--ntp-woo-selection);
	box-shadow: inset 0 0 0 1.5px var(--ntp-woo-primary);
}

/* Hide product metadata that is not required in the portal. */
.woocommerce-cart .wc-block-components-product-metadata .wc-block-components-product-metadata__description > p,
.woocommerce-cart .wc-block-components-order-summary-item__description .wc-block-components-product-price,
.woocommerce-checkout .wc-block-components-product-metadata .wc-block-components-product-metadata__description > p,
.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-order-summary-item__description .wc-block-components-product-metadata,
.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-order-summary-item__description p,
.woocommerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-price {
	display: none !important;
}


/* =========================================================
   3. CART BLOCK
   ========================================================= */

.woocommerce-cart .wc-block-components-button.wp-element-button.wc-block-cart__submit-button.contained {
	border-radius: 100px;
	background-color: var(--ntp-woo-primary);
	color: #ffffff;
}

.woocommerce-cart .wc-block-components-button.wp-element-button.wc-block-cart__submit-button.contained:hover {
	background-color: var(--ntp-woo-primary-hover);
	color: var(--ntp-woo-primary);
}


/* =========================================================
   4. CHECKOUT BLOCK
   ========================================================= */

.woocommerce-checkout .wp-block-woocommerce-checkout {
	padding-top: 0;
}

.woocommerce-checkout .wc-block-components-form .wc-block-components-checkout-step.wc-block-checkout__contact-fields {
	display: none;
}

.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-product-name {
	color: var(--ntp-woo-ink);
	font-family: 'aktiv-grotesk', sans-serif;
}

.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-order-summary-item__description,
.woocommerce-checkout .wc-block-components-order-summary-item__total-price,
.woocommerce-checkout .wc-block-components-order-summary .wc-block-components-order-summary-item__total-price {
	padding-top: 12px !important;
	padding-bottom: 0 !important;
}

.woocommerce-checkout .wc-block-checkout__pickup-options .wc-block-components-local-pickup-rates-control .wc-block-components-radio-control__description,
.woocommerce-checkout .wp-block-woocommerce-checkout-pickup-options-block .wc-block-components-local-pickup-rates-control .wc-block-components-radio-control__description {
	align-items: flex-start !important;
}

.woocommerce-checkout .wc-block-components-form .wc-block-components-text-input label,
.woocommerce-checkout .wc-block-components-text-input label,
.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__label {
	color: var(--ntp-woo-muted) !important;
}

.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__select,
.woocommerce-checkout .wc-block-components-form .wc-block-components-text-input input[type='text'],
.woocommerce-checkout .wc-block-components-form .wc-block-components-text-input input[type='email'],
.woocommerce-checkout .wc-block-components-form .wc-block-components-text-input input[type='tel'] {
	border-color: var(--ntp-woo-border) !important;
}


/* =========================================================
   5. EMPTY CART BLOCK
   ========================================================= */

.woocommerce-cart .wp-block-woocommerce-empty-cart-block {
	width: 100%;
	margin: 20px auto;
	padding: 20px;
	border: 0;
	text-align: center;
}

.woocommerce-cart .wc-block-cart__empty-cart__title {
	margin: 0 0 16px;
	color: var(--ntp-woo-primary);
	font-family: 'aktiv-grotesk', sans-serif;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.15;
}

/* Remove WooCommerce's large empty-cart icon. */
.woocommerce-cart .wc-block-cart__empty-cart__title.with-empty-cart-icon::before {
	display: none !important;
	content: none !important;
}

.woocommerce-cart .wp-block-woocommerce-empty-cart-block p {
	max-width: 480px;
	margin: 0 auto 24px;
	color: var(--ntp-woo-muted);
	font-size: 17px;
	line-height: 1.6;
}

.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-button__link {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	min-height: 50px;
	padding: 12px 28px;
	border: 0;
	border-radius: 100px;
	background: var(--ntp-woo-primary);
	color: #ffffff;
	font-family: 'aktiv-grotesk', sans-serif;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-button__link:hover {
	background: var(--ntp-woo-primary-hover);
	color: var(--ntp-woo-primary);
}

.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-button__link:focus-visible {
	outline: 2px solid var(--ntp-woo-primary);
	outline-offset: 3px;
}

/* Hide default empty-cart recommendations and decoration. */
.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-separator.is-style-dots,
.woocommerce-cart .wp-block-woocommerce-empty-cart-block > .wp-block-heading:not(.wc-block-cart__empty-cart__title),
.woocommerce-cart .wp-block-woocommerce-empty-cart-block > .wp-block-woocommerce-product-new,
.woocommerce-cart .wp-block-woocommerce-empty-cart-block > .wp-block-woocommerce-product-collection {
	display: none !important;
}


/* =========================================================
   6. ORDER RECEIVED / THANK-YOU PAGE
   ========================================================= */

body.woocommerce-order-received .woocommerce-order {
	box-sizing: border-box;
	width: 100%;
	max-width: 680px;
	margin: 0 auto;
	padding: 28px;
	border: 1px solid var(--ntp-woo-border-soft);
	border-radius: var(--ntp-woo-radius);
	background: var(--ntp-woo-panel);
	color: var(--ntp-woo-ink);
}

/* Add the Order Summary heading. */
body.woocommerce-order-received .woocommerce-order::before {
	display: block;
	margin: 0 0 26px;
	color: var(--ntp-woo-ink);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	content: 'Order Summary';
}

/* Replaced by the custom Elementor confirmation component. */
body.woocommerce-order-received .woocommerce-thankyou-order-received {
	display: none;
}

body.woocommerce-order-received ul.woocommerce-order-overview {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
}

body.woocommerce-order-received ul.woocommerce-order-overview li {
	display: flex;
	float: none;
	justify-content: space-between;
	align-items: flex-start;
	gap: 30px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	color: var(--ntp-woo-soft-text);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	text-transform: none;
}

body.woocommerce-order-received ul.woocommerce-order-overview li strong {
	display: block;
	margin: 0;
	color: var(--ntp-woo-ink);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	text-align: right;
	text-transform: none;
}

/* Payment gateway instructions. */
body.woocommerce-order-received .woocommerce-order > p:not(.woocommerce-thankyou-order-received) {
	margin: 24px 0 0;
	padding: 14px 16px;
	border-radius: 8px;
	background: #f8f9f7;
	color: #4f4f4c;
	font-size: 15px;
}

body.woocommerce-order-received .woocommerce-order-details {
	margin: 32px 0 0;
	padding: 32px 0 0;
	border-top: 1px dashed var(--ntp-woo-border-soft);
}

body.woocommerce-order-received .woocommerce-order-details h2 {
	margin: 0 0 24px;
	color: var(--ntp-woo-ink);
	font-family: inherit;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	text-transform: capitalize;
}

body.woocommerce-order-received .woocommerce-order-details table.shop_table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	border-radius: 0;
	background: transparent;
}

body.woocommerce-order-received .woocommerce-order-details table.shop_table thead {
	display: none;
}

body.woocommerce-order-received .woocommerce-order-details table.shop_table tbody tr,
body.woocommerce-order-received .woocommerce-order-details table.shop_table tfoot tr {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: start;
	column-gap: 24px;
}

body.woocommerce-order-received .woocommerce-order-details table.shop_table th,
body.woocommerce-order-received .woocommerce-order-details table.shop_table td {
	display: block;
	width: auto;
	margin: 0;
	padding: 7px 0;
	border: 0;
	background: transparent;
	font-size: 16px;
	line-height: 1.4;
}

body.woocommerce-order-received .woocommerce-order-details td.product-name {
	color: var(--ntp-woo-soft-text);
	font-weight: 400;
}

body.woocommerce-order-received .woocommerce-order-details td.product-name a {
	color: inherit;
	font-weight: inherit;
	text-decoration: none;
}

body.woocommerce-order-received .woocommerce-order-details td.product-name .product-quantity {
	color: var(--ntp-woo-soft-text);
	font-weight: 400;
}

body.woocommerce-order-received .woocommerce-order-details td.product-total,
body.woocommerce-order-received .woocommerce-order-details table.shop_table tfoot td {
	color: var(--ntp-woo-ink);
	font-weight: 400;
	text-align: right;
	white-space: nowrap;
}

body.woocommerce-order-received .woocommerce-order-details table.shop_table tfoot th {
	color: var(--ntp-woo-ink);
	font-weight: 400;
	text-align: left;
}

body.woocommerce-order-received .woocommerce-order-details table.shop_table tfoot tr:first-child {
	margin-top: 8px;
}

body.woocommerce-order-received .woocommerce-order-details table.shop_table tfoot tr:last-child {
	margin-top: 6px;
}

body.woocommerce-order-received .woocommerce-order-details table.shop_table tfoot tr:last-child th,
body.woocommerce-order-received .woocommerce-order-details table.shop_table tfoot tr:last-child td {
	font-weight: 700;
}

body.woocommerce-order-received .woocommerce-order-details .woocommerce-Price-amount {
	font-weight: inherit;
}

/* Hide duplicated billing and shipping addresses. */
body.woocommerce-order-received .woocommerce-customer-details {
	display: none;
}


/* =========================================================
   7. CONDITIONAL ELEMENTOR COMPONENTS
   ========================================================= */

/* Checkout-only and all-status thank-you components. */
.ntp-checkout-only,
.ntp-thank-you-only {
	display: none !important;
}

body.woocommerce-checkout:not(.woocommerce-order-received):not(.woocommerce-order-pay) .ntp-checkout-only,
body.woocommerce-order-received .ntp-thank-you-only,
body.elementor-editor-active .ntp-checkout-only,
body.elementor-editor-active .ntp-thank-you-only {
	display: flex !important;
}

/* Status-specific order-result components. */
.ntp-order-success,
.ntp-order-unsuccessful {
	display: none;
}

body.ntp-order-result-success .ntp-order-success,
body.ntp-order-result-unsuccessful .ntp-order-unsuccessful,
body.elementor-editor-active .ntp-order-success,
body.elementor-editor-active .ntp-order-unsuccessful {
	display: flex;
}


/* =========================================================
   8. ORDER PAY ENDPOINT
   =========================================================

   Reserved for the WooCommerce order-pay screen. Add the
   production gateway-specific styles here after that endpoint
   has been tested with its final payment method.

   ========================================================= */


/* =========================================================
   9. RESPONSIVE ADJUSTMENTS
   ========================================================= */

@media (max-width: 767px) {
	body.woocommerce-order-received .woocommerce-order {
		padding: 24px 20px;
		border-radius: 16px;
	}

	body.woocommerce-order-received .woocommerce-order::before,
	body.woocommerce-order-received .woocommerce-order-details h2 {
		font-size: 22px;
	}

	body.woocommerce-order-received ul.woocommerce-order-overview li {
		gap: 20px;
		font-size: 15px;
	}

	body.woocommerce-order-received ul.woocommerce-order-overview li strong {
		max-width: 60%;
		font-size: 15px;
		overflow-wrap: anywhere;
	}

	body.woocommerce-order-received .woocommerce-order-details {
		margin-top: 28px;
		padding-top: 28px;
	}

	body.woocommerce-order-received .woocommerce-order-details table.shop_table tbody tr,
	body.woocommerce-order-received .woocommerce-order-details table.shop_table tfoot tr {
		column-gap: 16px;
	}

	body.woocommerce-order-received .woocommerce-order-details table.shop_table th,
	body.woocommerce-order-received .woocommerce-order-details table.shop_table td {
		font-size: 15px;
	}
}
