/*
 * Basket page (Paul, 2026-10-21). Enqueued on the basket only, by
 * functions/basketLayout.php.
 *
 * Quantity is always 1, so the Quantity and Subtotal columns go and the item's
 * fields (Buying As, To, From, Message, …) spread across the freed width as
 * label/value pairs, two pairs to a row. The thumbnail is the chosen design's
 * card artwork at the card's ratio.
 *
 * The quantity cell is only hidden: its hidden input still posts with
 * "Update basket" (miscFunctions.php, disable_cart_item_quantity()).
 */

.woocommerce-cart .woocommerce table.shop_table.cart {
	--wv-basket-card-w: 108px; /* 180 less 40% (Paul) */
	--wv-basket-card-aspect: 1.595; /* --gcp-card-aspect */
}

.woocommerce-cart .woocommerce table.shop_table.cart .product-quantity,
.woocommerce-cart .woocommerce table.shop_table.cart .product-subtotal {
	display: none;
}

.woocommerce-cart .woocommerce table.shop_table.cart th.product-remove,
.woocommerce-cart .woocommerce table.shop_table.cart td.product-remove {
	width: 48px;
}

.woocommerce-cart .woocommerce table.shop_table.cart th.product-thumbnail,
.woocommerce-cart .woocommerce table.shop_table.cart td.product-thumbnail {
	width: calc(var(--wv-basket-card-w) + 1.6em);
}

.woocommerce-cart .woocommerce table.shop_table.cart th.product-price,
.woocommerce-cart .woocommerce table.shop_table.cart td.product-price {
	width: 120px;
	text-align: right;
}

/* The card sits in the middle of the row's height (Paul); the fields start at
   the top. */
.woocommerce-cart .woocommerce table.shop_table.cart td.product-thumbnail {
	vertical-align: middle;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-name {
	vertical-align: top;
}

/* The × in the circle. Centred by flex rather than OceanWP's line-height, so
   it stays centred whatever alignment the cell has — on phones the cell is
   right-aligned and the × used to follow it. */
.woocommerce-cart .woocommerce table.shop_table.cart a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	line-height: 1;
}

/* The card: the chosen design, or the product image for anything else — both
   at the card's ratio, cropped to fill rather than letterboxed. The radius
   matches the wallet's card artwork. */
.woocommerce-cart .woocommerce table.shop_table.cart td.product-thumbnail img {
	display: block;
	width: var(--wv-basket-card-w);
	max-width: 100%;
	height: auto;
	aspect-ratio: var(--wv-basket-card-aspect);
	object-fit: cover;
	border-radius: 3.5% / 5.6%;
	margin: 0;
}

/* The fields: dt/dd pairs, two pairs to a row. */
.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr);
	gap: 6px 12px;
	align-items: baseline;
	margin: 10px 0 0;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation dt,
