/**
 * WooCommerce Cart Page
 *
 * @package Yusung
 */

/* Inner container fills the 1320px wrapper on woocommerce.php only */
.woocommerce-cart #primary.woocommerce-main.site-main--site-width > .yusung-container--site,
.woocommerce-checkout #primary.woocommerce-main.site-main--site-width > .yusung-container--site,
.woocommerce-account #primary.woocommerce-main.site-main--site-width > .yusung-container--site {
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

/* WooCommerce Blocks cart */
.woocommerce-cart .wp-block-woocommerce-cart,
.woocommerce-cart .wc-block-cart,
.woocommerce-cart .wc-block-components-sidebar-layout,
body.yusung-wc-cart-page .wp-block-woocommerce-cart,
body.yusung-wc-cart-page .wc-block-cart,
body.yusung-wc-cart-page .wc-block-components-sidebar-layout {
	width: 100%;
	max-width: 100%;
}

.woocommerce-cart .wc-block-cart__main,
.woocommerce-cart .wc-block-cart__sidebar,
body.yusung-wc-cart-page .wc-block-cart__main,
body.yusung-wc-cart-page .wc-block-cart__sidebar {
	width: 100%;
}

.woocommerce-cart .woocommerce {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
	gap: 2rem;
	align-items: start;
}

.woocommerce-cart .woocommerce::before,
.woocommerce-cart .woocommerce::after {
	display: none !important;
	content: none !important;
}

.woocommerce-cart .woocommerce-cart-form {
	grid-column: 1;
	width: 100%;
	margin: 0;
	float: none;
}

.woocommerce-cart .cart-collaterals {
	grid-column: 2;
	width: 100% !important;
	float: none !important;
	margin: 0;
}

.woocommerce-cart .cart-collaterals .cart_totals {
	width: 100% !important;
	float: none !important;
	margin: 0;
}

