/**
 * Off-Canvas Sliding Cart Drawer Styles
 *
 * @package Magical_Shop_Builder
 * @since   2.1.0
 */

/* Container & Backdrop */
.mpd-cart-drawer-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	visibility: hidden;
	pointer-events: none;
	transition: visibility 0.35s ease;
}

.mpd-cart-drawer-container.is-open,
.mpd-cart-drawer-container.mpd-cart-drawer--open {
	visibility: visible;
	pointer-events: auto;
}

.mpd-cart-drawer-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.35s ease;
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

.mpd-cart-drawer-container.is-open .mpd-cart-drawer-backdrop,
.mpd-cart-drawer-container.mpd-cart-drawer--open .mpd-cart-drawer-backdrop {
	opacity: 1;
}

/* Sliding Panel */
.mpd-cart-drawer-panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 440px;
	height: 100%;
	max-height: 100vh;
	background-color: #ffffff;
	box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 2;
	box-sizing: border-box;
	overflow: hidden;
}

.mpd-cart-drawer-container.is-open .mpd-cart-drawer-panel,
.mpd-cart-drawer-container.mpd-cart-drawer--open .mpd-cart-drawer-panel {
	transform: translateX(0);
}

/* Drawer Header */
.mpd-cart-drawer-header {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	border-bottom: 1px solid #eef0f2;
	background-color: #ffffff;
	box-sizing: border-box;
}

.mpd-cart-drawer-header-title {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	position: relative;
}

.mpd-cart-drawer-icon {
	font-size: 20px;
	color: #1a1a1a;
	display: inline-flex;
	align-items: center;
}

.mpd-cart-drawer-heading {
	font-size: 18px;
	font-weight: 700;
	color: #1a1a1a;
	letter-spacing: -0.2px;
	margin: 0;
	line-height: 1.2;
}

#mpd-cart-drawer .mpd-cart-drawer-count-badge {
	position: static !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	transform: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-width: 22px !important;
	height: 22px !important;
	padding: 0 7px !important;
	border-radius: 11px !important;
	background-color: #2271b1;
	color: #ffffff;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	margin: 0 !important;
	vertical-align: middle !important;
}

#mpd-cart-drawer button.mpd-cart-drawer-close {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	cursor: pointer !important;
	padding: 6px !important;
	margin: -6px !important;
	font-size: 24px !important;
	line-height: 1 !important;
	color: #666666 !important;
	transition: color 0.2s ease, transform 0.2s ease !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	border-radius: 4px !important;
	width: auto !important;
	min-width: 0 !important;
	height: auto !important;
}

#mpd-cart-drawer button.mpd-cart-drawer-close:hover {
	color: #d63638 !important;
	transform: scale(1.1) !important;
	background: transparent !important;
}

/* Content Wrap */
.mpd-cart-drawer-content-wrap {
	flex: 1 1 auto;
	min-height: 0;
	height: 100%;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	position: relative;
	box-sizing: border-box;
}

.mpd-cart-drawer-content {
	flex: 1 1 auto;
	min-height: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-sizing: border-box;
}

/* Free Shipping Bar inside Drawer */
.mpd-drawer-shipping-bar-wrap {
	flex-shrink: 0;
	background-color: #f8fafc;
	padding: 14px 24px;
	border-bottom: 1px solid #edf2f7;
	box-sizing: border-box;
}

.mpd-drawer-shipping-bar-msg {
	font-size: 13px;
	line-height: 1.4;
	color: #334155;
	margin-bottom: 8px;
	text-align: center;
}

.mpd-drawer-shipping-bar-msg strong {
	color: #0f172a;
}

.mpd-shipping-unlocked {
	color: #16a34a;
	font-weight: 600;
}

.mpd-drawer-shipping-progress {
	height: 7px;
	background-color: #e2e8f0;
	border-radius: 4px;
	overflow: hidden;
	position: relative;
}

.mpd-drawer-shipping-fill {
	height: 100%;
	background: linear-gradient(90deg, #10b981 0%, #059669 100%);
	border-radius: 4px;
	transition: width 0.4s ease;
}

/* Items List */
.mpd-cart-drawer-items {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px 24px;
	margin: 0;
	list-style: none;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 transparent;
	box-sizing: border-box;
}

.mpd-cart-drawer-items::-webkit-scrollbar {
	width: 5px;
}

.mpd-cart-drawer-items::-webkit-scrollbar-thumb {
	background-color: #cbd5e1;
	border-radius: 3px;
}

/* Single Cart Item */
.mpd-cart-drawer-item {
	display: flex !important;
	align-items: flex-start !important;
	gap: 14px !important;
	padding: 14px 0 !important;
	border-bottom: 1px solid #f1f5f9 !important;
	position: relative !important;
	transition: opacity 0.2s ease !important;
	box-sizing: border-box !important;
}

.mpd-cart-drawer-item:last-child {
	border-bottom: none !important;
}

.mpd-cart-drawer-item.is-updating {
	opacity: 0.5 !important;
	pointer-events: none !important;
}

.mpd-cart-drawer-item-thumb {
	width: 68px !important;
	height: 68px !important;
	min-width: 68px !important;
	max-width: 68px !important;
	flex-shrink: 0 !important;
	border-radius: 6px !important;
	overflow: hidden !important;
	background-color: #f8fafc !important;
	border: 1px solid #edf2f7 !important;
	box-sizing: border-box !important;
}

.mpd-cart-drawer-item-thumb a {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
}

.mpd-cart-drawer-item-thumb img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
}

