/* ==========================================================================
   Cart page
   ========================================================================== */

.dkm-cartpage {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr);
	gap: clamp(20px, 3vw, 40px);
	align-items: start;
	padding-bottom: clamp(30px, 4vw, 60px);
}

@media (max-width: 900px) {
	.dkm-cartpage {
		grid-template-columns: 1fr;
	}
}

.dkm-cartpage__main,
.dkm-cartpage__side {
	min-width: 0;
}

@media (min-width: 901px) {
	.dkm-cartpage__side {
		position: sticky;
		top: calc(90px + env(safe-area-inset-top, 0px));
	}
}

/* ---- line items ----
   The template keeps WooCommerce's table, so this styles a table rather than
   replacing it with a grid. Below 760px each row becomes a card and the column
   headings come from the data-title attributes. */

.dkm-cart-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--line);
	border-radius: var(--r3);
	overflow: hidden;
	background: var(--bg);
}

.dkm-cart-table thead th {
	background: var(--surf);
	font-size: 10px;
	font-weight: 900;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink2);
	text-align: left;
	padding: 12px 14px;
	border-bottom: 1px solid var(--line);
}

.dkm-cart-table thead th:last-child,
.dkm-cart-table td.dkm-line__sub {
	text-align: right;
}

.dkm-line > td {
	padding: 16px 14px;
	border-bottom: 1px solid var(--line);
	vertical-align: middle;
}

.dkm-cart-table tbody tr:last-child > td {
	border-bottom: none;
}

.dkm-line__thumb {
	width: 92px;
}

.dkm-line__thumb img {
	width: 76px;
	height: 76px;
	border-radius: 12px;
	object-fit: cover;
	background: var(--surf2);
}

.dkm-line__name {
	min-width: 0;
}

.dkm-line__title {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.3;
	display: block;
}

.dkm-line__title a:hover {
	color: var(--ch4);
}

.dkm-line__meta {
	display: block;
	font-size: 11.5px;
	color: var(--ink3);
	margin-top: 3px;
}

.dkm-line__tag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 9px;
	font-weight: 900;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ch4);
	margin-bottom: 5px;
}

.dkm-line__tag .ico {
	font-size: 13px;
}

.dkm-line__remove {
	display: block;
	margin-top: 7px;
}

.dkm-line__remove a {
	font-size: 11px;
	color: var(--ink3);
	text-decoration: underline;
}

.dkm-line__remove a:hover {
	color: var(--red);
}

.dkm-line__price,
.dkm-line__sub {
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}

.dkm-line__sub {
	font-weight: 800;
	letter-spacing: -0.02em;
}

/* A box bought with a watch reads as part of the watch above it. */

.dkm-line--box > td {
	background: var(--chbg);
	border-bottom: 1px dashed var(--ch2);
}

.dkm-line--box .dkm-line__thumb img {
	width: 52px;
	height: 52px;
	margin-left: 24px;
}

@media (max-width: 760px) {
	.dkm-cart-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.dkm-cart-table,
	.dkm-cart-table tbody,
	.dkm-line,
	.dkm-line > td {
		display: block;
		width: auto;
	}

	.dkm-line {
		position: relative;
		padding: 14px 14px 14px 104px;
		border-bottom: 1px solid var(--line);
		min-height: 104px;
	}

	.dkm-line > td {
		padding: 0;
		border: none;
	}

	.dkm-line__thumb {
		position: absolute;
		left: 14px;
		top: 14px;
		width: 76px;
	}

	.dkm-line__price,
	.dkm-line__qty,
	.dkm-line__sub {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 10px;
		padding-top: 8px;
		text-align: left;
	}

	.dkm-line__price::before,
	.dkm-line__qty::before,
	.dkm-line__sub::before {
		content: attr(data-title);
		font-size: 10px;
		font-weight: 900;
		letter-spacing: 0.12em;
		text-transform: uppercase;
		color: var(--ink3);
	}

	.dkm-line--box .dkm-line__thumb img {
		margin-left: 0;
		width: 76px;
		height: 76px;
	}

	/* The row no longer behaves like part of a table here, while the cell
	   keeps doing the layout. */

	.dkm-cart-actions,
	.dkm-cart-actions > td.actions {
		display: block;
		width: auto;
	}

	.dkm-cart-actions__update {
		flex: 1 1 100%;
	}
}

/* ---- quantity field ----
   WooCommerce prints the input itself, so it is restyled in place. */

.quantity {
	display: inline-flex;
	align-items: center;
}

input.qty,
.dkm-qty__input {
	width: 64px;
	border: 1.5px solid var(--line);
	border-radius: 999px;
	background: var(--bg);
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	padding: 9px 6px;
	font-family: inherit;
	color: var(--ink);
	-moz-appearance: textfield;
	appearance: textfield;
}

input.qty:focus,
.dkm-qty__input:focus {
	outline: none;
	border-color: var(--ch2);
}

input.qty::-webkit-outer-spin-button,
input.qty::-webkit-inner-spin-button,
.dkm-qty__input::-webkit-outer-spin-button,
.dkm-qty__input::-webkit-inner-spin-button {
	appearance: none;
	margin: 0;
}

