@import '../../1-helpers/functions.scss';

// dropdown type
.ct-cart-content {
	width: 310px;
	margin-top: var(--dropdownTopOffset);
	padding: 22px 20px;
	border-radius: 2px;
	background: var(--mini-cart-background-color);
	box-shadow: 0px 10px 20px 0px rgba(41, 51, 61, 0.1);

	--theme-content-spacing: 0;
	--mini-cart-items-spacing: 15px;
	--mini-cart-divider-color: rgba(255, 255, 255, 0.1);

	&[data-count="0"] {
		display: none;
	}

	.woocommerce-mini-cart {
		max-height: 40vh;
		overflow-y: auto;
		margin-inline: -20px;
		padding-inline: 20px;

		li {
			grid-column-gap: 15px;
			padding-bottom: var(--mini-cart-items-spacing);

			&:not(:last-child) {
				border-bottom: 1px dashed var(--mini-cart-divider-color);
			}
		}
	}

	.product-title {
		line-height: 1.3;
	}

	.woocommerce-mini-cart__buttons {
		.button {
			--theme-button-font-size: 11px;
			--theme-button-font-weight: 600;
			// --theme-button-letter-spacing: 0.05em;
			--theme-button-text-transform: uppercase;

			--theme-button-padding: 0 10px;
			--theme-button-min-height: 45px;
			--theme-button-shadow: none;
			--theme-button-transform: none;
		}
	}

	// placement
	&[data-placement='left'] {
		right: -20px;
	}

	&[data-placement='right'] {
		left: -20px;
	}

	// bridge
	&:before {
		position: absolute;
		content: '';
		width: 100%;
		height: var(--dropdownTopOffset);
		top: calc(var(--dropdownTopOffset) * -1);
		left: 0;
	}
}



// panel type
#woo-cart-panel {

	.ct-panel-content-inner {
		flex: 1;
		overflow: hidden;
		--horizontal-alignment: stretch;
	}

	ul {
		// flex: 1;
		overflow-y: auto;
		margin: 0 calc(var(--panel-padding, 35px) * -1);
		padding: 0 var(--panel-padding, 35px) 25px var(--panel-padding, 35px);
	}

	@include media-breakpoint-up(sm) {
		.product-title {
			font-weight: 700;
		}

		.woocommerce-mini-cart__total {
			font-size: 13px;
		}
	}

	.woocommerce-mini-cart__buttons {
		@include media-breakpoint-down(sm) {
			grid-template-columns: 1fr;
			grid-row-gap: 15px;
		}
	}
}



// common styles
.woocommerce-mini-cart {
	position: relative;

	li {
		position: relative;
		z-index: 1;
	}

	dl.variation {
		font-size: 13px;
	}

	.ct-media-container {
		border-radius: var(--theme-border-radius, 3px);
	}

	.remove {
		position: absolute;
		z-index: 2;
		inset-inline-end: 0;
		width: 11px;
		height: 11px;
		line-height: 11px;
		--theme-icon-size: 11px;
		--theme-icon-color: currentColor;
		--theme-link-initial-color: var(--theme-text-color);
	}

	~ .buttons {

		.button {
			&:hover {
				color: var(--theme-button-text-hover-color);
			}
		}
	}
}

.woocommerce-mini-cart__total {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	font-weight: 700;
	text-align: center;
	text-transform: uppercase;
	margin-top: auto;
}

.woocommerce-mini-cart__buttons {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-column-gap: 15px;
	margin: 0;

	> * {
		grid-column: var(--gridColumn, 1/-1);
	}

	.button.wc-forward {
		--gridColumn: span 1;
	}
}

.woocommerce-mini-cart__total,
.ct-shipping-progress-mini-cart,
.ct-suggested-products--mini-cart, {
	margin-bottom: var(--mini-cart-items-spacing, 20px);
}

.woocommerce-mini-cart__total,
.woocommerce-mini-cart__buttons,
.ct-suggested-products--mini-cart {
	padding-top: var(--mini-cart-items-spacing, 20px);
	border-top: 1px dashed var(--mini-cart-divider-color, rgba(0, 0, 0, 0.07));
}

.woocommerce-mini-cart li,
.woocommerce-mini-cart__total,
.woocommerce-mini-cart__empty-message,
.ct-shipping-progress-mini-cart,
.ct-suggested-products--mini-cart .ct-module-title {
	color: var(--theme-text-color);
}
