/* ==========================================================================
   ERP Theme — cart (image 3)
   ========================================================================== */

.cg-cart { padding-bottom: 48px; }
.cg-cart__grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; align-items: start; }
.cg-cart__main { min-width: 0; }
.cg-cart__card { padding: 8px 22px 20px; }
.cg-cartsum .cg-totals td { overflow-wrap: anywhere; }
.cg-cart__head, .cg-cline { display: grid; grid-template-columns: 28px minmax(0, 1fr) 104px 136px 92px; gap: 14px; align-items: center; }
.cg-cart__head { padding: 16px 0 12px; border-bottom: 1px solid var(--erp-line); font-weight: 600; color: var(--erp-text); font-size: var(--erp-fs-sm); }
.cg-cart__head span:nth-child(2) { grid-column: 1 / 3; } /* 1st child: screen-reader-only "remove" header (absolutely positioned, takes no cell) */
.cg-cart__head span:nth-child(3), .cg-cart__head span:nth-child(4) { text-align: center; }
.cg-cart__head span:last-child { text-align: right; }
.cg-cline { padding: 16px 0; border-bottom: 1px solid var(--erp-line); transition: opacity .2s; }
.cg-cline.is-busy { opacity: .5; pointer-events: none; }
.cg-cline__remove { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--erp-muted); }
.cg-cline__remove:hover { background: var(--erp-primary-50); color: var(--erp-primary); }
.cg-cline__remove .cg-icon { width: 18px; height: 18px; }
.cg-cline__product { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.cg-cline__thumb { flex: none; }
.cg-cline__img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--erp-r-sm); background: var(--erp-soft); border: 1px solid var(--erp-line); }
.cg-cline__info { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--erp-fs-sm); color: var(--erp-muted); }
.cg-cline__name { font-weight: 800; font-size: var(--erp-fs-base); color: var(--erp-ink); line-height: 1.3; }
.cg-cline__table { color: var(--erp-text); font-weight: 600; }
.cg-cline__meta { margin: 2px 0 0; display: grid; gap: 1px; }
.cg-cline__meta div { display: flex; gap: 4px; flex-wrap: wrap; }
.cg-cline__meta dt { font-weight: 500; }
.cg-cline__meta dd { margin: 0; color: var(--erp-text); }
.cg-cline__meta .cg-ptime { font-size: var(--erp-fs-xs); }
.cg-cline__price { text-align: center; font-weight: 700; color: var(--erp-ink); }
.cg-cline__per { display: block; color: var(--erp-muted); font-weight: 500; font-size: var(--erp-fs-xs); }
.cg-cline__qty { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cg-vqty { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cg-vqty__label { font-size: var(--erp-fs-xs); color: var(--erp-muted); font-weight: 600; }
.cg-cline__total { text-align: right; font-weight: 800; color: var(--erp-ink); }
.cg-cline.is-quote .cg-cline__price { font-weight: 600; }

.cg-cart__actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; }
.cg-cart__actions .cg-btn { min-height: 44px; }
.cg-cart__actions .cg-icon { width: 18px; height: 18px; }
.cg-cart-js .cg-cart__update { display: none; }
.cg-cart__recs { margin-top: 24px; }
.cg-cart__recs:empty { display: none; }

/* Summary */
.cg-cart__side { position: sticky; top: calc(var(--erp-header-h) + 70px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cg-cartsum { padding: 24px; }
.cg-cartsum h2 { font-size: var(--erp-fs-xl); margin-bottom: 14px; }
.cg-cartsum .cg-totals th { color: var(--erp-muted); }
.cg-cartsum .cg-coupon { padding-top: 14px; border-top: 1px solid var(--erp-line); }
.cg-cartsum__total { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 0; margin-bottom: 14px; border-top: 1px solid var(--erp-line); color: var(--erp-muted); }
.cg-cartsum__total strong:first-child { color: var(--erp-ink); font-size: var(--erp-fs-md); }
.cg-cartsum__amount { font-size: 1.6rem; font-weight: 800; color: var(--erp-ink); letter-spacing: -.02em; white-space: nowrap; }
.cg-cartsum .checkout-button { min-height: 52px; font-size: var(--erp-fs-md); }
.cg-cartsum .checkout-button .cg-icon { width: 20px; height: 20px; }
.cg-cartsum__secure { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 0 10px; font-size: var(--erp-fs-sm); color: var(--erp-text); }
.cg-cartsum__secure .cg-icon { width: 16px; height: 16px; }
.cg-cartsum .cg-payicons { justify-content: center; }
.cg-cartsum .cg-shipbar-wrap:not(:empty) { margin-top: 16px; }

/* Empty */
.cg-cart-empty { max-width: 620px; margin: 8px auto 40px; padding: 40px 24px; text-align: center; }
.cg-cart-empty__icon { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--erp-primary-50); color: var(--erp-primary); margin-bottom: 14px; }
.cg-cart-empty__icon .cg-icon { width: 32px; height: 32px; }
.cg-cart-empty p { color: var(--erp-muted); }

@media (max-width: 1280px) {
	.cg-cart__grid { grid-template-columns: minmax(0, 1fr) 340px; }
	.cg-cart__head, .cg-cline { grid-template-columns: 28px minmax(0, 1fr) 96px 130px 84px; gap: 10px; }
	.cg-cline__img { width: 76px; height: 76px; }
}
@media (max-width: 1024px) {
	.cg-cart__grid { grid-template-columns: minmax(0, 1fr); }
	.cg-cart__side { position: static; }
}
@media (max-width: 720px) {
	.cg-cart__card { padding: 4px 14px 16px; }
	.cg-cart__head { display: none; }
	.cg-cline { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "prod remove" "price price" "qty total"; gap: 10px; }
	.cg-cline__product { grid-area: prod; }
	.cg-cline__rm { grid-area: remove; align-self: start; }
	.cg-cline__price { grid-area: price; text-align: left; display: flex; align-items: baseline; gap: 6px; }
	.cg-cline__per { display: inline; }
	.cg-cline__qty { grid-area: qty; align-items: flex-start; }
	.cg-vqty { flex-direction: row; gap: 8px; }
	.cg-cline__total { grid-area: total; align-self: end; font-size: var(--erp-fs-md); }
	.cg-cline__img { width: 72px; height: 72px; }
	.cg-cart__actions { flex-direction: column; }
	.cg-cart__actions .cg-btn { width: 100%; }
	.cg-cartsum { padding: 18px; }
}

/* Share cart (WPC Share Cart): quiet text link, never mistaken for the checkout button. */
.cg-cart .wpcss-btn, .cg-cart button.wpcss-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 0; width: auto; padding: 6px 2px; background: none !important; border: 0 !important; box-shadow: none !important; color: var(--erp-muted) !important; font-weight: 600; font-size: .875rem; text-decoration: underline; text-underline-offset: 3px; }
.cg-cart .wpcss-btn::before { content: ""; width: 15px; height: 15px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='m8.6 13.5 6.8 4M15.4 6.5l-6.8 4'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='m8.6 13.5 6.8 4M15.4 6.5l-6.8 4'/%3E%3C/svg%3E") center/contain no-repeat; }
.cg-cart .wpcss-btn:hover { color: var(--erp-ink) !important; }

/* Phones: items → totals + checkout → actions → recommendations (owner request). */
@media (max-width: 1024px) {
	.cg-cart__grid { display: flex !important; flex-direction: column; }
	.cg-cart__main { display: contents; }
	.cg-cart__card { order: 1; }
	.cg-cart__side { order: 2; position: static !important; }
	.cg-cart__recs { order: 3; }
	.cg-cart__actions { gap: 8px; }
	.cg-cart__actions .cg-btn { min-height: 42px; font-size: .875rem; }
}
