/*
 * Prometal Group – veikala dizains: GROZS
 * Ielādējas: /grozs/.
 * Izkārtojums: prece kreisajā pusē (tabula), "lipīga" kopsumma labajā; mobilajā tabula kļūst par kartītēm.
 */

/* ───────── Izkārtojums (tikai, ja grozā ir preces) ───────── */
body.woocommerce-cart .woocommerce:has(> form.woocommerce-cart-form) {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 0 48px;
	align-items: start;
}
body.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper,
body.woocommerce-cart .woocommerce > .pmg-steps { grid-column: 1 / -1; }
body.woocommerce-cart .woocommerce > form.woocommerce-cart-form { grid-column: 1; min-width: 0; }
body.woocommerce-cart .woocommerce > .cart-collaterals {
	grid-column: 2;
	position: sticky;
	top: var(--pmg-sticky-top);
	float: none;
	width: auto;
	display: flex;
	flex-direction: column;
	gap: 24px;
}
body.woocommerce-cart .cart-collaterals .cart_totals { float: none !important; width: 100% !important; order: 1; }
body.woocommerce-cart .cart-collaterals .cross-sells { float: none; width: 100%; order: 2; }

/* ───────── Preču tabula ───────── */
body.woocommerce-cart table.shop_table.cart {
	width: 100%;
	margin: 0;
	border: 0 !important;
	border-radius: 0;
	border-collapse: collapse;
	background: transparent;
}
body.woocommerce-cart table.shop_table.cart thead th {
	padding: 0 12px 16px;
	border: 0;
	border-bottom: 1px solid var(--pmg-ink);
	background: transparent;
	color: var(--pmg-muted);
	font: 700 11px/1.2 var(--pmg-font);
	letter-spacing: 1.5px;
	text-transform: uppercase;
	text-align: left;
}
body.woocommerce-cart table.shop_table.cart td {
	padding: 24px 12px;
	border: 0;
	border-bottom: 1px solid var(--pmg-line);
	background: transparent;
	vertical-align: middle;
	font-size: 14px;
}
body.woocommerce-cart table.cart .product-remove { width: 32px; padding: 24px 0; }
body.woocommerce-cart table.cart .product-thumbnail { width: 88px; padding: 24px 16px 24px 12px; }
body.woocommerce-cart table.cart .product-name { min-width: 150px; }
body.woocommerce-cart table.cart .product-price { width: 96px; color: var(--pmg-muted); }
body.woocommerce-cart table.cart .product-quantity { width: 128px; }
body.woocommerce-cart table.cart .product-subtotal { width: 100px; padding-right: 0; text-align: right; font-weight: 700; color: var(--pmg-ink); }
body.woocommerce-cart table.cart thead .product-subtotal { text-align: right; }

body.woocommerce-cart table.cart .product-thumbnail img {
	display: block;
	width: 88px;
	height: 88px;
	object-fit: cover;
	background: var(--pmg-soft);
	border-radius: 0;
}
body.woocommerce-cart table.cart .product-name a {
	color: var(--pmg-ink);
	font: 600 15px/1.4 var(--pmg-font);
	text-decoration: none;
	transition: color .2s;
}
body.woocommerce-cart table.cart .product-name a:hover { color: var(--pmg-teal); }
body.woocommerce-cart table.cart .product-name dl.variation {
	margin: 6px 0 0;
	color: var(--pmg-muted);
	font-size: 12px;
}
body.woocommerce-cart table.cart .product-name dl.variation p { margin: 0; }

body.woocommerce-cart table.cart a.remove {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: transparent !important;
	border: 1px solid var(--pmg-line);
	border-radius: 0 !important;
	color: var(--pmg-muted) !important;
	font: 300 20px/1 var(--pmg-font);
	text-decoration: none;
	transition: background .2s, color .2s, border-color .2s;
}
body.woocommerce-cart table.cart a.remove:hover {
	background: var(--pmg-danger) !important;
	border-color: var(--pmg-danger);
	color: #fff !important;
}
body.woocommerce-cart table.cart .quantity { height: 44px; }
body.woocommerce-cart table.cart .quantity input.qty { width: 44px; font-size: 14px; }
body.woocommerce-cart table.cart .quantity .pmg-qty-btn { width: 36px; }

