/* ==========================================================================
   PurOstill V2 — cart page
   ========================================================================== */

.v2-cart {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 2rem;
	align-items: start;
	padding-bottom: 3rem;
}

/* Lines ------------------------------------------------------------------- */

.v2-cart__lines {
	border: 1px solid var(--v2-line);
	border-radius: var(--v2-radius-lg);
	background: var(--v2-surface);
	overflow: hidden;
}

.v2-cart__head,
.v2-cart__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 150px 120px;
	gap: 1rem;
	align-items: center;
	padding: 1rem 1.4rem;
}

.v2-cart__head {
	border-bottom: 1px solid var(--v2-line);
	background: var(--v2-tint);
	font-size: .74rem; font-weight: 700;
	text-transform: uppercase; letter-spacing: .12em;
	color: var(--v2-muted);
}
.v2-cart__head span:last-child,
.v2-cart__total { text-align: right; }

.v2-cart__row + .v2-cart__row { border-top: 1px solid var(--v2-line); }

.v2-cart__product { display: flex; gap: 1rem; align-items: flex-start; min-width: 0; }
.v2-cart__thumb { width: 84px; height: 84px; flex: none; border-radius: .9rem; overflow: hidden; background: var(--v2-tint); }
.v2-cart__thumb img { width: 100%; height: 100%; object-fit: contain; padding: .35rem; }

.v2-cart__info { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.v2-cart__name { font-weight: 700; line-height: 1.35; }
.v2-cart__name a:hover { color: var(--v2-accent); }
.v2-cart__unit { font-size: .88rem; color: var(--v2-muted); }

.v2-cart__info dl { margin: 0; font-size: .82rem; color: var(--v2-muted); }
.v2-cart__info dt, .v2-cart__info dd { display: inline; margin: 0; }
.v2-cart__info dd::after { content: ""; display: block; }

.v2-cart__remove {
	align-self: flex-start; margin-top: .2rem;
	font-size: .8rem; color: var(--v2-muted);
	text-decoration: underline; text-underline-offset: 3px;
}
.v2-cart__remove:hover { color: var(--v2-sale); }

.v2-cart__qty .quantity { display: inline-flex; }

/* [type] again, to outrank the general `.v2 input[type="number"]` width rule. */
.v2-cart__qty input[type="number"] {
	flex: none;
	width: 58px; min-height: 36px; height: 36px; padding: 0; text-align: center;
	font-weight: 700; font-size: .9rem;
	border-radius: .55rem; border: 1px solid var(--v2-line);
}

/* The theme's own stepper, when the cart line renders one. */
.v2-cart__qty .v2-qty { flex: none; border-radius: .55rem; }
.v2-cart__qty .v2-qty button { width: 28px; height: 32px; font-size: 1rem; }
.v2-cart__qty .v2-qty input[type="number"] { width: 34px; height: 32px; min-height: 32px; border: none; }
.v2-cart__total { font-weight: 700; }

/* Actions ------------------------------------------------------------------ */

.v2-cart__actions {
	display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between;
	padding: 1.1rem 1.4rem;
	border-top: 1px solid var(--v2-line);
	background: var(--v2-tint);
}
.v2-cart__coupon { display: flex; gap: .5rem; flex: 1 1 280px; }
.v2-cart__coupon input { min-height: 40px; padding: .4rem .8rem; font-size: .9rem; }

/* Totals ------------------------------------------------------------------- */

.v2-cart__totals { position: sticky; top: calc(var(--v2-header-h) + 1.5rem); }

.v2-cart__totals .cart_totals {
	padding: 1.5rem;
	border: 1px solid var(--v2-line);
	border-radius: var(--v2-radius-lg);
	background: var(--v2-surface);
}
.v2-cart__totals h2 { margin-bottom: 1rem; font-size: 1.1rem; }
.v2-cart__totals table { width: 100%; border-collapse: collapse; }
.v2-cart__totals th, .v2-cart__totals td { padding: .65rem 0; text-align: left; font-size: .95rem; border-bottom: 1px solid var(--v2-line); }
.v2-cart__totals td { text-align: right; font-weight: 600; }
.v2-cart__totals th { color: var(--v2-muted); font-weight: 600; }
.v2-cart__totals .order-total th, .v2-cart__totals .order-total td { border-bottom: none; font-size: 1.15rem; font-weight: 800; padding-top: 1rem; }

.v2-cart__totals ul#shipping_method { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; text-align: left; }
.v2-cart__totals ul#shipping_method label { font-weight: 500; font-size: .9rem; }
.v2-cart__totals .woocommerce-shipping-destination { font-size: .82rem; color: var(--v2-muted); }

.v2-cart__totals .wc-proceed-to-checkout { margin-top: 1.2rem; }
.v2-cart__totals .checkout-button {
	display: flex; align-items: center; justify-content: center;
	width: 100%; height: 50px;
	border-radius: .75rem;
	background: var(--v2-accent); color: #fff;
	font-weight: 700; font-size: 1rem;
}
.v2-cart__totals .checkout-button:hover { background: rgba(var(--v2-accent-rgb), .9); color: #fff; }

/* Empty -------------------------------------------------------------------- */

.v2-cart__empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.v2-cart__empty .v2-btn { margin-top: 1rem; }
.v2-cart__suggest { margin-top: 1rem; }

/* Narrow ------------------------------------------------------------------- */

@media (max-width: 1000px) {
	.v2-cart { grid-template-columns: minmax(0, 1fr); }
	.v2-cart__totals { position: static; }
}
@media (max-width: 620px) {
	.v2-cart__head { display: none; }
	.v2-cart__row { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
	.v2-cart__total { text-align: left; }
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 620px) {
	.v2-cart { gap: 1.25rem; }
	.v2-cart__lines { border-radius: 1rem; }

	.v2-cart__row { padding: 1rem; }
	.v2-cart__thumb { width: 64px; height: 64px; }

	/* Quantity and line total sit on one row under the product, rather than
	   each taking a full-width block. */
	.v2-cart__row { grid-template-areas: "product product" "qty total"; grid-template-columns: auto 1fr; }
	.v2-cart__product { grid-area: product; }
	.v2-cart__qty { grid-area: qty; }
	.v2-cart__total { grid-area: total; text-align: right; align-self: center; font-size: 1.05rem; }

	.v2-cart__actions { flex-direction: column; align-items: stretch; padding: 1rem; }
	.v2-cart__coupon { flex-direction: column; }
	.v2-cart__coupon input, .v2-cart__coupon button { width: 100%; }
	.v2-cart__actions > button { width: 100%; }

	.v2-cart__totals .cart_totals { padding: 1.25rem; border-radius: 1rem; }
}

/* Delivery note in place of the shipping rows -------------------------------- */

.v2-cart__note-row td { padding: .5rem 0 !important; border-bottom: 1px solid var(--v2-line); }
.v2-cart__note {
	margin: 0;
	font-size: .85rem;
	line-height: 1.5;
	color: var(--v2-muted);
	text-align: left;
	font-weight: 500;
}
