/**
 * Custom Mini-Cart Slider Styles
 * Matches the design from the second image
 */

/* Cart Header */
.ft-mini-cart-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	margin-bottom: 0;
	position: relative;
}

.ft-mini-cart-title {
	font-size: 18px;
	font-weight: 600;
	color: #ffffff;
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Hide Elementor's default header to prevent duplicate "YOUR CART" text */
.elementor-menu-cart__header {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	overflow: hidden !important;
	opacity: 0 !important;
	position: absolute !important;
	left: -9999px !important;
}

/* Ensure only one custom header shows - hide duplicates */
.ft-mini-cart-header:not(:first-of-type) {
	display: none !important;
}

/* Ensure Elementor header wrapper doesn't show duplicate content */
.elementor-menu-cart__main .elementor-menu-cart__header {
	display: none !important;
}

/* Hide Elementor's default close button (rendered separately) */
.elementor-menu-cart__main > .elementor-menu-cart__close-button:not(.ft-mini-cart-close-wrapper) {
	display: none !important;
}

/* Close button wrapper inside header */
.ft-mini-cart-header .elementor-menu-cart__close-button.ft-mini-cart-close-wrapper {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	flex-shrink: 0;
}

.ft-mini-cart-close-wrapper .ft-mini-cart-close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s ease;
	width: 24px;
	height: 24px;
}

.ft-mini-cart-close-wrapper .ft-mini-cart-close:hover {
	opacity: 0.7;
}

.ft-mini-cart-close-wrapper .ft-mini-cart-close svg {
	width: 20px;
	height: 20px;
}

.ft-mini-cart-close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s ease;
}

.ft-mini-cart-close:hover {
	opacity: 0.7;
}

.ft-mini-cart-close svg {
	width: 20px;
	height: 20px;
}

/* Cart Items Container */
.ft-mini-cart-items {
	padding: 0;
	margin: 0;
	list-style: none;
	max-height: calc(100vh - 300px);
	overflow-y: auto;
}

/* Individual Cart Item */
.ft-mini-cart-item {
	display: flex;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	position: relative;
}

.ft-mini-cart-item:last-child {
	border-bottom: none;
}

/* Product Image */
.ft-mini-cart-item__image {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
}

.ft-mini-cart-item__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
}

.ft-mini-cart-item__image a {
	display: block;
	width: 100%;
	height: 100%;
}

/* Item Details */
.ft-mini-cart-item__details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

/* Item Header (Title + Delete) */
.ft-mini-cart-item__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.ft-mini-cart-item__title {
	font-size: 14px;
	font-weight: 500;
	color: #ffffff;
	margin: 0;
	flex: 1;
	line-height: 1.4;
}

.ft-mini-cart-item__title a {
	color: #ffffff;
	text-decoration: none;
	transition: color 0.2s ease;
}

.ft-mini-cart-item__title a:hover {
	color: #FF9016;
}

/* Remove Button */
.ft-mini-cart-item__remove {
	flex-shrink: 0;
}

.ft-remove-item {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	color: #ffffff;
	text-decoration: none;
	transition: opacity 0.2s ease;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
}

.ft-remove-item:hover {
	opacity: 0.7;
}

.ft-remove-item svg {
	width: 20px;
	height: 21px;
}

/* Price */
.ft-mini-cart-item__price {
	font-size: 16px;
	font-weight: 600;
	color: #ffffff;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ft-price-label {
	font-weight: 500;
}

.ft-mini-cart-item__price .woocommerce-Price-amount {
	color: #ffffff;
}

/* Quantity Controls and Subtotal */
.ft-mini-cart-item__quantity-wrapper {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

/* Quantity Controls */
.ft-quantity-controls {
	display: flex;
	align-items: center;
	gap: 0;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.3);
	background: #2a2a2a;
}

.ft-quantity-btn {
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 20px;
	font-weight: 600;
	width: 36px;
	height: 36px;
	cursor: pointer !important;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	padding: 0;
	line-height: 1;
	border-right: 1px solid rgba(255, 255, 255, 0.1);
	pointer-events: auto !important;
	position: relative;
	z-index: 10;
}

.ft-quantity-btn.ft-quantity-plus {
	border-right: none;
	border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.ft-quantity-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #FF9016;
}

.ft-quantity-btn:active {
	background: rgba(255, 255, 255, 0.15);
	transform: scale(0.95);
}

.ft-quantity-value {
	font-size: 18px;
	font-weight: 700;
	color: #ffffff;
	min-width: 40px;
	text-align: center;
	background: transparent;
	padding: 8px 4px;
	border-left: 1px solid rgba(255, 255, 255, 0.1);
	border-right: 1px solid rgba(255, 255, 255, 0.1);
	border-top: none;
	border-bottom: none;
	-webkit-appearance: none;
	-moz-appearance: textfield;
	appearance: none;
}