/* Darbību rinda: kupons + atjaunināt */
body.woocommerce-cart table.cart td.actions { padding: 28px 0 0; border: 0; }
body.woocommerce-cart table.cart td.actions::after { content: ''; display: table; clear: both; }
body.woocommerce-cart table.cart td.actions .coupon { float: left; display: flex; gap: 10px; }
body.woocommerce-cart table.cart td.actions .coupon label { display: none; }
body.woocommerce-cart table.cart td.actions .coupon .input-text {
	width: 220px;
	height: 48px;
	margin: 0;
	padding: 0 16px !important;
	background: #fff;
	border: 1px solid #d8d8d8 !important;
	border-radius: 0;
	font: 400 14px var(--pmg-font);
	outline: 0;
}
body.woocommerce-cart table.cart td.actions .coupon .input-text:focus {
	border-color: var(--pmg-teal) !important;
	box-shadow: 0 0 0 3px rgba(0, 118, 101, .15);
}
body.woocommerce-cart table.cart td.actions > button[name="update_cart"] { float: right; }
body.woocommerce-cart button[name="update_cart"]:disabled { opacity: .4 !important; cursor: not-allowed; }

/* ───────── Groza kopsumma ───────── */
body.woocommerce-cart .cart_totals {
	padding: 32px !important;
	background: #fff;
	border: 1px solid var(--pmg-line) !important;
	border-radius: 0;
	box-sizing: border-box;
}
body.woocommerce-cart .cart_totals > h2 {
	position: relative;
	margin: 0 0 24px;
	padding: 0 0 16px;
	border-bottom: 1px solid var(--pmg-line-soft);
	font: 700 12px/1.2 var(--pmg-font);
	letter-spacing: 1.5px;
	text-transform: uppercase;
}
body.woocommerce-cart .cart_totals > h2::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 40px;
	height: 2px;
	background: var(--pmg-teal);
}
body.woocommerce-cart .cart_totals table.shop_table {
	width: 100%;
	margin: 0 0 24px;
	border: 0 !important;
	border-collapse: collapse;
}
body.woocommerce-cart .cart_totals table.shop_table th,
body.woocommerce-cart .cart_totals table.shop_table td {
	padding: 14px 0;
	border: 0;
	border-bottom: 1px solid var(--pmg-line-soft);
	background: transparent;
	font-size: 14px;
	vertical-align: top;
}
body.woocommerce-cart .cart_totals table.shop_table th {
	width: 38%;
	color: var(--pmg-muted);
	font-weight: 500;
	text-align: left;
}
body.woocommerce-cart .cart_totals table.shop_table td { text-align: right; }
body.woocommerce-cart .cart_totals ul#shipping_method { margin: 0; padding: 0; list-style: none; }
body.woocommerce-cart .cart_totals .woocommerce-shipping-destination { margin: 6px 0 0; color: var(--pmg-muted); font-size: 12px; }
body.woocommerce-cart .cart_totals .shipping-calculator-button { color: var(--pmg-teal); font-size: 12px; text-decoration: underline; }
body.woocommerce-cart .cart_totals tr.order-total th,
body.woocommerce-cart .cart_totals tr.order-total td {
	padding-top: 20px;
	border-bottom: 0;
	border-top: 1px solid var(--pmg-ink);
	color: var(--pmg-ink);
}
body.woocommerce-cart .cart_totals tr.order-total th { font-weight: 700; }
body.woocommerce-cart .cart_totals tr.order-total td { font-size: 22px; font-weight: 700; }
body.woocommerce-cart .cart_totals tr.order-total small { display: block; color: var(--pmg-muted); font-size: 12px; font-weight: 400; }

