/**
 * Intrinsic Blue — Cart Page
 */

.ib-cart-page__intro {
	max-width: var(--ib-container-max);
	margin: var(--ib-space-6) auto 0;
	padding: 0 var(--ib-container-pad);
}

.ib-cart-page__intro .ib-heading-display {
	margin-bottom: var(--ib-space-2);
}

.ib-cart-page__subtext {
	color: var(--ib-text-muted);
	font-size: 15px;
	margin: 0;
}

.ib-cart-page {
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: var(--ib-space-6);
	align-items: start;
	max-width: var(--ib-container-max);
	margin: var(--ib-space-6) auto var(--ib-space-16);
	padding: 0 var(--ib-container-pad);
}

.ib-cart-page__items {
	display: flex;
	flex-direction: column;
	gap: var(--ib-space-4);
}

/* ---------- Cart Item Card ---------- */
.ib-cart-item {
	display: grid;
	grid-template-columns: 72px 1fr auto auto auto;
	align-items: center;
	gap: var(--ib-space-4);
	background: var(--ib-bg-surface);
	border: 1px solid var(--ib-border-subtle);
	border-radius: var(--ib-radius-md);
	padding: var(--ib-space-4);
}

.ib-cart-item__media {
	width: 72px;
	height: 72px;
	border-radius: var(--ib-radius-sm);
	overflow: hidden;
	background: var(--ib-bg-surface-alt);
	flex-shrink: 0;
}

.ib-cart-item__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ib-cart-item__info {
	min-width: 0;
}

.ib-cart-item__name {
	font-size: 15px;
	font-weight: 600;
	color: var(--ib-text-primary);
	margin: 2px 0 4px;
}

.ib-cart-item__name a {
	color: inherit;
}

.ib-cart-item__unit-price {
	font-size: 13px;
	color: var(--ib-accent-end);
}

.ib-cart-item__qty .quantity {
	margin: 0;
}

.ib-cart-item__subtotal {
	font-size: 16px;
	font-weight: 700;
	color: var(--ib-text-primary);
	white-space: nowrap;
}

.ib-cart-item__remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	flex-shrink: 0;
	transition: transform var(--ib-transition-fast), filter var(--ib-transition-fast);
}

.ib-cart-item__remove img {
	display: block;
	width: 32px;
	height: 32px;
	max-width: none;
}

.ib-cart-item__remove:hover {
	background: transparent;
	transform: scale(1.05);
	filter: brightness(1.08);
}

.ib-cart-item__remove:focus-visible {
	outline: 2px solid #ff4b4b;
	outline-offset: 3px;
}

.ib-cart-page__continue {
	display: inline-flex;
	align-items: center;
	gap: var(--ib-space-2);
	color: var(--ib-accent-end);
	font-size: 14px;
	font-weight: 500;
	margin-top: var(--ib-space-2);
	width: fit-content;
}

.ib-cart-page__continue:hover {
	color: var(--ib-text-primary);
}

/* WooCommerce prints an empty-cart notice via woocommerce_cart_is_empty template
   when the loop above has nothing — retheme it instead of hardcoding empty state copy. */
.ib-cart-page__items .cart-empty,
.ib-cart-page__items .return-to-shop {
	color: var(--ib-text-secondary);
}

.ib-cart-page__items .return-to-shop .button {
	margin-top: var(--ib-space-3);
}

/* Visually hide the real "Update cart" submit button — it's still a
   functional part of the form, just auto-triggered by cart.js instead
   of requiring a visible click, per the Figma stepper UX. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

/* ---------- Order Summary ---------- */
.ib-order-summary {
	background: var(--ib-bg-surface);
	border: 1px solid var(--ib-border-subtle);
	border-radius: var(--ib-radius-md);
	padding: var(--ib-space-6);
	position: sticky;
	top: var(--ib-space-6);
}

.ib-order-summary .ib-heading-display {
	margin-bottom: var(--ib-space-4);
}

.ib-order-summary__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
	color: var(--ib-text-muted);
	margin-bottom: var(--ib-space-3);
}

.ib-order-summary__row strong {
	color: var(--ib-text-primary);
	font-weight: 600;
}

.ib-order-summary__row--shipping .woocommerce-Price-amount {
	color: var(--ib-success);
	font-weight: 600;
}

.ib-order-summary__row--shipping ul#shipping_method {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: right;
}

.ib-order-summary__row--coupon strong a {
	color: var(--ib-error);
	margin-left: var(--ib-space-2);
}

.ib-order-summary__coupon {
	display: flex;
	gap: var(--ib-space-2);
	margin: var(--ib-space-4) 0;
}

