/* Auto Tire - cart page */

body.at-cart-page {
	background: #f4f7fa;
	--wp--style--root--padding-right: 0px;
	--wp--style--root--padding-left: 0px;
	font-size: 0.9375rem;
}

body.at-cart-page .wp-site-blocks,
body.at-cart-page .has-global-padding {
	padding-inline: 0 !important;
}

body.at-cart-page .wp-site-blocks > header:not(.at-header),
body.at-cart-page .wp-block-site-title,
body.at-cart-page .entry-header,
body.at-cart-page .wp-block-post-title {
	display: none !important;
}

/* Remove any parent width caps (WP FSE + block theme). */
body.at-cart-page .wp-site-blocks {
	max-width: none !important;
	width: 100% !important;
}

body.at-cart-page .wp-site-blocks,
body.at-cart-page .at-cart-main-wrap,
body.at-cart-page main,
body.at-cart-page .entry-content,
body.at-cart-page .wp-block-post-content,
body.at-cart-page .woocommerce,
body.at-cart-page .is-layout-constrained,
/* Body carries .woocommerce-cart - not a descendant (see checkout.css). */
body.woocommerce-cart.at-cart-page main .woocommerce {
	max-width: none !important;
	width: 100% !important;
	margin-inline: auto !important;
	padding-inline: 0 !important;
	box-sizing: border-box;
}

/* WooCommerce blocktheme caps cart at 1000px - override on body class. */
body.woocommerce-cart.at-cart-page main .woocommerce,
body.woocommerce-cart.at-cart-page .wp-block-post-content,
body.woocommerce-cart.at-cart-page .wp-block-post-content .woocommerce {
	max-width: none !important;
	width: 100% !important;
}

body.woocommerce-cart.at-cart-page .cart-collaterals,
body.woocommerce-cart.at-cart-page .cart_totals,
body.at-cart-page .at-cart-sidebar .cart_totals {
	max-width: none !important;
	width: 100% !important;
	float: none !important;
}

body.at-cart-page #at-content,
body.at-cart-page .at-cart-main-wrap,
body.at-cart-page .wp-block-group.alignfull {
	max-width: none !important;
	width: 100% !important;
}

body.at-cart-page .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: none !important;
}

body.at-cart-page .at-cart__hero {
	margin-bottom: 0;
}

/* Hide block cart coupon UI if block is still cached */
body.at-cart-page .wc-block-components-totals-coupon,
body.at-cart-page .wc-block-cart__submit-container + .wc-block-components-totals-coupon {
	display: none !important;
}

/* ── Shell - edge-to-edge (matches checkout full-bleed) ── */
.at-cart-shell {
	width: 100%;
	max-width: none;
	margin-inline: auto;
	padding: 0.75rem clamp(0.75rem, 2vw, 1.5rem) 2.5rem;
	box-sizing: border-box;
}

body.at-cart-page .at-shop__hero,
body.at-cart-page .at-shop__hero-rail {
	max-width: none !important;
	width: 100% !important;
}

/* ── Top bar ── */
.at-cart-topbar {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
	padding: 0.85rem 1rem;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 8px 28px -18px rgba(15, 30, 60, 0.18);
}

.at-cart-logo img {
	display: block;
	height: 36px;
	width: auto;
	max-width: 160px;
	margin-inline: auto;
}

.at-cart-topbar__badges {
	width: 100%;
}

.at-cart-topbar .at-trust-strip {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.5rem;
	margin: 0;
	padding: 0;
}

.at-cart-topbar .at-trust-strip__item {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.45rem 0.4rem;
	text-align: center;
	background: #fff;
	border: 1px solid #e8eef3;
	border-radius: 10px;
}

.at-cart-topbar .at-trust-strip__icon {
	width: 1.75rem;
	height: 1.75rem;
	display: grid;
	place-items: center;
	font-size: 0.9rem;
	border-radius: 50%;
	background: linear-gradient(135deg, rgba(30, 189, 227, 0.16), rgba(30, 189, 227, 0.04));
	flex-shrink: 0;
}

