/**
 * Nuven Cart – side cart (Elementor Pro Menu Cart, "Side cart" type).
 *
 * Layout rules are scoped to body.nce-side-cart so they can be switched off
 * in WooCommerce → Nuven Cart. The "You might also like" block is styled on
 * its own so it looks right either way.
 */

:root {
	--nce-ink: #11100f;
	--nce-muted: rgba(17, 16, 15, 0.58);
	--nce-line: rgba(17, 16, 15, 0.1);
	--nce-sand: #f3efe7;
	--nce-cream: #faf8f3;
	--nce-brand-dark: #4c1720;
	--nce-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
	:root {
		--nce-brand-dark: color-mix(in srgb, var(--nce-brand, #641f2a) 78%, #000);
	}
}

/* ------------------------------------------------------------------ *
 * Drawer layout
 * ------------------------------------------------------------------ */

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main {
	padding: 22px 24px 24px;
}

@media (min-width: 768px) {
	body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main {
		width: 440px;
		padding: 28px 36px 28px;
	}
}

/* Content fills the drawer: the item list scrolls, the footer stays put. */
body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main .widget_shopping_cart_content {
	flex: 1 1 auto;
	min-height: 0;
	height: auto;
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__products {
	flex: 1 1 auto;
	min-height: 96px;
	max-height: none !important;
	overflow-y: auto;
	overscroll-behavior: contain;
	margin-inline-end: -12px;
	padding-inline-end: 12px;
	scrollbar-width: thin;
	scrollbar-color: rgba(17, 16, 15, 0.2) transparent;
}

/* ------------------------------------------------------------------ *
 * Item rows: image | name, options, price | remove
 * ------------------------------------------------------------------ */

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product {
	grid-template-columns: 76px minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	column-gap: 16px;
	align-items: start;
	padding: 18px 40px 18px 0 !important;
	border-bottom-color: var(--nce-line) !important;
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product:first-of-type {
	padding-top: 4px !important;
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-image {
	grid-row: 1 / 3;
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-image img {
	width: 76px;
	height: 76px;
	object-fit: cover;
	border-radius: 12px !important;
	background: var(--nce-sand);
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-name,
body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-price {
	padding-inline-start: 0;
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-name a {
	display: block;
	line-height: 1.4 !important;
	color: var(--nce-ink);
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product .variation {
	margin: 6px 0 0;
	column-gap: 4px;
	row-gap: 2px;
	color: var(--nce-muted);
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product .variation dt {
	font-weight: 600;
	color: var(--nce-ink);
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product .variation dd {
	margin: 0;
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-price {
	align-self: end;
	margin-top: 10px;
	color: var(--nce-ink);
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-price .product-quantity {
	color: var(--nce-muted) !important;
}

/* Remove button sits top-right, level with the product name. */
body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-remove {
	top: 18px;
	bottom: auto;
	border-color: rgba(17, 16, 15, 0.18);
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product:first-of-type .elementor-menu-cart__product-remove {
	top: 4px;
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-remove:before,
body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-remove:after {
	background: var(--nce-ink);
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-remove:hover {
	border-color: var(--nce-brand);
	background: var(--nce-brand);
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-remove:hover:before,
body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-remove:hover:after {
	background: #fff;
}

/* ------------------------------------------------------------------ *
 * Footer: Subtotal ........ $158  /  buttons
 * ------------------------------------------------------------------ */

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__subtotal {
	flex: 0 0 auto;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 18px 0 !important;
	border-width: 1px 0 0 !important;
	border-style: solid !important;
	border-color: var(--nce-line) !important;
	text-align: start;
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__subtotal strong {
	font-family: "Manrope", sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--nce-ink);
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__subtotal .amount {
	font-family: "Fraunces", serif;
	font-size: 24px;
	font-weight: 400;
	letter-spacing: -0.5px;
	color: var(--nce-ink);
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons {
	flex: 0 0 auto;
	padding-top: 0 !important;
}

body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons .elementor-button {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding-top: 0;
	padding-bottom: 0;
}

/* The free-shipping bar keeps its spacing above the list. */
body.nce-side-cart .elementor-menu-cart--cart-type-side-cart .nfsb-bar--drawer {
	flex: 0 0 auto;
}

/* ------------------------------------------------------------------ *
 * You might also like
 * ------------------------------------------------------------------ */

.elementor-menu-cart__main .nce-upsells,
.widget_shopping_cart_content .nce-upsells {
	flex: 0 0 auto;
	margin: 0;
	padding: 18px 0 20px;
	border-top: 1px solid var(--nce-line);
	text-align: start;
}

/* Directly above the buttons: the subtotal's own line already separates it. */
.elementor-menu-cart__subtotal + .nce-upsells {
	border-top: 0;
	padding-top: 0;
}

.nce-upsells .nce-upsells__title {
	margin: 0 0 12px;
	padding: 0;
	font-family: "Fraunces", serif;
	font-size: 19px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: -0.5px;
	text-transform: none;
	color: var(--nce-ink);
}

.nce-upsells .nce-upsells__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 24px) / 3);
	gap: 12px;
	margin: 0;
	padding: 0 0 2px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.nce-upsells .nce-upsells__track::-webkit-scrollbar {
	display: none;
}

.nce-upsells .nce-upsell {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	padding: 8px 8px 10px;
	border-radius: 14px;
	background: var(--nce-sand);
	scroll-snap-align: start;
	list-style: none;
}

.nce-upsells .nce-upsell::before,
.nce-upsells .nce-upsell::marker {
	content: none;
}

.nce-upsells .nce-upsell__media {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 10px;
	background: #e9e3d8;
}

.nce-upsells .nce-upsell__media img,
.nce-upsells .nce-upsell__img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
	border-radius: 0 !important;
	transition: transform 0.6s var(--nce-ease);
}

.nce-upsells .nce-upsell:hover .nce-upsell__img {
	transform: scale(1.05);
}

.nce-upsells .nce-upsell__name {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	min-height: 2.6em;
	margin: 9px 2px 2px;
	font-family: "Manrope", sans-serif;
	font-size: 10.5px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--nce-ink) !important;
}

.nce-upsells .nce-upsell__name:hover {
	color: var(--nce-brand) !important;
}

.nce-upsells .nce-upsell__price {
	display: block;
	margin: 0 2px 9px;
	font-family: "Manrope", sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--nce-ink);
}

.nce-upsells .nce-upsell__price del {
	margin-inline-end: 4px;
	color: var(--nce-muted);
}

.nce-upsells .nce-upsell__price ins {
	text-decoration: none;
}

.nce-upsells .nce-upsell__add {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 32px;
	margin-top: auto;
	padding: 0 8px;
	border: 1px solid var(--nce-brand);
	border-radius: 999px;
	background: transparent;
	font-family: "Manrope", sans-serif;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 1px;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--nce-brand) !important;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.nce-upsells .nce-upsell__add:hover,
.nce-upsells .nce-upsell__add:focus-visible {
	background: var(--nce-brand);
	color: #fff !important;
}

.nce-upsells .nce-upsell__add:focus-visible {
	outline: 2px solid var(--nce-brand);
	outline-offset: 2px;
}

.nce-upsells .nce-upsell__plus {
	display: inline-block;
	font-size: 14px;
	font-weight: 400;
	line-height: 1;
}

/* WooCommerce's own loading / added states for AJAX buttons. */
.nce-upsells .nce-upsell__add.loading {
	pointer-events: none;
	opacity: 0.75;
}

.nce-upsells .nce-upsell__add.loading .nce-upsell__plus {
	width: 11px;
	height: 11px;
	font-size: 0;
	border: 1.5px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: nce-spin 0.7s linear infinite;
}

.nce-upsells .nce-upsell__add.loading::after,
.nce-upsells .nce-upsell__add.added::after,
.nce-upsells .added_to_cart {
	display: none !important;
}

@keyframes nce-spin {
	to {
		transform: rotate(360deg);
	}
}

/* "Pops up" as the drawer opens: the block rises in, then each card. */
@keyframes nce-rise {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.elementor-menu-cart--shown .nce-upsells {
	animation: nce-rise 0.55s var(--nce-ease) 0.15s both;
}

.elementor-menu-cart--shown .nce-upsells .nce-upsell {
	animation: nce-rise 0.55s var(--nce-ease) both;
}

.elementor-menu-cart--shown .nce-upsells .nce-upsell:nth-child(1) { animation-delay: 0.25s; }
.elementor-menu-cart--shown .nce-upsells .nce-upsell:nth-child(2) { animation-delay: 0.32s; }
.elementor-menu-cart--shown .nce-upsells .nce-upsell:nth-child(3) { animation-delay: 0.39s; }
.elementor-menu-cart--shown .nce-upsells .nce-upsell:nth-child(n+4) { animation-delay: 0.46s; }

/* Once open, a cart refresh (e.g. after "Add") shouldn't replay it. */
body.nce-upsells-settled .nce-upsells,
body.nce-upsells-settled .nce-upsells .nce-upsell {
	animation: none;
}

@media (prefers-reduced-motion: reduce) {
	.nce-upsells,
	.nce-upsells .nce-upsell,
	.nce-upsells .nce-upsell__img {
		animation: none !important;
		transition: none !important;
	}
}

/* Phones: two and a bit cards, so it's obvious the row scrolls. */
@media (max-width: 767px) {
	.nce-upsells .nce-upsells__track {
		grid-auto-columns: calc((100% - 12px) / 2.3);
	}
}

/* Short laptop screens: keep room for the item list. */
@media (min-width: 768px) and (max-height: 760px) {
	.nce-upsells .nce-upsell__media {
		aspect-ratio: 4 / 3;
	}

	.nce-upsells {
		padding-bottom: 14px;
	}
}
