/* Checkout keeps these lightweight; the wider cart product row promotes
   them to compact primary/secondary buttons below. */
.awwly-cart-item-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.woocommerce-cart-form .product-name > .awwly-cart-item-actions {
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.woocommerce-cart-form .awwly-cart-item-actions-sep {
	display: none;
}

.awwly-cart-item-action {
	display: inline-block;
	padding: 0;
	border: none;
	background: none;
	font-size: 13px;
	line-height: 1.4;
	color: #c8272f;
	text-decoration: underline;
	cursor: pointer;
}

.awwly-cart-item-action:hover {
	text-decoration: none;
}

.awwly-cart-item-actions-sep {
	color: #999;
	font-size: 12px;
}

.woocommerce-cart-form .awwly-cart-item-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 7px 12px;
	border: 1px solid #c8272f;
	border-radius: 7px;
	font-family: "Public Sans", sans-serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.woocommerce-cart-form .awwly-cart-item-action.is-edit {
	background: #c8272f;
	color: #fff;
}

.woocommerce-cart-form .awwly-cart-item-action.is-edit:hover,
.woocommerce-cart-form .awwly-cart-item-action.is-edit:focus-visible {
	border-color: #a91f27;
	background: #a91f27;
	color: #fff;
}

.woocommerce-cart-form .awwly-cart-item-action.is-view {
	background: transparent;
	color: #211d1a;
}

.woocommerce-cart-form .awwly-cart-item-action.is-view:hover,
.woocommerce-cart-form .awwly-cart-item-action.is-view:focus-visible {
	background: #efe9e2;
	color: #211d1a;
}

.awwly-cart-auto-update-ready .woocommerce-cart-form button[name="update_cart"] {
	display: none !important;
}

.woocommerce-cart-form.is-updating tbody {
	opacity: 0.55;
	pointer-events: none;
}

.awwly-cart-update-status {
	display: inline-flex;
	align-items: center;
	min-height: 20px;
	margin-left: 12px;
	font-family: "Public Sans", sans-serif;
	font-size: 12px;
	font-weight: 500;
	color: #5f5954;
}

.awwly-cart-update-status.is-updating::before {
	width: 12px;
	height: 12px;
	margin-right: 7px;
	border: 2px solid #ded7d0;
	border-top-color: #c8272f;
	border-radius: 50%;
	content: "";
	animation: awwly-cart-spin 700ms linear infinite;
}

.awwly-cart-update-status.is-success {
	color: #236b35;
}

.awwly-cart-update-status.is-error {
	color: #a91f27;
}

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

/* Woo Blocks normally joins product details with slash separators. Card
   delivery data is easier to verify as a short labelled stack, especially
   on mobile and when a same-envelope explanation is present. */
.awwly-card-metadata .wc-block-components-product-details:not(.awwly-cart-item-actions) {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
}

.awwly-card-metadata .wc-block-components-product-details:not(.awwly-cart-item-actions) > span {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
	line-height: 1.4;
}

.awwly-card-metadata .wc-block-components-product-details:not(.awwly-cart-item-actions) > span::after {
	display: none !important;
	content: none !important;
}

.awwly-card-metadata .wc-block-components-product-details__name {
	font-weight: 600;
}

.awwly-card-metadata .awwly-envelope-detail {
	width: fit-content;
	margin: 3px 0 !important;
	padding: 4px 7px;
	border-radius: 5px;
	background: #edf7ef;
	color: #236b35;
}

/* Give the order summary a simple Cards → Postage → Total hierarchy. One
   visible Postage row contains the combined amount and a quieter per-
   envelope breakdown; the underlying Woo fee rows remain in the DOM. */
.awwly-postage-total {
	align-items: flex-start;
}

.awwly-postage-total .wc-block-components-totals-item__label {
	font-weight: 600;
}

.awwly-postage-total .wc-block-components-totals-item__description {
	width: 100%;
	margin-top: -2px;
	color: #52606d;
	font-size: 12px;
	line-height: 1.45;
}

.awwly-postage-total-suppressed {
	display: none !important;
}

/* Coupon Discounts for Postage (Phase E) §7.5 — the negative amount itself
   (already rendered with its "-" sign, not colour alone) plus a distinct
   label weight/icon glyph so the row reads as a discount without relying
   on colour to carry that meaning. */
.awwly-postage-discount-total {
	align-items: flex-start;
}

.awwly-postage-discount-total .wc-block-components-totals-item__label {
	font-weight: 600;
}

.awwly-postage-discount-total .wc-block-components-totals-item__label::before {
	content: '−';
	margin-right: 4px;
}

.awwly-postage-discount-total .wc-block-components-totals-item__description {
	width: 100%;
	margin-top: -2px;
	color: #52606d;
	font-size: 12px;
	line-height: 1.45;
}

.awwly-postage-breakdown {
	display: grid;
	gap: 4px;
	width: 100%;
}

.awwly-postage-breakdown-row {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) auto;
	gap: 12px;
}

.awwly-postage-breakdown-label {
	min-width: 0;
}

.awwly-postage-breakdown-amount {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

@media ( max-width: 600px ) {
	/* The active theme makes Woo's checkout CTA fixed on small screens. It
	   covered the second card's delivery details and appeared before the
	   same-envelope total in the visual reading order. Keep it in normal
	   flow for personalised-card carts so the customer reviews the saving
	   before continuing. */
	.wc-block-cart__submit-container--sticky {
		position: static !important;
		inset: auto !important;
		box-shadow: none !important;
	}
}

.awwly-lightbox-backdrop {
	position: fixed;
	inset: 0;
	z-index: 100002;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 0, 0, 0, 0.75 );
	padding: 20px;
}

.awwly-lightbox-img {
	max-width: 100%;
	max-height: 90vh;
	border-radius: 4px;
	box-shadow: 0 8px 32px rgba( 0, 0, 0, 0.4 );
}

.awwly-lightbox-close {
	position: fixed;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: rgba( 255, 255, 255, 0.9 );
	font-size: 18px;
	cursor: pointer;
}

.awwly-lightbox-nav {
	position: fixed;
	top: 50%;
	transform: translateY( -50% );
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: rgba( 255, 255, 255, 0.9 );
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.awwly-lightbox-prev {
	left: 16px;
}

.awwly-lightbox-next {
	right: 16px;
}

.awwly-lightbox-counter {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX( -50% );
	background: rgba( 0, 0, 0, 0.6 );
	color: #fff;
	font-size: 13px;
	padding: 4px 12px;
	border-radius: 12px;
}
