/* DP Cart Builder — structural base styles.
   Intentionally minimal: layout, states, and loaders only. All visual styling
   (colors, spacing, borders, typography) is driven by the Bricks controls so
   users can design freely. */

/* Wrapper ------------------------------------------------------------------ */
.dp-cart-items {
	display: flex;
	flex-direction: column;
	gap: 16px;
	position: relative;
}

.dp-cart-items.dp-cart--loading {
	opacity: 0.6;
	pointer-events: none;
}

.dp-cart-empty {
	text-align: center;
	padding: 24px 8px;
	opacity: 0.8;
}

/* Item --------------------------------------------------------------------- */
.dp-cart-item {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	transition: opacity 0.2s ease;
}

.dp-cart-item--removing {
	opacity: 0.45;
	pointer-events: none;
}

/* Image -------------------------------------------------------------------- */
.dp-cart-item-image img {
	display: block;
	height: auto;
	max-width: 100%;
	object-fit: cover;
}

/* Name --------------------------------------------------------------------- */
.dp-cart-item-name a {
	text-decoration: none;
	color: inherit;
}
.dp-cart-item-name a:hover {
	text-decoration: underline;
}

/* Attributes & meta -------------------------------------------------------- */
.dp-cart-item-attributes,
.dp-cart-item-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 0.85em;
}
.dp-cart-attr,
.dp-cart-meta-row {
	line-height: 1.4;
}

/* Quantity ----------------------------------------------------------------- */
.dp-cart-qty-box {
	display: inline-flex;
	align-items: center;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	overflow: hidden;
}
.dp-cart-qty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 32px;
	border: 0;
	background: transparent;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	color: inherit;
	padding: 0;
}
.dp-cart-qty-btn:hover {
	background: rgba(0, 0, 0, 0.05);
}
.dp-cart-qty-input {
	width: 40px;
	height: 32px;
	text-align: center;
	border: 0;
	background: transparent;
	font: inherit;
	color: inherit;
	-moz-appearance: textfield;
	appearance: textfield;
}
.dp-cart-qty-input::-webkit-outer-spin-button,
.dp-cart-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.dp-cart-qty-input[readonly] {
	cursor: default;
}
/* Subtle highlight when a quantity is changed but not yet saved. */
.dp-cart-qty-input.dp-cart-qty--changed {
	font-weight: 600;
}

/* Price -------------------------------------------------------------------- */
.dp-cart-item-price {
	white-space: nowrap;
}

/* Remove ------------------------------------------------------------------- */
.dp-cart-item-remove {
	display: inline-flex;
}
.dp-cart-remove {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 0;
	background: transparent;
	cursor: pointer;
	color: inherit;
	font: inherit;
	line-height: 1;
	padding: 4px;
	transition: opacity 0.15s ease;
}
.dp-cart-remove[disabled] {
	cursor: default;
	opacity: 0.5;
}
.dp-cart-remove--loading .dp-cart-remove-icon,
.dp-cart-remove--loading .dp-cart-remove-text {
	visibility: hidden;
}
.dp-cart-remove--loading .dp-cart-remove-loader,
.dp-cart-update-btn--loading .dp-cart-update-loader {
	display: inline-block !important;
}
.dp-cart-remove-loader[hidden],
.dp-cart-update-loader[hidden] {
	display: none;
}

/* Totals ------------------------------------------------------------------- */
.dp-cart-total {
	display: flex;
	gap: 8px;
	align-items: baseline;
}
.dp-cart-total--split {
	justify-content: space-between;
}
.dp-cart-total--stack {
	flex-direction: column;
	gap: 2px;
}

/* Update button ------------------------------------------------------------ */
.dp-cart-update-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 0;
	cursor: pointer;
	background: #202020;
	color: #fff;
	padding: 12px 20px;
	border-radius: 8px;
	font: inherit;
	transition: background 0.2s ease, opacity 0.2s ease;
}
.dp-cart-update-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}
.dp-cart-update-btn--loading {
	cursor: progress;
}

/* Shared spinner ----------------------------------------------------------- */
.dp-cart-remove-loader,
.dp-cart-update-loader {
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: dp-cart-spin 0.6s linear infinite;
}
.dp-cart-remove-loader {
	position: absolute;
}
.dp-cart-item-remove {
	position: relative;
}

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