@import "../mixins";

.woocommerce-Price-amount amount {
	color: #000000;
}

.woocommerce {
	&.woocommerce-checkout {
		#main-footer,
		.page-header:after,
		.page-header-line {
			display: none !important;
		}

		.page-content,
		.woocommerce-notices-wrapper {
			padding-top: 0;
		}

		.page-header {
			align-items: center;

			h1,
			h1 a, h1 span {
				font-size: var( --vamtam-h3-font-size );
				font-weight: normal;
				border: var( --vamtam-no-border-link );
				transition: color .2s ease;
			}
			h1 a:hover {
				color: var( --vamtam-body-link-hover );
				cursor: pointer;
			}
		}

		.footer-wrapper {
			background: transparent !important;
		}


		.woocommerce-login-form {
		    float: left;
		}

		.woocommerce-login-form {
			width: 48%;

			.woocommerce-form-login-toggle {
				text-align: center;

				.woocommerce-info {
					padding: 15px 30px !important;
					margin-bottom: 20px;
					text-align: start;
					color: var(--widget-text-lighter);
				}
			}

		}
		.woocommerce-login-form {
			padding-right: 15px;
		}

		form.woocommerce-checkout {
			margin-top: 20px;
			.form-row {
				margin: 0 0 25px 0;
			}
		}

		.woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout {
			> ul {
				padding: 20px !important;
				margin: 0;
				margin-bottom: 20px;
			}
		}

		.col-1 label {
			padding-left: 20px;
			line-height: 30px;
		}

		label {
			font-size: 16px;
			font-weight: 500;
			letter-spacing: 0;
		}

		.wc-booking-summary {
			border: 0;
			padding: 0;
		}
	}

	.checkout-breadcrumb {
		.icon.shortcode {
			line-height: 1.15;
			font-size: 20px;
			padding: 0 20px;
			vertical-align: middle !important;
			color: var( --vamtam-default-line-color );
		}

		.title-part-inactive {
			&, a:not(:hover) {
				color: e("color( from var( --vamtam-accent-color-6) srgb r g b / .3  )");
			}
		}
	}

	&.woocommerce-cart {
		.woocommerce {
			margin-bottom: 100px;
		}

		.cart-collaterals {
			.button {
				margin: 10px 0 0 0;
			}
		}

		.vamtam-quantity input {
			padding: 10px 20px;
		}

		table.shop_table,
		table.shop_table th,
		table.shop_table td {
			border: 0;
		}

		table.shop_table {
			.product-thumbnail {
				img {
					width: 80px;
				}

				a {
					border: var( --vamtam-no-border-link );
					display: block;
					line-height: 0;
				}
			}


			td {
				border-top: 1px solid var( --vamtam-default-line-color );
				border-bottom: 0;

				&:first-child {
					padding-left: 0;
				}

				&:last-child {
					padding-right: 0;
				}
			}

			a.remove:hover {
				background: none;
				color: red;
			}
		}

		.cart_totals {
			td {
				text-align: end;
			}
		}

		.woocommerce-cart-form {
			transition: opacity .3s ease;
			&.processing {
				&, ~ .vamtam-cart-collaterals {
					cursor: wait;
					opacity: .5;
					* > {
						pointer-events: none;
					}
				}
			}
		}

		.blockUI.blockOverlay {
			display: none !important;
		}

		.cart_totals,
		.shipping_calculator {
			width: auto;
			float: none;
		}

		.vamtam-woocommerce-cart-form-wrapper {
			display: flex;
			flex-wrap: nowrap;
			background-color: transparent;
			border-radius: var(--vamtam-border-radius);

			.woocommerce-cart-form {
				flex: 0 1 60%;
			}

			.vamtam-cart-collaterals {
				flex: 1 1 40%;
				padding-left: 5%;
			}

			input[type="submit"][name="update_cart"] {
				display: none;
			}

			.cross-sells {
				width: 66%;
			}

			@media ( max-width: 1250px ) {
				:not( .layout-full )& {
					flex-direction: column;

					.vamtam-cart-main,
					.vamtam-cart-collaterals {
						flex-basis: auto;
						padding-left: 0;
					}
				}
			}
		}

		.cross-sells {
			border-top: 1px solid var(--vamtam-accent-color-7);
			padding: 0px;

			> h2 {
				&:extend( .vamtam-font-h4 );
				margin: 0;
				padding-top: 50px;
				padding-bottom: 50px;
			}

			ul.products {
				display: grid;
				grid-template-columns: repeat(4, 1fr);
				grid-gap: 30px;
				&::before {
					display: none;
				}
			}

			ul.products > li.product {
				width: auto !important;
				float: none !important;
				margin: 0 !important;
				clear: none !important;

				.vamtam-product-content {
					padding-left: 20px;
					padding-right: 20px;
					padding-bottom: 30px;
				}

				.woocommerce-product-details__short-description {
					display: none;
				}

				.add_to_cart_button {
					padding-left: 0;
					padding-right: 0;
					box-sizing: border-box;
				}
			}
		}

		.shipping-calculator-button {
			&:hover {
				text-decoration: none;
			}

			&:after {
				display: none;
			}
		}

		.shipping-calculator-form {
			.button {
				margin: 0;
			}

			.form-row {
				padding: 0;

				input {
					margin: 0 !important;
				}

				.calc_shipping_country_field {
					margin-bottom: 10px;
				}
			}

		}
	}

	#add_payment_method #payment ul.payment_methods li,
	&.woocommerce-cart #payment ul.payment_methods li,
	&.woocommerce-checkout #payment ul.payment_methods li,
	& #payment .woocommerce-terms-and-conditions-wrapper p {
		line-height: 1.5;
		font-size: 0.9em;
		font-weight: normal;
		border: none;
	}

	.cart-empty.woocommerce-info {
		display: none;
	}

	.vamtam-empty-cart {
		display: flex;
		flex-flow: column nowrap;
		justify-content: center;
		align-items: center;

		.empty-cart-notice,
		.cta-text {
			margin: 20px 0 40px 0;
		}

		.empty-cart-notice {
			font-size: 12px;
			font-weight: normal;
		}

		.cta-text {
			text-align: center;
		}

		svg {
			fill: var(--vamtam-accent-color-1);
		}
	}

	.vamtam-woocommerce-cart-form-wrapper {
		padding-bottom: 50px;
	}

	.vamtam-cart-main {
		padding: 30px 30px 20px 30px;
		border-radius: var(--vamtam-border-radius);

		.vamtam-cart__header {
			color: var(--vamtam-accent-color-1);
		}

		.woocommerce-cart-form__contents {
			height: auto;
			max-height: unset;
			overflow: visible;
			overflow-x: hidden;
			grid-row: 1;
		}

		.product-thumbnail {
			max-width: 70px;
			max-height: fit-content;
			grid-row: 1/2;

			img {
				display: block;
			}
		}

		.product-remove {
			grid-column: 4;
			justify-self: flex-end;
			border: 0;
			width: auto;
			height: auto;

			// Override some def Elementor styles.
			> a {
				display: inline;
				z-index: initial;
				overflow: hidden;
				opacity: 1;
				position: relative;
			}

			&::before,
			&::after {
				display: none;
			}
		}

		.product-price {
			grid-column: 3;
			align-self: flex-start;
			padding-left: 0;

			.quantity {
				display: flex;
				min-height: 30px;
				align-items: center;

				.vamtam-quantity {
					position: relative;
					margin-right: 15px;

					svg {
						fill: currentColor;
						stroke: currentColor;
						stroke-width: 0;
						width: 1em;
						height: 1em;
						position: absolute;
						top: calc(50% - .5em);
						left: 55%;
						right: 0;
						bottom: 0;
						font-weight: 500;
						font-size: 16px;
						pointer-events: none;
					}

					select {
						&:hover, &:focus {
							&:not(:disabled) {
								border-color: var( --vamtam-accent-color-1 );
							}
						}

						&:focus {
							outline: 0;
							box-shadow: none;
						}

						appearance: none;
						padding: 0 1rem 0 1.5rem !important;
						height: 2rem;
						min-width: 5rem;
						max-width: 100%;
						border: 1px solid var( --vamtam-default-line-color );
						transition: border .3s cubic-bezier(0.39,0.575,0.565,1);
						text-overflow: ellipsis;

						color: inherit;
						line-height: inherit;
						font-size: inherit;
						font-family: inherit;
						font: inherit;
						// Overrides
						background: none !important;
						margin: 0 !important;
						padding-bottom: 0 !important;
						// No border form menu cart/standard below-max (max standard overrides this)
						border: 0;
					}
				}

				.woocommerce-Price-amount {
					margin-left: auto;
				}
			}
		}

		.product-name {
			grid-column: 2 / 3;
			padding: .6em 25px 0 25px;

			> a {
				.vamtam-line-clamp-2();
			}
		}

		.cart_item {
			display: grid;
			grid-template-rows: auto auto;
			grid-template-columns: max-content 50% minmax(20%, auto) 40px;
			grid-row-gap: 20px;
			padding: 15px 0;
			background-color: var(--vamtam-accent-color-5);
			border: 0;

			&:not(:last-of-type),
			&:not(:first-of-type) {
				margin: 0;
				border: none;
			}
		}

		.vamtam-close {
			display: inline-block;
			width: 1em;
			height: 1em;
			transition: all .3s ease;
			stroke-width: 0;
			stroke: currentColor;
			fill: currentColor;
			vertical-align: middle;

			* {
				pointer-events: none;
			}
		}

		.cart_item {
			background-color: transparent;

			&:not(:last-child) {
				border-bottom: 1px solid var( --vamtam-accent-color-3 );
			}
		}

		.product-remove a {
			color: e("color( from var(--vamtam-accent-color-3) srgb r g b / 1 )");

			&:hover {
				color: var(--vamtam-accent-color-1);
			}
		}
	}

	.vamtam-cart-collaterals {
		.vamtam-sticky-wrapper {
			position: sticky;
			top: 0;
		}

		.coupon {
			border-radius: var(--vamtam-border-radius);
			background-color: transparent;
			border: solid 1px var(--vamtam-default-line-color);

			details {
				transition: height .5s ease;

				> summary {
					display: block; // Safari flex bug: https://bugs.webkit.org/show_bug.cgi?id=190065
					position: relative;
					padding: 15px 30px;

					&::-webkit-details-marker {
						display: none;
					}

					list-style: none;
					outline: 0;

					svg {
						position: absolute;
						right: 20px;
						transform: rotate(-270deg);
						transition: transform .5s ease;
					}
				}

				.content {
					padding: 0 30px 30px 30px;

					> button[type="submit"] {
						width: 100%;
						margin-top: 15px;
					}
				}

				&[open] {
					.content {
						animation-name: vamtam-fadein;
						animation-duration: 1.5s;
					}

					> summary > svg {
						transform: rotate(-90deg);
					}
				}
			}

			input[name="apply_coupon"] {
				border-radius: 0;
				border: none;
			}
		}

		.cart_totals {
			> h4 {
				margin: 0;
			}
		}
	}

	&.woocommerce-checkout {
		.checkout_coupon {
			display: flex;
			flex-direction: column;
			align-items: center;
			margin: 20px 0;
			border: solid 1px var(--vamtam-default-line-color);
			padding: 20px 30px 30px 30px;

			.vamtam-checkout-coupon-header {
				width: 100%;

				.form-row.form-row-first {
					margin-bottom: 0;
					width: 100%;
					padding: 0;
				}
			}

			.form-row.form-row-last {
				display: block;
				width: 100%;

				.button[name="apply_coupon"] {
					margin: 25px 0 0 0;

					&::before, &::after {
						display: none;
					}
				}
			}
		}

		.form-row textarea {
			height: 5em;
		}

		form.checkout {
			clear: both;
		}

		.cart_item {
			b, strong, td {
				font-weight: normal;
			}
		}
		.customer_details {
			dt, dd {
				display: inline;
			}

			dt:before {
				display: block;
				content: "";
			}
		}

		.addresses {
			margin-top: var( --vamtam-vertical-padding );
		}

		table.shop_table {
			border-collapse: collapse;
			thead {
				display: none;
			}
			th, td {
				border: 0;
				border-bottom: solid 1px;
				border-color: var( --vamtam-default-line-color );
			}
			tr:nth-child(1) {
				border-top: 0;

				td.product-name {
					width: 60%;
				}
				td.product-total {
					width: 40%;
				}
			}
			.cart_item {
				.product-name {
					color: inherit;
				}
				.product-total {
					text-align: end;
				}
			}
			.cart-subtotal,
			.woocommerce-shipping-totals {
				th, td {
					font-weight: inherit;
				}
			}
			tfoot {
				th {
					text-align: start;
				}
				td {
					text-align: end;
				}
			}
		}
		.order-total {
			border: none;
			th, td {
				border: none !important;
			}
			td {
				&:extend(.vamtam-font-h4);
				color: var(--vamtam-accent-color-1);
			}
		}
		#shiptobilling {
			line-height: 2.7em;
		}

		header.main-header {
			.second-row,
			.cart-dropdown,
			.search-wrapper,
			#header-text {
				display: none;
			}

			.header-contents {
				display: block;
				text-align: center;
			}

			.first-row {
				display: inline-block;
				max-width: none;
				box-sizing: border-box;
				padding: 17px 0;
			}

		}

		.col2-set {
			@media ( max-width: 1250px ) {
				:not( .layout-full )& {
					.woocommerce .woocommerce-billing-fields {
						padding-top: 0;
					}

					.col-1,
					.col-2 {
						width: auto;
						float: none;
					}
				}
			}
		}

		.layout-single-row .first-row {
			border: none;
		}
	}

	.cart_item{
		a {
			display: inline-block;
			b, strong {
				font-weight: 500;
			}
		}
		b, strong, td {
			font-weight: 500;
		}

	}

	.myaccount_user {
		padding-bottom: 70px;
	}

	.myaccount_address {
		padding-bottom: 30px;
	}

	.login {
		.form-row {
			display: inline-block;
		}
	}

	.lost_password {
		padding-left: 10px;
		display: inline-block;
		margin-top: 20px;

		&:before {
			content: "|";
			font-size: 16px;
			line-height: 16px;
			text-align: start;
			color:  var( --vamtam-default-line-color );
			padding-right: 15px;
			vertical-align: middle;
		}
	}

	#order_review_heading,
	.woocommerce-billing-fields h3,
	.woocommerce-shipping-fields h3 {
		&:extend(.vamtam-font-h4);
		color: var( --vamtam-accent-color-1 );
		margin-top: 20px;
		margin-bottom: 30px;
	}

	.cart-collaterals {
		padding: 30px 30px 20px 30px;
		background-color: var(--vamtam-accent-color-4);
		box-sizing: border-box;
		border-radius: var( --vamtam-border-radius );
    	margin-bottom: 20px;
	}

	.col2-set .col-2 {
		box-sizing: border-box;
	}

	.col2-set .col-2 {
		position: relative;
		background-color: #ffffff;
		padding: 20px 0 25px 0;

		#order_review_heading {
			margin: 0;
			margin-bottom: 6px;
		}
	}

	.woocommerce .cart-empty,
	.return-to-shop {
		text-align: center;
		margin-bottom: 20px;
	}

	form.checkout_coupon {
		border-radius: 0px;
		border: 0;

		&:extend(.woocommerce.woocommerce-cart .coupon all);

		> p {
			float: none;
			width: auto;
			margin: 0;
			padding: 0;

			&.form-row-last {
				display: grid;
			}
		}
	}

	&.woocommerce-cart,
	&.woocommerce-checkout {
		.meta-header {
			border-bottom: 0;

			.meta-header-inside {
				h3 {
					margin: 0;
				}
			}
		}

		table.shop_table {
			&, th, td {
				&:extend( .vamtam-font-primary-font );
			}
			.cart-subtotal {
				td,
				.woocommerce-Price-amount.amount {
					color: inherit;
				}
			}

			&.woocommerce-table--order-details tfoot tr:last-child,
			.order-total {
				.woocommerce-Price-amount.amount {
					font-size: 16px;
					color: inherit;
				}
				th {
					font-weight: bold;
				}
			}

			.order-total {
				td {
					color: inherit;
					strong {
						color: #000;
					}
				}
			}

			th {
				color: inherit;
				text-transform: inherit;
				border-top: 1px solid var( --vamtam-default-line-color );
			}

			th, td {
				line-height: inherit;
				font-weight: inherit;
				padding: 15px 0px 15px 0px;
			}
		}
	}

	&.woocommerce-cart h4,
	&.woocommerce-checkout h4,
	&.woocommerce-cart .font-h4 {
		color: var( --vamtam-widget-text-darker );
	}
}