body.woocommerce-cart .wc-proceed-to-checkout { margin: 0; padding: 0; }
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
	display: flex !important;
	width: 100% !important;
	margin: 0 !important;
	min-height: 58px;
	font-size: 13px !important;
	text-transform: uppercase !important;
}
/* ───────── Tukšs grozs ───────── */
body.woocommerce-cart .wc-empty-cart-message .cart-empty {
	display: block;
	max-width: 520px;
	margin: 40px auto 0 !important;
	padding: 0 !important;
	background: transparent;
	border: 0 !important;
	color: var(--pmg-ink);
	font: 600 22px/1.35 var(--pmg-font);
	text-align: center;
}
body.woocommerce-cart .wc-empty-cart-message .cart-empty::before {
	content: '' !important;
	position: static;
	display: block;
	width: 72px;
	height: 72px;
	margin: 0 auto 24px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007665' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='20' r='1.4'/%3E%3Ccircle cx='18' cy='20' r='1.4'/%3E%3Cpath d='M2 3h3l2.7 12.4a2 2 0 0 0 2 1.6h8.2a2 2 0 0 0 2-1.5L21.5 7H6'/%3E%3C/svg%3E") center / contain no-repeat;
	transform: none;
	font-size: 0;
}
body.woocommerce-cart p.return-to-shop { margin: 28px 0 0; text-align: center; }

/* ───────── Planšete / mobilais ───────── */
@media (max-width: 1199px) {
	body.woocommerce-cart .woocommerce:has(> form.woocommerce-cart-form) { grid-template-columns: minmax(0, 1fr) 340px; gap: 0 36px; }
	body.woocommerce-cart table.cart .product-price { display: none; }
}
@media (max-width: 991px) {
	body.woocommerce-cart .woocommerce:has(> form.woocommerce-cart-form) { grid-template-columns: 1fr; }
	body.woocommerce-cart .woocommerce > .cart-collaterals { grid-column: 1; position: static; margin-top: 40px; }
}

@media (max-width: 767px) {
	body.woocommerce-cart table.shop_table.cart thead { display: none; }
	body.woocommerce-cart table.shop_table.cart,
	body.woocommerce-cart table.shop_table.cart tbody { display: block; }
	body.woocommerce-cart table.shop_table.cart tr.cart_item {
		display: grid;
		grid-template-columns: 88px minmax(0, 1fr) auto;
		grid-template-areas: "thumb name remove" "thumb qty sub";
		gap: 10px 16px;
		align-items: center;
		padding: 20px 0;
		border-bottom: 1px solid var(--pmg-line);
	}
	body.woocommerce-cart table.shop_table.cart tr.cart_item td {
		display: block !important;
		width: auto !important;
		padding: 0 !important;
		border: 0 !important;
		text-align: left !important;
	}
	body.woocommerce-cart table.shop_table.cart tr.cart_item td::before { content: none !important; }
	body.woocommerce-cart table.cart .product-thumbnail { grid-area: thumb; }
	body.woocommerce-cart table.cart .product-name { grid-area: name; align-self: start; }
	body.woocommerce-cart table.cart .product-remove { grid-area: remove; align-self: start; justify-self: end; }
	body.woocommerce-cart table.cart .product-quantity { grid-area: qty; }
	body.woocommerce-cart table.cart .product-subtotal { grid-area: sub; justify-self: end; text-align: right !important; }
	body.woocommerce-cart table.shop_table.cart tr.cart_item td.product-price { display: none !important; }

	body.woocommerce-cart table.cart tr:has(td.actions) { display: block; }
	body.woocommerce-cart table.cart td.actions { display: block !important; padding-top: 24px !important; }
	body.woocommerce-cart table.cart td.actions .coupon { float: none; flex-wrap: wrap; margin-bottom: 12px; }
	body.woocommerce-cart table.cart td.actions .coupon .input-text { flex: 1 1 100%; width: 100%; }
	body.woocommerce-cart table.cart td.actions .coupon button { flex: 1 1 100%; }
	body.woocommerce-cart table.cart td.actions > button[name="update_cart"] { float: none; width: 100%; }
	body.woocommerce-cart .cart_totals { padding: 24px !important; }
}

/* Variāciju / artikula rinda zem nosaukuma – vienā rindā, bez noklusējuma atkāpēm */
body.woocommerce-cart table.cart .product-name dl.variation dt,
body.woocommerce-cart table.cart .product-name dl.variation dd { display: inline; margin: 0; }
body.woocommerce-cart table.cart .product-name dl.variation dd p { display: inline; }
body.woocommerce-cart table.cart .product-name dl.variation dt { margin-right: 4px; }
body.woocommerce-cart .cart_totals tr.order-total th { vertical-align: middle; }
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
	padding: 0 16px !important;
	font-size: 12px !important;
	letter-spacing: 1px !important;
}