.mpd-cart-drawer-item-details {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	display: flex !important;
	flex-direction: column !important;
	justify-content: space-between !important;
	gap: 6px !important;
}

.mpd-cart-drawer-item-title-wrap {
	display: flex !important;
	align-items: flex-start !important;
	justify-content: space-between !important;
	gap: 8px !important;
}

.mpd-cart-drawer-item-title {
	font-size: 14px !important;
	font-weight: 600 !important;
	color: #1e293b !important;
	line-height: 1.35 !important;
	text-decoration: none !important;
	word-break: break-word !important;
	display: -webkit-box !important;
	-webkit-line-clamp: 2 !important;
	-webkit-box-orient: vertical !important;
	overflow: hidden !important;
}

.mpd-cart-drawer-item-title:hover {
	color: #2563eb !important;
}

#mpd-cart-drawer button.mpd-cart-drawer-item-remove {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 2px 4px !important;
	margin: -2px 0 0 0 !important;
	font-size: 18px !important;
	line-height: 1 !important;
	color: #94a3b8 !important;
	cursor: pointer !important;
	border-radius: 4px !important;
	transition: color 0.2s ease !important;
	flex-shrink: 0 !important;
	width: auto !important;
	min-width: 0 !important;
	height: auto !important;
}

#mpd-cart-drawer button.mpd-cart-drawer-item-remove:hover {
	color: #ef4444 !important;
	background: transparent !important;
}

.mpd-cart-drawer-item-meta {
	font-size: 12px !important;
	color: #64748b !important;
	margin: 2px 0 4px !important;
}

.mpd-cart-drawer-item-meta dl {
	margin: 0 !important;
}

.mpd-cart-drawer-item-meta dt,
.mpd-cart-drawer-item-meta dd {
	display: inline !important;
	margin: 0 !important;
}

.mpd-cart-drawer-item-meta dd:after {
	content: ', ' !important;
}

.mpd-cart-drawer-item-meta dd:last-child:after {
	content: '' !important;
}

.mpd-cart-drawer-item-footer {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 8px !important;
	margin-top: 4px !important;
}

/* Quantity Spinner */
#mpd-cart-drawer .mpd-cart-drawer-qty-spinner {
	display: inline-flex !important;
	align-items: center !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 4px !important;
	overflow: hidden !important;
	height: 28px !important;
	background-color: #ffffff !important;
	box-sizing: border-box !important;
}

#mpd-cart-drawer button.mpd-qty-btn {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	width: 26px !important;
	min-width: 26px !important;
	max-width: 26px !important;
	height: 100% !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-size: 14px !important;
	line-height: 1 !important;
	color: #475569 !important;
	cursor: pointer !important;
	padding: 0 !important;
	margin: 0 !important;
	transition: background-color 0.15s ease, color 0.15s ease !important;
	user-select: none !important;
	border-radius: 0 !important;
}

#mpd-cart-drawer button.mpd-qty-btn:hover {
	background-color: #f1f5f9 !important;
	color: #0f172a !important;
}

#mpd-cart-drawer input.mpd-qty-input {
	width: 34px !important;
	min-width: 34px !important;
	max-width: 34px !important;
	height: 100% !important;
	border: none !important;
	border-left: 1px solid #e2e8f0 !important;
	border-right: 1px solid #e2e8f0 !important;
	box-shadow: none !important;
	outline: none !important;
	text-align: center !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	color: #0f172a !important;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	-moz-appearance: textfield !important;
	box-sizing: border-box !important;
}

#mpd-cart-drawer input.mpd-qty-input::-webkit-outer-spin-button,
#mpd-cart-drawer input.mpd-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none !important;
	margin: 0 !important;
}

.mpd-cart-drawer-item-price {
	font-size: 14px !important;
	font-weight: 700 !important;
	color: #0f172a !important;
	white-space: nowrap !important;
}

/* Empty State */
.mpd-cart-drawer-empty {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 24px;
	text-align: center;
	box-sizing: border-box;
}