.qty-fixed {
	font-size: 13px;
	font-weight: 700;
	color: var(--ink2);
}

/* ---- coupon and actions ---- */

/* The coupon and the update button share one cell that spans the table. The
   cell itself stays a table cell, because a cell turned into a flex container
   drops out of the table and loses the width its colspan gives it. */

.dkm-cart-actions > td.actions {
	padding: 16px 14px;
	border-top: 1px solid var(--line);
}

.dkm-cart-actions__in {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
}

.dkm-cart-actions .dkm-coupon {
	flex: 1 1 260px;
	min-width: 0;
}

.dkm-cart-actions__update {
	flex: 0 0 auto;
}

.dkm-coupon__label {
	display: block;
	font-size: 10px;
	font-weight: 900;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--ink3);
	margin-bottom: 7px;
}

.dkm-coupon__row {
	display: flex;
	gap: 8px;
}

.dkm-coupon__input {
	flex: 1 1 120px;
	min-width: 0;
	border: 1.5px solid var(--line);
	border-radius: 999px;
	padding: 11px 16px;
	font-size: 13px;
	background: var(--bg);
}

.dkm-coupon__input:focus {
	outline: none;
	border-color: var(--ch2);
}

.dkm-coupon__btn {
	flex: 0 0 auto;
	white-space: nowrap;
}

/* ---- box offer ---- */

.dkm-cartpage__boxes {
	margin-top: 20px;
	border: 1px dashed var(--ch2);
	border-radius: var(--r3);
	background: var(--chbg);
	padding: 16px;
}

.dkm-cartpage__boxes-lead {
	font-size: 12.5px;
	color: var(--ink2);
	margin-bottom: 10px;
}

/* ---- totals card ---- */

.dkm-totals {
	border: 1px solid var(--line);
	border-radius: var(--r3);
	background: var(--surf);
	padding: 18px;
}

.dkm-totals__h {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: -0.03em;
	margin-bottom: 14px;
}

.dkm-totals__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.dkm-totals__table th,
.dkm-totals__table td {
	padding: 9px 0;
	text-align: left;
	border-bottom: 1px solid var(--line);
	font-weight: 500;
	color: var(--ink2);
}

.dkm-totals__table td {
	text-align: right;
	color: var(--ink);
	font-weight: 700;
}

.dkm-totals__table .order-total th,
.dkm-totals__table .order-total td {
	border-bottom: none;
	padding-top: 14px;
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -0.03em;
	color: var(--ink);
}

.dkm-totals__go {
	margin-top: 16px;
}

/* WooCommerce prints its own checkout button, so it is styled rather than
   replaced, which keeps payment plugins that filter it working. */

.checkout-button,
.wc-proceed-to-checkout .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	padding: 16px 30px;
	font-size: 14px;
	font-weight: 700;
	border-radius: 999px;
	border: 1.5px solid transparent;
	color: var(--on-dark);
	background: var(--grad);
	background-size: 260% 100%;
	animation: gmove 7s linear infinite;
	box-shadow: var(--sh-gold);
	transition: all 0.3s var(--e);
	text-align: center;
}

.checkout-button:hover,
.wc-proceed-to-checkout .button:hover {
	transform: translateY(-2px);
	box-shadow: var(--sh-gold-lg);
}

.wc-proceed-to-checkout {
	margin-top: 16px;
}

.dkm-totals__usp {
	margin-top: 14px;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.dkm-totals__usp div {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 11.5px;
	color: var(--ink2);
	min-width: 0;
}

.dkm-totals__usp .ico {
	font-size: 15px;
	color: var(--ch4);
	flex: 0 0 auto;
}

/* ---- empty ---- */

.dkm-cart-empty {
	text-align: center;
	padding: clamp(40px, 7vw, 90px) 20px;
}

.dkm-cart-empty__ico .ico {
	font-size: 44px;
	color: var(--line2);
	margin: 0 auto 16px;
}

.dkm-cart-empty h1 {
	font-size: clamp(1.4rem, 3vw, 2rem);
	margin-bottom: 8px;
}

.dkm-cart-empty p {
	color: var(--ink2);
	font-size: 14px;
	max-width: 42ch;
	margin: 0 auto 22px;
}

.dkm-cart-empty__acts {
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

/* ---- mini cart (the WooCommerce widget, kept consistent) ---- */

.dkm-mini__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 12px 0;
	border-top: 1px solid var(--line);
	font-size: 13px;
}

.dkm-mini__total b {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -0.03em;
}

.dkm-mini__buttons {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* ---- WooCommerce's own notices, restyled ---- */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	list-style: none;
	border: 1px solid var(--line);
	border-left: 3px solid var(--ch1);
	background: var(--surf);
	border-radius: var(--r2);
	padding: 13px 16px;
	font-size: 13px;
	margin-bottom: 18px;
	color: var(--ink);
}

.woocommerce-error {
	border-left-color: var(--red);
	background: var(--redbg);
}

.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
	color: var(--ch4);
	font-weight: 700;
	text-decoration: underline;
}