.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation dd {
	float: none;
	clear: none;
	margin: 0;
	padding: 0;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation dt {
	font-weight: 600;
}

/* Values are typed text — an email address or a message — not titles. */
.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation dd {
	text-transform: none;
	overflow-wrap: anywhere;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation dd p {
	margin: 0;
}

/* The message can be long: it gets a row of its own, full width. */
.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation dt.variation-Message {
	grid-column: 1;
}

.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation dd.variation-Message {
	grid-column: 2 / -1;
}

/* Mid widths: one pair to a row once two no longer fit beside the card. */
@media only screen and (max-width: 1100px) {
	.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation {
		grid-template-columns: max-content minmax(0, 1fr);
	}

	.woocommerce-cart .woocommerce table.shop_table.cart td.product-name dl.variation dd.variation-Message {
		grid-column: 2;
	}
}

/* Phones: OceanWP stacks each cell as a full-width row with its column title
   before it. The card sits on top, full width, then the name and fields left
   aligned, then the price. */
@media only screen and (max-width: 767px) {
	.woocommerce-cart .woocommerce table.shop_table.cart td.product-remove,
	.woocommerce-cart .woocommerce table.shop_table.cart td.product-thumbnail,
	.woocommerce-cart .woocommerce table.shop_table.cart td.product-price {
		width: 100%;
	}

	.woocommerce-cart .woocommerce table.shop_table.cart td.product-remove {
		text-align: right !important;
		padding-bottom: 0;
	}

	.woocommerce-cart .woocommerce table.shop_table.cart td.product-thumbnail {
		display: block;
	}

	.woocommerce-cart .woocommerce table.shop_table.cart td.product-thumbnail img {
		/* 100% / 320 less 40% (Paul) */
		width: 60%;
		max-width: 192px;
		margin: 0 auto;
	}

	.woocommerce-cart .woocommerce table.shop_table.cart td.product-name {
		text-align: left;
	}

	/* "Product:" before the name adds nothing under the card. */
	.woocommerce-cart .woocommerce table.shop_table.cart td.product-name:before {
		display: none;
	}
}

/* ── More than 10 items: "Show N more" (functions/basketLayout.php) ──────── */

/* Without :has() support this never applies and every item shows. */
.woocommerce-cart table.shop_table.cart:has(#wv-basket-more-toggle:not(:checked)) tr.wv-basket-more-item {
	display: none;
}

.woocommerce-cart .woocommerce table.shop_table.cart tr.wv-basket-more td {
	text-align: center;
}

/* Phones: OceanWP puts each cell's column title before it; this cell has none. */
.woocommerce-cart .woocommerce table.shop_table.cart tr.wv-basket-more td::before {
	display: none;
}

.wv-basket-more__toggle {
	display: inline-flex;
	align-items: center;
	margin: 0;
	cursor: pointer;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-transform: none;
}

/* Visually hidden, still focusable and announced. */
.wv-basket-more__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.wv-basket-more__show::after,
.wv-basket-more__hide::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-left: 8px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-3px) rotate(45deg);
}

.wv-basket-more__hide::after {
	transform: translateY(0) rotate(-135deg);
}

.wv-basket-more__hide,
.wv-basket-more__input:checked ~ .wv-basket-more__show {
	display: none;
}

.wv-basket-more__input:checked ~ .wv-basket-more__hide {
	display: inline;
}

.wv-basket-more__toggle:has(.wv-basket-more__input:focus-visible) {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* ── "Clear basket" and its confirmation window (functions/basketLayout.php) ─ */

.woocommerce-cart .woocommerce table.shop_table.cart td.actions .wv-basket-clear {
	float: right;
	margin-right: 10px;
}

@media only screen and (max-width: 767px) {
	.woocommerce-cart .woocommerce table.shop_table.cart td.actions .wv-basket-clear {
		float: none;
		display: block;
		width: 100%;
		margin: 10px 0 0;
	}
}

.wv-basket-dialog {
	width: calc(100% - 32px);
	max-width: 380px;
	padding: 0;
	border: 0;
	border-radius: 20px;
	background: var(--wv-white, #fff);
	color: var(--wv-ink, #101011);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.wv-basket-dialog::backdrop {
	background: rgba(16, 16, 17, 0.45);
}

.wv-basket-dialog__panel {
	margin: 0;
	padding: 28px 28px 24px;
	font-family: var(--wv-btn-font, sans-serif);
	text-align: center;
}

.wv-basket-dialog__title {
	margin: 0 0 10px;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: inherit;
}

.wv-basket-dialog__text {
	margin: 0 0 22px;
	font-size: 15px;
	line-height: 1.45;
	color: inherit;
}

.wv-basket-dialog__actions {
	display: flex;
	justify-content: center;
	gap: 10px;
}

.wv-basket-dialog__actions .wv-btn {
	flex: 1 1 0;
}

/* "Proceed to checkout" sat low in its button. The basket is a Text Editor
   widget in Elementor, whose wpautop puts a <br> inside the link ahead of the
   label, so the label was the second of two 12px lines. Hide the <br>; the
   extra 6px top and bottom keeps the button the 52px it was (Paul, 2026-10-25). */
.wc-proceed-to-checkout .checkout-button br {
	display: none;
}

.wc-proceed-to-checkout a.checkout-button {
	padding-top: 20px;
	padding-bottom: 20px;
}