.woocommerce-order-received {
	.woocommerce {
		ul.order_details {
			text-align: start;
			margin: 20px 0 50px 0;

			+ p {
				margin-top: -40px;
				margin-bottom: 50px;
			}

			li {
				margin-top: 1em;
			}
		}

		.bacs_details,
		.woocommerce-order-overview {
			border: 1px solid var(--vamtam-default-line-color);
			border-top-width: 3px;
			padding: 10px 20px 20px 20px;
		}

		.col2-set .col-2,
		.cart-collaterals {
			padding: 0px;
			box-shadow: none;
			margin: 0px
		}

		address {
			border-width: 1px;
			padding: 30px 20px;
			width: auto;
			margin-bottom: 35px;
		}

		.wc-bacs-bank-details-account-name {
			font: var(--vamtam-primary-font-font-style, normal) var(--vamtam-primary-font-font-weight, normal) var(--vamtam-primary-font-font-size)/var(--vamtam-primary-font-line-height) var(--vamtam-primary-font-font-family);
		}

		.woocommerce-thankyou-order-received,
		.wc-bacs-bank-details-heading {
			margin: 20px 0;
			font: var(--vamtam-h4-font-style, normal) var(--vamtam-h4-font-weight, normal) var(--vamtam-h4-font-size)/var(--vamtam-h4-line-height) var(--vamtam-h4-font-family);
			letter-spacing: var(--vamtam-h4-letter-spacing, normal);
			text-transform: var(--vamtam-h4-transform, none);
			text-decoration: var(--vamtam-h4-decoration, none);
		}

		.woocommerce-thankyou-order-received {
			margin-bottom: 30px;
		}

		table.woocommerce-table--order-details {
			thead {
				display: none;
			}
			border-collapse: collapse;
			.product-total {
				text-align: end;
			}
			th {
				font-weight: inherit;
				line-height: inherit;
			}

			th, td {
				padding: 15px 20px;
				border: solid 1px var(--vamtam-default-line-color);
			}

			tfoot td {
				text-align: end;
			}
		}

		.woocommerce-order-details__title {
			margin: 30px 0;
		}

		.woocommerce-order-details > .woocommerce-order-details__title,
		.woocommerce-customer-details .woocommerce-column__title {
			&:extend(.vamtam-font-h4);
		}
	}
}


@media (max-width: 1024px) {
	.elementor-widget-woocommerce-checkout-page .woocommerce-checkout :is(.form-row-first, .form-row-last) {
		float: none !important;
	}
}