/* Cart table */
.woocommerce-cart table.shop_table {
	border: 1px solid var(--yusung-color-border, #e5e7eb);
	border-radius: 8px;
	overflow: hidden;
	border-collapse: separate;
	border-spacing: 0;
}

.woocommerce-cart table.shop_table thead th {
	background: #f8fafc;
	color: #374151;
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 0.875rem 1rem;
	border-bottom: 1px solid var(--yusung-color-border, #e5e7eb);
}

.woocommerce-cart table.shop_table td {
	padding: 1rem;
	vertical-align: middle;
	border-bottom: 1px solid var(--yusung-color-border, #e5e7eb);
}

.woocommerce-cart table.shop_table tbody tr:last-child td {
	border-bottom: none;
}

.woocommerce-cart table.shop_table .product-thumbnail img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 6px;
}

.woocommerce-cart table.shop_table .product-name a {
	color: var(--yusung-color-text, #1f2937);
	font-weight: 600;
	text-decoration: none;
}

.woocommerce-cart table.shop_table .product-name a:hover {
	color: var(--yusung-color-primary, #004187);
}

.woocommerce-cart table.shop_table .product-price,
.woocommerce-cart table.shop_table .product-subtotal {
	color: var(--yusung-color-primary, #004187);
	font-weight: 700;
	font-size: 0.9375rem;
	white-space: nowrap;
}

.woocommerce-cart table.shop_table .product-quantity .qty {
	min-height: 42px;
	width: 4.5rem;
	padding: 0.375rem 0.5rem;
	border: 1px solid var(--yusung-color-border, #e5e7eb);
	border-radius: 4px;
}

.woocommerce-cart .actions .button {
	min-height: 42px;
}

/* Cart totals sidebar */
.woocommerce-cart .cart_totals {
	background: #fff;
	border: 1px solid var(--yusung-color-border, #e5e7eb);
	border-radius: 8px;
	padding: 1.25rem;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.woocommerce-cart .cart_totals > h2 {
	margin: 0 0 1rem;
	font-size: 1.125rem;
	font-weight: 700;
	color: #111827;
}

.woocommerce-cart .cart_totals table.shop_table {
	border: none;
	border-radius: 0;
	box-shadow: none;
}

.woocommerce-cart .cart_totals table.shop_table th,
.woocommerce-cart .cart_totals table.shop_table td {
	padding: 0.625rem 0;
	border: none;
	background: transparent;
	font-size: 0.9375rem;
}

.woocommerce-cart .cart_totals table.shop_table th {
	font-weight: 600;
	color: #4b5563;
	text-transform: none;
	letter-spacing: 0;
}

.woocommerce-cart .cart_totals table.shop_table td {
	text-align: right;
	color: var(--yusung-color-text, #1f2937);
	font-weight: 600;
}

.woocommerce-cart .cart_totals table.shop_table tr.order-total th,
.woocommerce-cart .cart_totals table.shop_table tr.order-total td {
	padding-top: 1rem;
	border-top: 1px solid var(--yusung-color-border, #e5e7eb);
	font-size: 1.0625rem;
}

.woocommerce-cart .cart_totals table.shop_table tr.order-total td {
	color: var(--yusung-color-primary, #004187);
	font-size: 1.25rem;
	font-weight: 800;
}

.woocommerce-cart .cart_totals table.shop_table tr.order-total td strong {
	font-weight: 800;
}

/* Action buttons */
.yusung-cart-summary__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.yusung-cart-add-more-button,
.yusung-cart-checkout-button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-height: 48px !important;
	margin: 0 !important;
	padding: 0.75rem 1rem !important;
	border-radius: 4px !important;
	font-size: 0.8125rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-align: center;
	line-height: 1.2;
	text-decoration: none !important;
}

.yusung-cart-add-more-button {
	background: #fff !important;
	color: var(--yusung-color-primary, #004187) !important;
	border: 2px solid var(--yusung-color-primary, #004187) !important;
}

.yusung-cart-add-more-button:hover {
	background: var(--yusung-color-primary, #004187) !important;
	color: #fff !important;
}

.yusung-cart-checkout-button {
	background: var(--yusung-color-primary, #004187) !important;
	color: #fff !important;
	border: none !important;
}

.yusung-cart-checkout-button:hover {
	background: #003066 !important;
	color: #fff !important;
}

/* Empty cart */
.woocommerce-cart .cart-empty {
	margin-bottom: 1rem;
	font-size: 1rem;
	color: #4b5563;
}

.woocommerce-cart .return-to-shop .button {
	min-height: 48px;
	padding: 0.75rem 1.5rem;
}

@media (max-width: 992px) {
	.woocommerce-cart .woocommerce {
		grid-template-columns: 1fr;
	}

	.woocommerce-cart .woocommerce-cart-form,
	.woocommerce-cart .cart-collaterals {
		grid-column: 1;
	}
}

@media (max-width: 768px) {
	.woocommerce-cart table.shop_table thead {
		display: none;
	}

	.woocommerce-cart table.shop_table tbody tr {
		display: block;
		padding: 1rem;
		border-bottom: 1px solid var(--yusung-color-border, #e5e7eb);
	}

	.woocommerce-cart table.shop_table tbody tr:last-child {
		border-bottom: none;
	}

	.woocommerce-cart table.shop_table td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 1rem;
		padding: 0.5rem 0;
		border: none;
	}

	.woocommerce-cart table.shop_table td::before {
		content: attr(data-title);
		font-weight: 600;
		color: #6b7280;
		font-size: 0.8125rem;
		text-transform: uppercase;
	}

	.woocommerce-cart table.shop_table .product-remove,
	.woocommerce-cart table.shop_table .product-thumbnail {
		justify-content: flex-start;
	}

	.woocommerce-cart table.shop_table .product-thumbnail::before,
	.woocommerce-cart table.shop_table .product-remove::before {
		display: none;
	}

	.yusung-cart-summary__actions {
		grid-template-columns: 1fr;
	}
}