/* Style for input type number */
.ft-quantity-value[type="number"] {
	display: inline-block;
	width: 50px;
	cursor: text;
}

/* Hide number input spinners */
.ft-quantity-value[type="number"]::-webkit-inner-spin-button,
.ft-quantity-value[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Style for span (backward compatibility) */
.ft-quantity-value:not([type="number"]) {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Subtotal */
.ft-mini-cart-item__subtotal {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.ft-subtotal-label {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.7);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ft-subtotal-value {
	font-size: 16px;
	font-weight: 600;
	color: #ffffff;
}

.ft-subtotal-value .woocommerce-Price-amount {
	color: #ffffff;
}

/* Cart Footer */
.ft-mini-cart-footer {
	padding: 20px 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	margin-top: auto;
}

.ft-mini-cart-checkout-btn {
	display: block;
	width: 100%;
	padding: 16px 24px;
	background: #FF9016;
	color: #ffffff;
	text-align: center;
	text-decoration: none;
	font-size: 16px;
	font-weight: 600;
	border-radius: 4px;
	transition: all 0.2s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border: none;
	cursor: pointer;
}

.ft-mini-cart-checkout-btn:hover {
	background: #e67e00;
	color: #ffffff !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(255, 144, 22, 0.3);
}

.ft-mini-cart-checkout-btn:active {
	transform: translateY(0);
}

.ft-checkout-text {
	display: block;
}

/* Empty Cart Message */
.ft-mini-cart-empty {
	padding: 60px 24px;
	text-align: center;
	color: rgba(255, 255, 255, 0.7);
	font-size: 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 24px;
	min-height: 300px;
}

.ft-empty-cart-icon {
	color: rgba(255, 255, 255, 0.5);
	margin-bottom: 8px;
}

.ft-empty-cart-icon svg {
	width: 80px;
	height: 80px;
}

.ft-empty-cart-title {
	font-size: 18px;
	font-weight: 700;
	color: #ffffff;
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.ft-shop-now-btn {
	display: inline-block;
	padding: 14px 32px;
	background: #FF9016;
	color: #ffffff;
	text-align: center;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	border-radius: 4px;
	transition: all 0.2s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border: none;
	cursor: pointer;
	margin-top: 8px;
}

.ft-shop-now-btn:hover {
	background: #e67e00;
	color: #ffffff !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(255, 144, 22, 0.3);
}

.ft-shop-now-btn:active {
	transform: translateY(0);
}

/* Elementor Menu Cart Container Adjustments */
.elementor-menu-cart__main {
	display: flex;
	flex-direction: column;
	height: 100%;
    background-color: grey;
}

.elementor-menu-cart__main .widget_shopping_cart_content {
	display: flex;
	flex-direction: column;
	height: 100%;
	flex: 1;
	overflow: hidden;
}

/* Hide default Elementor cart item styling */
.elementor-menu-cart__products .elementor-menu-cart__product {
	display: none;
}

.elementor-menu-cart__products .ft-mini-cart-item {
	display: flex;
}

/* Hide default subtotal and footer buttons */
.elementor-menu-cart__subtotal,
.elementor-menu-cart__footer-buttons {
	display: none !important;
}

/* Loading and updating states */
.ft-mini-cart-item.ft-updating {
	opacity: 0.6;
}

.ft-mini-cart-item.ft-updating .ft-quantity-btn {
	pointer-events: none;
}

.ft-mini-cart-item.ft-removing {
	opacity: 0.6;
	transition: opacity 0.3s ease;
	position: relative;
}

.ft-mini-cart-item.ft-removing .ft-quantity-btn {
	pointer-events: none;
}

/* Remove loader overlay */
.ft-remove-loader {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	border-radius: 4px;
}

.ft-remove-loader-spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: #FF9016;
	border-radius: 50%;
	animation: ft-spin 0.8s linear infinite;
}

@keyframes ft-spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.ft-updating .ft-quantity-controls {
	opacity: 0.5;
}

/* Ensure proper spacing in cart container */
.elementor-menu-cart__main .widget_shopping_cart_content {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

/* Make sure cart items scroll properly */
.ft-mini-cart-items {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
}

/* Scrollbar styling */
.ft-mini-cart-items::-webkit-scrollbar {
	width: 6px;
}

.ft-mini-cart-items::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.05);
}

.ft-mini-cart-items::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 3px;
}

.ft-mini-cart-items::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.3);
}

.elementor-menu-cart__main{
    max-width: 600px !important;
    width: 100% !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.ft-mini-cart-item {
		padding: 16px 20px;
		gap: 12px;
	}

	.ft-mini-cart-item__image {
		width: 60px;
		height: 60px;
	}

	.ft-mini-cart-header {
		padding: 16px 20px;
	}

	.ft-mini-cart-footer {
		padding: 16px 20px;
	}

	.ft-mini-cart-title {
		font-size: 16px;
	}

	.ft-mini-cart-items {
		max-height: calc(100vh - 250px);
	}
}

