/* Feedback states layered on top of Khulna Social / Marketplace's own
   cart button styling — this plugin never redefines their base look,
   only adds a transient "added" flash and a busy/disabled state. */

.kac-busy {
	opacity: 0.6;
	pointer-events: none;
}

.kac-added {
	animation: kac-pop 0.3s ease;
}

.kac-added .dashicons,
.kac-added.dashicons {
	color: #10B981 !important;
}

@keyframes kac-pop {
	0% {
		transform: scale( 1 );
	}
	50% {
		transform: scale( 1.25 );
	}
	100% {
		transform: scale( 1 );
	}
}

/* Item-count badge injected onto the menu bar's "Cart" link. */
#kmb-nav a {
	position: relative;
}

.kac-badge {
	position: absolute;
	top: 2px;
	right: 10px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 999px;
	background: #EF4444;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
}

/* ---------------- [khulna_cart] page ---------------- */

.kac-cart-page {
	max-width: 720px;
	margin: 0 auto;
}

.kac-cart-title {
	margin-bottom: 16px;
}

.kac-cart-empty,
.kac-cart-login-notice {
	color: #6B7280;
	padding: 24px 0;
}

.kac-cart-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #E5E7EB;
}

.kac-cart-item-image {
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	border-radius: 8px;
	overflow: hidden;
	background: #F3F4F6;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kac-cart-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Main column: full title on its own row (right up to the delete
   button), price/qty/total on the row below. Using min-width: 0 here
   (and on the name itself) is what lets the flex item shrink instead
   of pushing the delete button off — without it long titles would
   force the row wider than the card. */
.kac-cart-item-main {
	flex: 1;
	min-width: 0;
}

.kac-cart-item-top {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.kac-cart-item-name {
	flex: 1;
	min-width: 0;
	font-weight: 600;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: break-word;
}

.kac-cart-item-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin-top: 6px;
}

.kac-cart-item-price {
	font-size: 13px;
	color: #6B7280;
}

.kac-cart-item-qty {
	display: flex;
	align-items: center;
	gap: 8px;
}

.kac-qty-btn {
	width: 26px;
	height: 26px;
	border: none;
	background: none;
	color: #1D4ED8;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	line-height: 1;
	padding: 0;
}

.kac-cart-item-total {
	margin-left: auto;
	text-align: right;
	font-weight: 700;
	color: #1D4ED8;
}

.kac-remove-btn {
	flex-shrink: 0;
	background: none;
	border: none;
	cursor: pointer;
	color: #EF4444;
	padding: 2px;
}

.kac-cart-summary {
	display: flex;
	justify-content: space-between;
	padding: 16px 0;
	font-size: 18px;
	font-weight: 700;
}

.kac-checkout-notice {
	background: #FFFBEB;
	border: 1px solid #FDE68A;
	color: #92400E;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 13px;
	margin: 8px 0;
}

.kac-note-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	margin: 12px 0 6px;
}

.kac-order-note {
	width: 100%;
	resize: vertical;
	border: 1px solid #D1D5DB;
	border-radius: 8px;
	padding: 8px 10px;
	font-family: inherit;
	font-size: 13px;
	box-sizing: border-box;
}

.kac-checkout-btn {
	width: 100%;
	padding: 12px;
	border: none;
	border-radius: 8px;
	background: #1D4ED8;
	color: #fff;
	font-weight: 700;
	cursor: pointer;
	margin-top: 12px;
}

.kac-checkout-btn.kac-busy {
	opacity: 0.6;
	pointer-events: none;
}

/* ---------------- Tabs ---------------- */

.kac-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid #E5E7EB;
	margin-bottom: 20px;
}

.kac-tab-btn {
	position: relative;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 10px 14px;
	font-size: 14px;
	font-weight: 600;
	color: #6B7280;
	cursor: pointer;
}

.kac-tab-btn.is-active {
	color: #1D4ED8;
	border-bottom-color: #1D4ED8;
}

.kac-tab-badge {
	display: inline-block;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	margin-left: 4px;
	border-radius: 999px;
	background: #EF4444;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	vertical-align: middle;
}

.kac-orders-empty {
	color: #6B7280;
	padding: 24px 0;
}

/* ---------------- Order cards ---------------- */