.at-cart-topbar .at-trust-strip__label {
	font-size: 0.7rem;
	font-weight: 700;
	color: #193348;
	line-height: 1.2;
}

/* ── Grid - products + wide summary (full viewport width) ── */
.at-cart-grid {
	display: grid;
	/* ~62% products / ~38% summary; summary never shrinks below 380px. */
	grid-template-columns: minmax(0, 1.6fr) minmax(380px, 1fr);
	gap: clamp(1rem, 2vw, 1.75rem);
	align-items: start;
	width: 100%;
}

.at-cart-main,
.at-cart-sidebar {
	min-width: 0;
	width: 100%;
}

.at-cart-sidebar,
.at-cart-collaterals {
	width: 100% !important;
	max-width: none !important;
}

.at-cart-form {
	width: 100%;
}

.at-cart-panel {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 1rem 1.1rem;
	box-shadow: 0 8px 28px -18px rgba(15, 30, 60, 0.14);
}

/* ── Line items ── */
.at-cart-items {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.at-cart-item {
	display: grid;
	/* Media (right) | body (name/trust) | meta (price/qty/subtotal) */
	grid-template-columns: 104px minmax(0, 1fr) minmax(0, 1.1fr);
	gap: 0 1.25rem;
	padding: 1rem 1.15rem;
	border: 1px solid #edf2f7;
	border-radius: 12px;
	background: linear-gradient(180deg, #fff 0%, #fafcfd 100%);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	align-items: stretch;
}

.at-cart-item:hover {
	border-color: #d7e8f0;
	box-shadow: 0 6px 20px -14px rgba(30, 189, 227, 0.35);
}

.at-cart-item__media {
	align-self: start;
}

.at-cart-item__thumb-link {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	background: #f8fafc;
	border: 1px solid #edf2f7;
}

.at-cart-item__thumb,
.at-cart-item__media img {
	display: block;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 1;
	object-fit: contain;
	padding: 0.35rem;
	box-sizing: border-box;
}

.at-cart-item__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
}

.at-cart-item__name {
	margin: 0;
	font-size: 0.75rem !important;
	font-weight: 600 !important;
	line-height: 1.25 !important;
	color: #193348;
	letter-spacing: 0;
}

body.at-cart-page .at-cart-item__name {
	font-size: 0.75rem !important;
}

.at-cart-item__name a {
	color: inherit;
	text-decoration: none;
	font-size: inherit !important;
	font-weight: inherit !important;
	line-height: inherit !important;
}

.at-cart-item__name a:hover {
	color: #00a0d7;
}

.at-cart-item__remove .remove {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: #fff5f5;
	color: #e62c2c !important;
	font-size: 1.35rem;
	line-height: 1;
	text-decoration: none !important;
	border: 1px solid #fecaca;
	transition: background 0.15s ease, transform 0.15s ease;
}

.at-cart-item__remove .remove:hover {
	background: #fee2e2;
	transform: scale(1.05);
}

.at-cart-item .variation,
.at-cart-item dl {
	margin: 0 0 0.5rem;
	font-size: 0.8rem;
	color: #64748b;
}

.at-cart-item__trust {
	margin: 0 0 0.65rem;
	padding: 0.4rem 0.55rem;
	border-radius: 8px;
	background: #e8f7fb;
	color: #475569;
	font-size: 0.7rem;
	font-weight: 600;
	line-height: 1.45;
}

.at-cart-item__body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.at-cart-item__meta {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	padding-inline-start: 1.25rem;
	border-inline-start: 1px solid #e2e8f0;
	min-width: 0;
}

.at-cart-item__meta-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 1.25rem;
	align-items: start;
}

.at-cart-item__field {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
	min-width: 0;
}

.at-cart-item__price .at-cart-item__value,
.at-cart-item__qty .at-cart-item__value {
	display: flex;
	align-items: center;
	min-height: 28px;
}

