/**
 * HALINK C8 — Cart page (classic + WC Blocks fallback)
 */

/* ---------- Page shell ---------- */
.woocommerce-cart .c8-page--default,
.woocommerce-cart .c8-default-page {
	max-width: none;
	background: transparent;
	box-shadow: none;
	padding: 0;
	border-radius: 0;
}

.woocommerce-cart .c8-default-page__body {
	font-size: inherit;
	line-height: inherit;
}

.woocommerce-cart .c8-default-page__cta {
	display: none;
}

.c7-cart-page {
	color: var(--c8-text, #1a1a1a);
	padding-bottom: 1rem;
}

.c7-cart-page__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
	gap: 1.5rem;
	align-items: start;
}

.c7-shop-card,
.c7-cart-page__main,
.c7-cart-page__summary {
	background: #fff;
	border: 1px solid var(--c8-border, #e4e2dc);
	border-radius: 16px 6px;
	box-shadow: var(--c8-shadow-sm, 0 2px 8px rgba(18, 31, 56, 0.06));
}

.c7-cart-page__main {
	padding: 1.15rem 1.25rem 1.25rem;
}

.c7-cart-page__summary {
	padding: 1.25rem 1.35rem;
	position: sticky;
	top: calc(var(--c8-header-h-sticky, 72px) + 1rem);
}

/* ---------- Cart table ---------- */
.c7-cart-table,
.woocommerce-cart-form table.cart {
	width: 100%;
	border: 0;
	border-collapse: collapse;
	margin: 0;
	background: transparent;
}

.c7-cart-table thead th,
.woocommerce-cart-form table.cart thead th {
	padding: 0.65rem 0.5rem 0.85rem;
	border: 0;
	border-bottom: 1px solid var(--c8-border, #e4e2dc);
	background: transparent !important;
	color: var(--c8-primary, #121f38) !important;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: left;
}

.c7-cart-table td,
.woocommerce-cart-form table.cart td {
	padding: 1rem 0.5rem;
	border: 0;
	border-bottom: 1px solid var(--c8-border, #e4e2dc);
	background: transparent !important;
	color: var(--c8-text, #1a1a1a) !important;
	vertical-align: middle;
}

.c7-cart-table .product-name a,
.woocommerce-cart-form .product-name a {
	color: var(--c8-primary, #121f38) !important;
	font-weight: 600;
	text-decoration: none;
}

.c7-cart-table .product-name a:hover,
.woocommerce-cart-form .product-name a:hover {
	color: var(--c8-secondary, #9a563a) !important;
}

.c7-cart-table .product-price,
.c7-cart-table .product-subtotal,
.woocommerce-cart-form .product-price,
.woocommerce-cart-form .product-subtotal {
	color: var(--c8-text, #1a1a1a) !important;
	font-weight: 600;
	white-space: nowrap;
}

.c7-cart-table .product-thumbnail img,
.woocommerce-cart-form .product-thumbnail img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 10px 4px;
	background: var(--c8-bg, #f0efeb);
}

.c7-cart-table .product-remove a.remove,
.woocommerce-cart-form .product-remove a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #f3f1ec;
	color: var(--c8-primary, #121f38) !important;
	font-size: 1.1rem;
	line-height: 1;
	text-decoration: none !important;
}

.c7-cart-table .product-remove a.remove:hover,
.woocommerce-cart-form .product-remove a.remove:hover {
	background: var(--c8-secondary, #9a563a);
	color: #fff !important;
}

.c7-cart-table .quantity .qty,
.woocommerce-cart-form .quantity .qty {
	width: 4rem;
	height: 2.4rem;
	border: 1px solid var(--c8-border, #e4e2dc);
	border-radius: 8px;
	text-align: center;
	color: var(--c8-text, #1a1a1a);
	background: #fff;
}

.c7-cart-actions-row td {
	border-bottom: 0 !important;
	padding-top: 1.15rem !important;
}

.c7-cart-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
}

.c7-cart-coupon {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.c7-cart-coupon .input-text {
	min-width: 180px;
	height: 2.5rem;
	padding: 0 0.9rem;
	border: 1px solid var(--c8-border, #e4e2dc);
	border-radius: var(--c8-radius-cta, 20px 5px);
	color: var(--c8-text, #1a1a1a);
	background: #fff;
}

.c7-cart-coupon .button,
.c7-cart-update.button,
.woocommerce-cart .button {
	background: var(--c8-primary, #121f38) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: var(--c8-radius-cta, 20px 5px) !important;
	padding: 0.65rem 1.15rem !important;
	font-weight: 600 !important;
}

.c7-cart-coupon .button:hover,
.c7-cart-update.button:hover,
.woocommerce-cart .button:hover {
	background: var(--c8-secondary, #9a563a) !important;
	color: #fff !important;
}

/* ---------- Totals ---------- */
.c7-cart-totals__title {
	margin: 0 0 1rem;
	font-family: var(--c8-font-display, Lora, Georgia, serif);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--c8-primary, #121f38) !important;
}

.c7-cart-totals__table,
.c7-cart-totals table {
	width: 100%;
	border: 0;
	margin: 0 0 1.15rem;
}

.c7-cart-totals__table th,
.c7-cart-totals__table td,
.c7-cart-totals table th,
.c7-cart-totals table td {
	padding: 0.75rem 0;
	border: 0;
	border-bottom: 1px solid var(--c8-border, #e4e2dc);
	background: transparent !important;
	color: var(--c8-text, #1a1a1a) !important;
	font-size: 0.95rem;
}

.c7-cart-totals__table th,
.c7-cart-totals table th {
	font-weight: 500;
	text-align: left;
	color: var(--c8-text-muted, #6b6b6b) !important;
}

.c7-cart-totals__table td,
.c7-cart-totals table td {
	text-align: right;
	font-weight: 600;
}

.c7-cart-totals__table .order-total th,
.c7-cart-totals__table .order-total td,
.c7-cart-totals table .order-total th,
.c7-cart-totals table .order-total td {
	border-bottom: 0;
	padding-top: 1rem;
	color: var(--c8-primary, #121f38) !important;
	font-size: 1.05rem;
	font-weight: 700;
}

.c7-cart-totals__checkout .checkout-button,
.c7-cart-totals__checkout a.checkout-button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0.9rem 1.25rem !important;
	border-radius: var(--c8-radius-cta, 20px 5px) !important;
	background: var(--c8-primary, #121f38) !important;
	color: #fff !important;
	font-size: 1rem !important;
	font-weight: 700 !important;
	text-decoration: none !important;
	border: 0 !important;
}

.c7-cart-totals__checkout .checkout-button:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
	background: var(--c8-secondary, #9a563a) !important;
	color: #fff !important;
}

/* ---------- Empty ---------- */
.c7-cart-empty {
	text-align: center;
	padding: 3rem 1.5rem;
	background: #fff;
	border-radius: 16px 6px;
	border: 1px solid var(--c8-border, #e4e2dc);
}

.c7-cart-empty__icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 1rem;
	color: var(--c8-secondary, #9a563a);
}

.c7-cart-empty__icon svg {
	width: 100%;
	height: 100%;
}

.c7-cart-empty__title {
	margin: 0 0 0.5rem;
	font-family: var(--c8-font-display, Lora, Georgia, serif);
	color: var(--c8-primary, #121f38);
}

.c7-cart-empty__text {
	margin: 0 0 1.25rem;
	color: var(--c8-text-muted, #6b6b6b);
}

.c7-cart-empty .c7-shop-btn,
.c7-cart-empty .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.35rem !important;
	border-radius: var(--c8-radius-cta, 20px 5px) !important;
	background: var(--c8-primary, #121f38) !important;
	color: #fff !important;
	font-weight: 600 !important;
	text-decoration: none !important;
}

/* ---------- WC Blocks cart (fallback colors) ---------- */
.wp-block-woocommerce-cart,
.wc-block-cart {
	color: var(--c8-text, #1a1a1a) !important;
}

.wc-block-cart table thead,
.wc-block-cart-items__header,
.wc-block-cart-items__header-image,
.wc-block-cart-items__header-product,
.wc-block-cart-items__header-total,
.wc-block-components-product-name,
.wc-block-cart__totals-title,
.wc-block-components-totals-item__label,
.wc-block-components-totals-item__value,
.wc-block-components-order-summary-item__individual-prices,
.wc-block-components-product-metadata,
.wc-block-components-product-price,
.wc-block-components-product-badge {
	color: var(--c8-primary, #121f38) !important;
}

.wc-block-cart-items__header span,
.wc-block-cart-items__header div {
	color: var(--c8-primary, #121f38) !important;
	opacity: 1 !important;
}

a.wc-block-components-product-name {
	color: var(--c8-secondary, #9a563a) !important;
}

.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button,
.wc-block-cart .wc-block-components-button:not(.is-link) {
	background: var(--c8-primary, #121f38) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: var(--c8-radius-cta, 20px 5px) !important;
}

.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover,
.wc-block-cart .wc-block-components-button:not(.is-link):hover {
	background: var(--c8-secondary, #9a563a) !important;
	color: #fff !important;
}

.wc-block-cart__submit-button .wc-block-components-button__text,
.wc-block-cart .wc-block-components-button__text {
	color: #fff !important;
}

@media (max-width: 991px) {
	.c7-cart-page__layout {
		grid-template-columns: 1fr;
	}

	.c7-cart-page__summary {
		position: static;
	}
}

@media (max-width: 767px) {
	.c7-cart-table thead {
		display: none;
	}

	.c7-cart-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.c7-cart-coupon {
		width: 100%;
	}

	.c7-cart-coupon .input-text {
		flex: 1 1 auto;
		min-width: 0;
	}
}