.mpd-cart-drawer-empty-icon {
	font-size: 54px;
	color: #cbd5e1;
	margin-bottom: 16px;
	line-height: 1;
}

.mpd-cart-drawer-empty-text {
	font-size: 15px;
	color: #64748b;
	margin: 0 0 24px;
	line-height: 1.5;
}

.mpd-cart-drawer-empty .mpd-btn-continue-shopping {
	flex: 0 0 auto !important;
	align-self: center !important;
	height: auto !important;
	min-height: 42px !important;
	max-height: 48px !important;
	width: auto !important;
}

/* Drawer Footer & Actions */
.mpd-cart-drawer-footer {
	flex-shrink: 0;
	margin-top: auto;
	padding: 18px 24px 24px;
	border-top: 1px solid #eef0f2;
	background-color: #ffffff;
	box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
	box-sizing: border-box;
}

/* In-Drawer Coupon Box (Pro) */
.mpd-cart-drawer-coupon-wrap {
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 1px dashed #e2e8f0;
}

.mpd-cart-drawer-coupon-form {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.mpd-cart-drawer-coupon-input {
	flex: 1 1 auto;
	height: 38px;
	padding: 0 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
	color: #1e293b;
	background-color: #ffffff;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.mpd-cart-drawer-coupon-input:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.mpd-cart-drawer-apply-coupon {
	flex: 0 0 auto;
	height: 38px;
	padding: 0 16px;
	border: none;
	border-radius: 6px;
	background-color: #0f172a;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.mpd-cart-drawer-apply-coupon:hover {
	background-color: #334155;
}

.mpd-cart-drawer-apply-coupon:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.mpd-cart-drawer-coupon-msg {
	font-size: 12px;
	margin-top: 6px;
	line-height: 1.4;
	font-weight: 500;
}

.mpd-cart-drawer-coupon-msg.is-success {
	color: #16a34a;
}

.mpd-cart-drawer-coupon-msg.is-error {
	color: #dc2626;
}

.mpd-cart-drawer-applied-coupons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.mpd-cart-drawer-coupon-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background-color: #ecfdf5;
	border: 1px solid #a7f3d0;
	color: #065f46;
	padding: 3px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
}

.mpd-cart-drawer-remove-coupon {
	background: none;
	border: none;
	color: #065f46;
	cursor: pointer;
	padding: 0;
	font-size: 14px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
}

.mpd-cart-drawer-remove-coupon:hover {
	color: #dc2626;
}

.mpd-cart-drawer-subtotal-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.mpd-cart-drawer-subtotal-label {
	font-size: 15px;
	font-weight: 600;
	color: #475569;
}

.mpd-cart-drawer-subtotal-val {
	font-size: 18px;
	font-weight: 700;
	color: #0f172a;
}

.mpd-cart-drawer-actions {
	display: flex;
	gap: 10px;
}

.mpd-cart-drawer-actions .mpd-cart-drawer-btn {
	flex: 1 1 0;
	min-width: 0;
}

.mpd-cart-drawer-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 16px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	text-align: center;
	transition: all 0.2s ease;
	cursor: pointer;
	box-sizing: border-box;
}

.mpd-btn-view-cart {
	background-color: #f1f5f9;
	color: #1e293b;
	border: 1px solid #cbd5e1;
}

.mpd-btn-view-cart:hover {
	background-color: #e2e8f0;
	color: #0f172a;
}

.mpd-btn-checkout {
	background-color: #2271b1;
	color: #ffffff;
	border: 1px solid #2271b1;
}

.mpd-btn-checkout:hover {
	background-color: #135e96;
	border-color: #135e96;
	color: #ffffff;
}

.mpd-btn-continue-shopping,
#mpd-cart-drawer .mpd-btn-continue-shopping {
	flex: 0 0 auto !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	background-color: #2271b1;
	color: #ffffff;
	padding: 12px 32px !important;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	height: auto !important;
	min-height: 42px !important;
	max-height: 48px !important;
	width: auto !important;
	align-self: center !important;
	margin: 0 auto;
	box-shadow: 0 2px 6px rgba(34, 113, 177, 0.2);
	transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.mpd-btn-continue-shopping:hover,
#mpd-cart-drawer .mpd-btn-continue-shopping:hover {
	background-color: #135e96;
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

/* Mobile responsive */
@media (max-width: 480px) {
	.mpd-cart-drawer-panel {
		max-width: 100%;
	}

	.mpd-cart-drawer-header,
	.mpd-drawer-shipping-bar-wrap,
	.mpd-cart-drawer-items,
	.mpd-cart-drawer-footer {
		padding-left: 16px;
		padding-right: 16px;
	}

	.mpd-cart-drawer-actions {
		flex-direction: column;
	}
}