.at-cart-item__value {
	font-weight: 600;
	color: #193348;
	font-size: 0.9rem;
	line-height: 1.2;
	min-width: 0;
}

.at-cart-item__subtotal {
	padding-top: 0.55rem;
	border-top: 1px solid #edf2f7;
}

.at-cart-item__subtotal .at-cart-item__value,
.at-cart-item__subtotal .amount {
	color: #00a0d7;
	font-weight: 700;
	font-size: 0.95rem;
}

.at-cart-item__label {
	display: block;
	margin: 0;
	font-size: 0.75rem;
	font-weight: 500;
	color: #64748b;
	text-transform: none;
	letter-spacing: 0;
}

/* Compact qty stepper for cart */
.at-cart-item__qty .quantity {
	display: inline-flex;
	align-items: center;
	height: 28px;
	border: 1px solid #cfd8e3;
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
}

.at-cart-item__qty .quantity label {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.at-cart-item__qty .at-cart-qty-btn {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 1.65rem;
	width: 1.65rem;
	height: 100%;
	border: 0;
	background: transparent;
	color: #64748b;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	padding: 0;
	cursor: pointer;
	user-select: none;
}

.at-cart-item__qty .at-cart-qty-btn:hover {
	color: #193348;
	background: #f4f7fa;
}

.at-cart-item__qty .quantity .qty {
	flex: 0 0 2rem;
	width: 2rem;
	height: 100%;
	min-height: 0;
	border: 0;
	border-inline: 1px solid #e2e8f0;
	text-align: center;
	font-weight: 600;
	font-size: 0.8125rem;
	color: #193348;
	background: transparent;
	padding: 0;
	margin: 0;
	box-shadow: none;
	-moz-appearance: textfield;
	border-radius: 0;
}

.at-cart-item__qty .quantity .qty:focus {
	outline: none;
}

.at-cart-item__qty .quantity .qty::-webkit-outer-spin-button,
.at-cart-item__qty .quantity .qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Form actions removed - cart auto-updates on qty change */

/* ── Sidebar totals ── */
.at-cart-collaterals {
	width: 100%;
	float: none !important;
}

.at-cart-sidebar .cart_totals {
	width: 100% !important;
	max-width: none !important;
	float: none !important;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 1.35rem 1.5rem 1.5rem;
	box-shadow: 0 8px 28px -18px rgba(15, 30, 60, 0.14);
	position: sticky;
	top: 1rem;
	overflow: hidden;
	box-sizing: border-box;
}

/* WooCommerce sets some cart/table widths (e.g. 70%) via block theme CSS. */
.at-cart-sidebar .cart_totals .shop_table,
.at-cart-sidebar .cart_totals .shop_table_responsive {
	width: 100% !important;
	max-width: 100% !important;
}

.at-cart-totals__title {
	margin: 0 0 1rem;
	font-size: 1.35rem;
	font-weight: 800;
	color: #193348;
}

.at-cart-totals__table {
	width: 100%;
	border: 0;
	margin: 0;
	border-collapse: collapse;
	font-size: 1rem;
}

.at-cart-totals__table th,
.at-cart-totals__table td {
	padding: 0.7rem 0;
	border: 0;
	border-bottom: 1px solid #edf2f7;
	text-align: right;
	vertical-align: middle;
}

.at-cart-totals__table th {
	font-weight: 600;
	font-size: 0.95rem;
	color: #64748b;
}

.at-cart-totals__table td {
	font-weight: 700;
	font-size: 1rem;
	color: #193348;
}

.at-cart-totals__table .order-total th,
.at-cart-totals__table .order-total td {
	border-bottom: 0;
	border-top: 2px solid #e2e8f0;
	padding-top: 1rem;
	font-size: 1.2rem;
	font-weight: 800;
	color: #193348;
}

.at-cart-totals__table .order-total td .amount {
	color: #00a0d7;
}

.at-cart-proceed {
	margin-top: 1.25rem;
	padding: 0;
	overflow: hidden;
}

body.at-cart-page .wc-proceed-to-checkout {
	margin: 0;
	padding: 0;
}

.at-cart-checkout-btn,
body.at-cart-page .wc-proceed-to-checkout .checkout-button {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	text-align: center !important;
	margin: 0 !important;
	min-height: 52px !important;
	border-radius: 12px !important;
	background: linear-gradient(135deg, #1ebde3 0%, #00a0d7 100%) !important;
	color: #fff !important;
	font-weight: 800 !important;
	font-size: 1.05rem !important;
	line-height: 1.25 !important;
	border: 0 !important;
	padding: 0.8rem 1rem !important;
	text-decoration: none !important;
	white-space: normal;
	word-break: break-word;
	box-shadow: 0 10px 24px -12px rgba(30, 189, 227, 0.65);
	transition: box-shadow 0.15s ease !important;
	float: none !important;
}

.at-cart-checkout-btn:hover,
body.at-cart-page .wc-proceed-to-checkout .checkout-button:hover {
	box-shadow: 0 14px 28px -10px rgba(30, 189, 227, 0.75);
	color: #fff !important;
	transform: none;
}

/* ── Empty cart ── */
.at-cart-shell--empty {
	padding-bottom: 3rem;
}

.at-cart-empty {
	max-width: 520px;
	margin: 2rem auto 0;
	padding: 2.5rem 1.5rem;
	text-align: center;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 12px 40px -20px rgba(15, 30, 60, 0.16);
}

.at-cart-empty__icon {
	margin-bottom: 1rem;
}

.at-cart-empty__title {
	margin: 0 0 0.65rem;
	font-size: 1.75rem;
	font-weight: 800;
	color: #193348;
}

.at-cart-empty__text {
	margin: 0 0 1.5rem;
	font-size: 0.95rem;
	line-height: 1.55;
	color: #64748b;
}

.at-cart-empty .woocommerce-info,
.at-cart-empty .cart-empty {
	display: none !important;
}

.at-cart-empty__actions {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	align-items: center;
}

.at-cart-empty__cta {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 220px;
	min-height: 48px !important;
	border-radius: 12px !important;
	background: linear-gradient(135deg, #ffc93c 0%, #f5b800 100%) !important;
	color: #193348 !important;
	font-weight: 800 !important;
	font-size: 1rem !important;
	border: 0 !important;
	text-decoration: none !important;
	box-shadow: 0 10px 24px -12px rgba(255, 201, 60, 0.8);
	transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.at-cart-empty__cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 28px -10px rgba(255, 201, 60, 0.9);
	color: #193348 !important;
}

.at-cart-empty__secondary {
	font-size: 0.875rem;
	font-weight: 600;
	color: #00a0d7;
	text-decoration: none;
}

.at-cart-empty__secondary:hover {
	color: #193348;
	text-decoration: underline;
}

/* Cross-sells hidden on cart for cleaner UX */
body.at-cart-page .cross-sells {
	display: none !important;
}

/* ── Responsive ── */
@media (min-width: 901px) {
	.at-cart-topbar {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.at-cart-logo img {
		margin-inline: 0;
	}

	.at-cart-topbar__badges {
		width: auto;
		flex: 1;
		max-width: 680px;
	}
}

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

	.at-cart-sidebar .cart_totals {
		position: static;
	}

	.at-cart-topbar .at-trust-strip {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.at-cart-item {
		grid-template-columns: 72px minmax(0, 1fr);
		grid-template-rows: auto auto;
		gap: 0.75rem;
		padding: 0.85rem;
	}

	.at-cart-item__meta {
		grid-column: 1 / -1;
		border-inline-start: 0;
		border-top: 1px solid #e2e8f0;
		padding-inline-start: 0;
		padding-top: 0.85rem;
	}

	.at-cart-item__meta-row {
		grid-template-columns: 1fr 1fr;
		gap: 0.75rem;
	}

	.at-cart-item__field {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		width: 100%;
	}

	.at-cart-item__subtotal {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}
