/* ── ABW Mini Cart ──────────────────────────────────────────────────────────── */

/* Trigger */
.abw-mini-cart {
	display: inline-flex;
	align-items: center;
}

.abw-mc-trigger {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	color: inherit;
	line-height: 1;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.abw-mc-trigger-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.abw-mc-trigger-icon i,
.abw-mc-trigger-icon svg {
	display: block;
}

.abw-mc-count {
	position: absolute;
	top: -6px;
	right: -8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background-color: #000;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	pointer-events: none;
	transition: transform 0.2s ease;
}

.abw-mc-count.is-bumped {
	animation: abw-mc-bump 0.3s ease;
}

@keyframes abw-mc-bump {
	0%   { transform: scale(1); }
	50%  { transform: scale(1.4); }
	100% { transform: scale(1); }
}

.abw-mc-trigger-subtotal {
	font-size: 14px;
}

/* Overlay */
.abw-mc-overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background-color: rgba(0, 0, 0, 0.4);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.abw-mc-overlay.is-visible {
	opacity: 1;
	pointer-events: auto;
}

/* Drawer */
.abw-mc-drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	z-index: 99999;
	width: 420px;
	max-width: 100vw;
	background-color: #fff;
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
	display: flex;
	flex-direction: column;
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

.abw-mc-drawer--right {
	right: 0;
	transform: translateX(100%);
}

.abw-mc-drawer--left {
	left: 0;
	transform: translateX(-100%);
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.abw-mc-drawer.is-open {
	transform: translateX(0);
}

[hidden].abw-mc-drawer {
	display: flex !important; /* keep in flow so CSS transition works */
	visibility: hidden;
	pointer-events: none;
}

.abw-mc-drawer.is-open[hidden] {
	visibility: visible;
	pointer-events: auto;
}

.abw-mc-drawer-inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 24px;
	overflow: hidden;
}

/* Header */
.abw-mc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 16px;
	border-bottom: 1px solid #e5e5e5;
	flex-shrink: 0;
}

.abw-mc-header-title {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
}

.abw-mc-close {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	padding: 6px;
	color: inherit;
	transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
	line-height: 1;
}

.abw-mc-close:hover {
	opacity: 0.8;
}

/* Body */
.abw-mc-body {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 16px 0;
	scrollbar-width: thin;
	scrollbar-color: #ccc transparent;
}

.abw-mc-body::-webkit-scrollbar {
	width: 4px;
}

.abw-mc-body::-webkit-scrollbar-track {
	background: transparent;
}

.abw-mc-body::-webkit-scrollbar-thumb {
	background-color: #ccc;
	border-radius: 2px;
}

/* Loading */
.abw-mc-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 32px 0;
}

[hidden].abw-mc-loading {
	display: none !important;
}

.abw-mc-loading-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: #999;
	animation: abw-mc-bounce 1.2s infinite ease-in-out;
}

.abw-mc-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.abw-mc-loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes abw-mc-bounce {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
	40%            { transform: scale(1);   opacity: 1; }
}

/* Empty state */
.abw-mc-empty {
	text-align: center;
	padding: 32px 0;
	color: #777;
	font-size: 14px;
	margin: 0;
}

/* Items list */
.abw-mc-items {
	display: flex;
	flex-direction: column;
}

.abw-mc-item {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 14px;
	align-items: flex-start;
	padding-top: 0;
}

.abw-mc-item + .abw-mc-item {
	border-top: 1px solid #e5e5e5;
	padding-top: 20px;
	margin-top: 20px;
}

/* Product image */
.abw-mc-item-image {
	display: block;
	width: 80px;
	height: 80px;
	flex-shrink: 0;
	overflow: hidden;
}

.abw-mc-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Product info */
.abw-mc-item-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.abw-mc-item-name {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
}

.abw-mc-item-name a {
	text-decoration: none;
	color: inherit;
}

.abw-mc-item-name a:hover {
	text-decoration: underline;
}

.abw-mc-item-meta {
	font-size: 12px;
	color: #777;
	line-height: 1.3;
}

.abw-mc-item-row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 4px;
}

.abw-mc-item-price {
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
}

/* Quantity controls */
.abw-mc-qty-wrap {
	display: inline-flex;
	align-items: center;
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
	height: 30px;
}

.abw-mc-qty-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0 8px;
	font-size: 16px;
	line-height: 1;
	color: inherit;
	height: 100%;
	display: flex;
	align-items: center;
	flex-shrink: 0;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.abw-mc-qty-input {
	width: 32px;
	border: none;
	border-left: 1px solid #ddd;
	border-right: 1px solid #ddd;
	text-align: center;
	font-size: 13px;
	height: 100%;
	padding: 0;
	-moz-appearance: textfield;
	background: transparent;
	color: inherit;
}

.abw-mc-qty-input::-webkit-outer-spin-button,
.abw-mc-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Remove button */
.abw-mc-item-remove {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 11px;
	color: #999;
	padding: 4px 6px;
	text-decoration: none;
	transition: color 0.2s ease;
	white-space: nowrap;
	align-self: flex-start;
}

.abw-mc-item-remove:hover,
.abw-mc-item-remove:focus,
.abw-mc-item-remove:active {
	background: transparent !important;
	outline: none;
	opacity: 1;
}

/* Item updating overlay */
.abw-mc-item.is-updating {
	opacity: 0.4;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* Footer */
.abw-mc-footer {
	border-top: 1px solid #e5e5e5;
	padding-top: 16px;
	flex-shrink: 0;
}

[hidden].abw-mc-footer {
	display: none !important;
}

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

.abw-mc-subtotal-label {
	font-size: 14px;
}

.abw-mc-subtotal-value {
	font-size: 16px;
	font-weight: 600;
}

.abw-mc-footer-btns {
	display: flex;
	gap: 10px;
}

.abw-mc-btn-view,
.abw-mc-btn-checkout {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	border: 1px solid currentColor;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
	line-height: 1.2;
}

.abw-mc-btn-view {
	background-color: transparent;
	color: #000;
	border-color: #000;
}

.abw-mc-btn-view:hover {
	background-color: #000;
	color: #fff;
}

.abw-mc-btn-checkout {
	background-color: #000;
	color: #fff;
	border-color: #000;
}

.abw-mc-btn-checkout:hover {
	opacity: 0.8;
}

/* Mobile adjustments */
@media (max-width: 767px) {
	.abw-mc-item-row {
		flex-wrap: nowrap;
		align-items: center;
		gap: 6px;
	}

	.abw-mc-qty-wrap {
		height: 28px;
		flex: none;
		width: auto;
	}

	.abw-mc-qty-btn {
		padding: 0 5px;
		font-size: 14px;
		flex: none;
		flex-shrink: 0;
	}

	.abw-mc-qty-input {
		flex: none !important;
		width: 52px !important;
		max-width: 52px !important;
		min-width: 0 !important;
		font-size: 13px;
	}

	.abw-mc-item-price {
		font-size: 13px;
		white-space: nowrap;
		flex: none;
	}
}

/* Body scroll lock when drawer open */
body.abw-mc-open {
	overflow: hidden;
}

/* Focus trap outline */
.abw-mc-drawer:focus {
	outline: none;
}