.kac-orders-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.kac-order-card {
	border: 1px solid #E5E7EB;
	border-radius: 10px;
	padding: 14px;
}

.kac-order-card.kac-busy {
	opacity: 0.6;
}

.kac-order-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}

.kac-order-no {
	font-weight: 700;
	font-family: monospace;
	font-size: 13px;
	color: #374151;
}

.kac-order-status {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 3px 8px;
	border-radius: 999px;
}

.kac-status-pending {
	background: #FEF3C7;
	color: #92400E;
}

.kac-status-accepted {
	background: #DBEAFE;
	color: #1E40AF;
}

.kac-status-shipped {
	background: #E0E7FF;
	color: #3730A3;
}

.kac-status-delivered {
	background: #D1FAE5;
	color: #065F46;
}

.kac-status-cancelled {
	background: #FEE2E2;
	color: #991B1B;
}

.kac-order-meta {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	color: #6B7280;
	margin-bottom: 8px;
}

.kac-order-shipping {
	background: #F9FAFB;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
	color: #374151;
	margin-bottom: 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.kac-order-shipping .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	vertical-align: middle;
	color: #9CA3AF;
}

.kac-order-note-text {
	font-style: italic;
}

.kac-order-dispatched {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12.5px;
	font-weight: 600;
	color: #0B57D0;
	background: #E8F1FF;
	border-radius: 8px;
	padding: 6px 10px;
	margin-bottom: 10px;
}

.kac-order-dispatched .dashicons {
	font-size: 15px;
	width: 15px;
	height: 15px;
}

.kac-delivery-tracking {
	background: #E8F1FF;
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 10px;
}

.kac-delivery-tracking.kac-delivery-payment_collected,
.kac-delivery-tracking.kac-delivery-closed {
	background: #EAF7EE;
}

.kac-dt-msg {
	margin: 0 0 4px;
	font-size: 12.5px;
	font-weight: 600;
	color: #142845;
}

.kac-dt-sub {
	margin: 0;
	font-size: 11.5px;
	color: #56617a;
}

.kac-dt-thankyou,
.kac-dt-done {
	color: #1a7a3c;
}

.kac-dt-searching {
	display: flex;
	align-items: center;
	gap: 8px;
}

.kac-dt-spinner {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid #b7d3fb;
	border-top-color: #0B57D0;
	animation: kac-dt-spin 0.8s linear infinite;
	flex: 0 0 auto;
}

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

.kac-dt-rider {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.kac-dt-rider-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
}

.kac-dt-rider-avatar-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #d7e6fb;
	color: #0B57D0;
	font-size: 18px;
}

.kac-dt-rider-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 11.5px;
	color: #56617a;
}

.kac-dt-rider-name {
	font-size: 13px;
	font-weight: 700;
	color: #142845;
}

.kac-dt-rider-phone .dashicons,
.kac-dt-rider-location .dashicons {
	font-size: 13px;
	width: 13px;
	height: 13px;
	vertical-align: text-bottom;
}

.kac-dt-countdown {
	font-size: 12px;
	color: #b3273e;
	margin: 4px 0 0;
}

.kac-dt-countdown-value {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.kac-delivery-tracking .kac-order-btn {
	width: 100%;
	margin-top: 8px;
}

.kac-order-items {
	border-top: 1px solid #F3F4F6;
	border-bottom: 1px solid #F3F4F6;
	padding: 8px 0;
	margin-bottom: 10px;
}

.kac-order-line {
	display: flex;
	gap: 8px;
	font-size: 13px;
	padding: 3px 0;
}

.kac-order-line-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.kac-order-line-qty {
	color: #6B7280;
}

.kac-order-line-total {
	min-width: 70px;
	text-align: right;
	font-weight: 600;
}

.kac-order-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.kac-order-subtotal {
	font-size: 14px;
}

.kac-order-cod {
	color: #9CA3AF;
	font-size: 12px;
}

.kac-order-actions {
	display: flex;
	gap: 8px;
}

.kac-order-btn {
	border: none;
	border-radius: 6px;
	padding: 7px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.kac-order-btn-primary {
	background: #1D4ED8;
	color: #fff;
}

.kac-order-btn-danger {
	background: #FEE2E2;
	color: #991B1B;
}