.ib-order-summary__coupon .ib-input {
	flex: 1;
}

.ib-order-summary__divider {
	height: 1px;
	background: var(--ib-border-subtle);
	margin: var(--ib-space-4) 0;
}

.ib-order-summary__total {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--ib-space-5);
}

.ib-order-summary__total span {
	font-size: 15px;
	font-weight: 600;
	color: var(--ib-text-primary);
}

.ib-order-summary__total strong {
	font-size: 22px;
	color: var(--ib-price-color);
}

.ib-order-summary__checkout-btn {
	display: flex;
}

.ib-order-summary__payment-badges {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ib-space-2);
	margin-top: var(--ib-space-5);
}

.ib-payment-badge {
	font-size: 11px;
	font-weight: 600;
	color: var(--ib-text-muted);
	background: var(--ib-bg-surface-alt);
	border: 1px solid var(--ib-border-subtle);
	border-radius: var(--ib-radius-sm);
	padding: 5px 10px;
}

.ib-payment-badge--icon img {
	height: 18px;
	display: block;
}

@media (max-width: 991px) {
	.ib-cart-page {
		grid-template-columns: 1fr;
	}

	.ib-cart-item {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}

	.ib-cart-item__media {
		width: 60px;
		height: 60px;
	}

	.ib-cart-item__info {
		flex: 1;
		min-width: 140px;
	}

	.ib-cart-item__qty {
		order: 4;
		margin-top: var(--ib-space-3);
	}

	.ib-cart-item__subtotal {
		order: 5;
		margin-top: var(--ib-space-3);
		margin-left: auto;
	}

	.ib-order-summary {
		position: static;
	}
}

/* Astra's default page title is not part of the approved cart design. */
body.woocommerce-cart .entry-header,
body.woocommerce-cart .entry-title {
	display: none !important;
}

body.woocommerce-cart,
body.woocommerce-cart #page,
body.woocommerce-cart .site-content,
body.woocommerce-cart .ast-container,
body.woocommerce-cart #primary,
body.woocommerce-cart .site-main,
body.woocommerce-cart article,
body.woocommerce-cart .entry-content {
	background: #0A0C16 !important;
}

/* v2.5 — lock the Figma remove control to its own 32px grid slot.
   Astra/WooCommerce ship high-specificity a.remove rules (font-size,
   line-height, hover background) which can otherwise distort the supplied
   SVG. Rendering it as a background layer keeps the exact artwork intact. */
body.woocommerce-cart .woocommerce .ib-cart-item {
	grid-template-columns: 72px minmax(0, 1fr) auto auto 32px;
}

body.woocommerce-cart .woocommerce a.ib-cart-item__remove.remove,
body.woocommerce-cart a.ib-cart-item__remove.remove {
	position: static !important;
	inset: auto !important;
	display: grid !important;
	place-items: center !important;
	width: 32px !important;
	min-width: 32px !important;
	max-width: 32px !important;
	height: 32px !important;
	min-height: 32px !important;
	max-height: 32px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	box-shadow: none !important;
	font-size: 0 !important;
	line-height: 0 !important;
	text-indent: 0 !important;
	text-decoration: none !important;
	overflow: visible !important;
	justify-self: end;
	align-self: center;
}

body.woocommerce-cart .woocommerce a.ib-cart-item__remove.remove:hover,
body.woocommerce-cart .woocommerce a.ib-cart-item__remove.remove:focus,
body.woocommerce-cart a.ib-cart-item__remove.remove:hover,
body.woocommerce-cart a.ib-cart-item__remove.remove:focus {
	background: transparent !important;
	color: inherit !important;
}

.ib-cart-item__remove-icon {
	display: block;
	width: 32px;
	height: 32px;
	background: url('../images/remove-btn.svg') center / 32px 32px no-repeat;
	pointer-events: none;
}

@media (max-width: 991px) {
	body.woocommerce-cart .woocommerce .ib-cart-item {
		display: grid;
		grid-template-columns: 60px minmax(0,1fr) 32px;
		grid-template-areas:
			"media info remove"
			"qty qty subtotal";
		column-gap: 14px;
		row-gap: 12px;
	}
	.ib-cart-item__media { grid-area: media; }
	.ib-cart-item__info { grid-area: info; min-width: 0; }
	.ib-cart-item__remove { grid-area: remove; }
	.ib-cart-item__qty { grid-area: qty; margin-top: 0; }
	.ib-cart-item__subtotal { grid-area: subtotal; margin: 0; justify-self: end; }
}
