/**
 * Modern Cart Page Styles
 * 
 * Stunning card-based layout for WooCommerce cart page
 * Scoped to cart pages only (body.woocommerce-cart or body.rt-cart-modern)
 * 
 * @package RinnoTools
 * @version 1.0.2
 */

/* ============================================
   HEADER NORMALIZATION (CRITICAL)
   ============================================ */

/* Ensure header is NOT affected by cart-specific CSS */
/* Reset any potential overrides to maintain consistency with other pages */
body.woocommerce-cart .site__header,
body.rt-cart-modern .site__header {
	/* Preserve default flex behavior */
	flex-shrink: 0;
	/* Ensure no margin/padding overrides */
	margin: 0;
	padding: 0;
	/* Ensure no transform/opacity/filter overrides */
	transform: none;
	opacity: 1;
	filter: none;
	/* Ensure no position overrides (sticky should work normally) */
	position: relative;
	/* Ensure no z-index overrides */
	z-index: inherit;
	/* Ensure no background overrides */
	background: inherit;
	/* Ensure no box-shadow overrides */
	box-shadow: none;
	/* Ensure no width/height overrides */
	width: auto;
	height: auto;
	min-width: 0;
	min-height: 0;
}

/* Ensure site-header inside site__header is not affected */
body.woocommerce-cart .site__header .site-header,
body.rt-cart-modern .site__header .site-header {
	/* Preserve default styles from static/css/style.css */
	position: relative;
	z-index: 100;
	background: transparent;
	color: inherit;
	/* Ensure no overrides */
	margin: 0;
	padding: 0;
	transform: none;
	opacity: 1;
	filter: none;
	box-shadow: none;
}

/* Ensure topbar is not affected */
body.woocommerce-cart .site__header .topbar,
body.rt-cart-modern .site__header .topbar {
	/* Preserve default topbar styles */
	height: 32px;
	background: #f7f7f7;
	box-shadow: none;
	border-bottom: none;
	position: relative;
	z-index: 20;
	/* Ensure no overrides */
	margin: 0;
	padding: 0;
	transform: none;
	opacity: 1;
	filter: none;
}

/* Ensure site-header__middle is not affected */
body.woocommerce-cart .site__header .site-header__middle,
body.rt-cart-modern .site__header .site-header__middle {
	/* Preserve default height */
	height: 104px;
	/* Preserve default flex display */
	display: flex;
	align-items: center;
	/* Ensure no overrides */
	margin: 0;
	transform: none;
	opacity: 1;
	filter: none;
	width: auto;
	min-width: 0;
}

/* Ensure header logo is not affected */
body.woocommerce-cart .site__header .site-header__logo,
body.rt-cart-modern .site__header .site-header__logo {
	/* Preserve default styles */
	width: 255px;
	margin-right: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	/* Ensure no overrides */
	margin-top: 0;
	margin-bottom: 0;
	margin-left: 0;
	padding: 0;
	transform: none;
	opacity: 1;
	filter: none;
}

/* Ensure header search is not affected */
body.woocommerce-cart .site__header .site-header__search,
body.rt-cart-modern .site__header .site-header__search {
	/* Preserve default flex grow */
	flex-grow: 1;
	/* Ensure no overrides */
	margin: 0;
	padding: 0;
	width: auto;
	min-width: 0;
}

/* Ensure header phone is not affected */
body.woocommerce-cart .site__header .site-header__phone,
body.rt-cart-modern .site__header .site-header__phone {
	/* Preserve default styles */
	line-height: 1;
	text-align: right;
	margin-left: 80px;
	/* Ensure no overrides */
	margin-top: 0;
	margin-bottom: 0;
	margin-right: 0;
	padding: 0;
}

/* Ensure header nav-panel is not affected */
body.woocommerce-cart .site__header .site-header__nav-panel,
body.rt-cart-modern .site__header .site-header__nav-panel {
	/* Preserve default height */
	height: 54px;
	/* Ensure no overrides */
	margin: 0;
	padding: 0;
	width: auto;
}

/* ============================================
   CONTAINER NORMALIZATION (CRITICAL)
   ============================================ */

/* Override theme container restrictions on cart page */
/* IMPORTANT: These selectors are scoped to content areas, NOT header */
body.woocommerce-cart .entry-content,
body.rt-cart-modern .entry-content,
body.woocommerce-cart .page-content,
body.rt-cart-modern .page-content,
body.woocommerce-cart .site-main,
body.rt-cart-modern .site-main,
body.woocommerce-cart .site-main .container,
body.rt-cart-modern .site-main .container,
body.woocommerce-cart .page-header .container,
body.rt-cart-modern .page-header .container {
	max-width: none !important;
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Ensure site__body doesn't restrict width */
body.woocommerce-cart .site__body,
body.rt-cart-modern .site__body {
	max-width: none;
	width: 100%;
}

/* Page header container override for cart */
body.woocommerce-cart .page-header,
body.rt-cart-modern .page-header {
	max-width: 100%;
}

body.woocommerce-cart .page-header .page-header__container,
body.rt-cart-modern .page-header .page-header__container {
	max-width: 1200px !important;
	margin: 0 auto;
	padding: 0 24px;
	width: 100% !important;
	box-sizing: border-box;
}

/* Allow overflow for sticky positioning */
body.woocommerce-cart .site-content,
body.rt-cart-modern .site-content,
body.woocommerce-cart .site__body,
body.rt-cart-modern .site__body {
	overflow: visible;
}

/* ============================================
   HEADER NORMALIZATION (CRITICAL)
   ============================================ */

/* Ensure header maintains exact same styling on cart page as other pages */
/* Reset any potential overrides from cart-specific CSS */
body.woocommerce-cart .site__header,
body.rt-cart-modern .site__header {
	/* Preserve flex behavior */
	-ms-flex-negative: 0;
	flex-shrink: 0;
	/* Ensure no margin/padding overrides */
	margin: 0;
	padding: 0;
	/* Ensure no transform/opacity/filter overrides */
	transform: none;
	opacity: 1;
	filter: none;
	/* Ensure proper positioning context */
	position: relative;
}

/* Preserve header inner container styling */
body.woocommerce-cart .site__header .site-header,
body.rt-cart-modern .site__header .site-header {
	position: relative;
	z-index: 100;
	background: transparent;
	color: inherit;
	/* Ensure no margin/padding overrides */
	margin: 0;
	padding: 0;
}

/* Preserve header middle container - CRITICAL: Override cart container rules */
body.woocommerce-cart .site__header .site-header__middle.container,
body.rt-cart-modern .site__header .site-header__middle.container {
	/* Restore normal container behavior */
	max-width: 1200px !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	/* Restore Bootstrap default container padding (15px) */
	padding-left: 15px !important;
	padding-right: 15px !important;
	box-sizing: border-box !important;
	/* Preserve height */
	height: 104px;
	/* Preserve flex layout */
	display: -ms-flexbox;
	display: flex;
	-ms-flex-align: center;
	align-items: center;
}

/* Preserve topbar container styling */
body.woocommerce-cart .site__header .topbar .topbar__container,
body.rt-cart-modern .site__header .topbar .topbar__container,
body.woocommerce-cart .site__header .topbar__container,
body.rt-cart-modern .site__header .topbar__container {
	/* Restore normal container behavior if it uses container class */
	max-width: 1200px !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	/* Restore Bootstrap default container padding (15px) */
	padding-left: 15px !important;
	padding-right: 15px !important;
	box-sizing: border-box !important;
	height: 100%;
}

/* Ensure sticky header behavior is preserved */
/* body.woocommerce-cart .site__header.site-header--sticky,
body.rt-cart-modern .site__header.site-header--sticky {
	position: sticky;
	top: 0;
	z-index: 100;
} */

/* Ensure header background and shadow are preserved */
body.woocommerce-cart .site__header .site-header,
body.rt-cart-modern .site__header .site-header {
	/* Background should be inherited from theme or ACF settings */
	/* If header has background color from ACF, it will be applied via inline styles */
	/* Ensure no cart CSS removes it */
	background-color: inherit;
	box-shadow: inherit;
}

/* ============================================
   CART PAGE CONTAINER
   ============================================ */

.cart-modern-page {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	position: relative;
}

.cart-modern-container {
	width: 100% !important;
	max-width: 1200px !important;
	margin: 0 auto !important;
	padding: 0 24px !important;
	box-sizing: border-box;
	position: relative;
}

/* Ensure cart-modern-container is not restricted by parent */
body.woocommerce-cart .cart-modern-container,
body.rt-cart-modern .cart-modern-container,
body.woocommerce-cart .cart-modern-page .cart-modern-container,
body.rt-cart-modern .cart-modern-page .cart-modern-container {
	max-width: 1200px !important;
	width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

@media (max-width: 767px) {
	.cart-modern-container {
		padding: 0 16px;
	}
}

/* ============================================
   CART MODERN LAYOUT
   ============================================ */

.cart-modern {
	margin-top: 2rem;
	margin-bottom: 3rem;
	width: 100%;
	position: relative;
	display: block;
}

.cart-modern__form {
	width: 100%;
	display: block;
}

.cart-modern__layout {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) 380px !important;
	gap: 24px !important;
	align-items: start;
	margin-bottom: 2rem;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	position: relative;
	clear: both;
}

@media (max-width: 991px) {
	.cart-modern__layout {
		grid-template-columns: 1fr !important;
		gap: 1.5rem;
	}
	
	.cart-modern__summary {
		position: static !important;
		top: auto !important;
	}
}

/* ============================================
   CART ITEMS (LEFT COLUMN)
   ============================================ */

.cart-modern__items {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	width: 100%;
	min-width: 0; /* Allow flex shrinking */
}

/* Cart Item Card */
.cart-item-card {
	display: flex;
	gap: 1.25rem;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 1.5rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: all 0.2s ease;
	width: 100%;
}

.cart-item-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

/* Thumbnail */
.cart-item-card__thumb {
	flex-shrink: 0;
	width: 120px;
	height: 120px;
	border-radius: 12px;
	overflow: hidden;
	background: #f9fafb;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cart-item-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (max-width: 575px) {
	.cart-item-card__thumb {
		width: 90px;
		height: 90px;
	}
}

/* Main Content */
.cart-item-card__main {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	min-width: 0; /* Allow text truncation */
}

/* Top: Title + Remove */
.cart-item-card__top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
}

.cart-item-card__title {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.4;
	flex: 1;
}

.cart-item-card__title a {
	color: #1f2937;
	text-decoration: none;
	transition: color 0.2s ease;
}

.cart-item-card__title a:hover {
	color: #3b82f6;
}

.cart-item-card__remove {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #f3f4f6;
	color: #6b7280;
	font-size: 22px;
	line-height: 1;
	text-decoration: none !important;
	transition: all 0.2s ease;
	flex-shrink: 0;
	cursor: pointer;
}

.cart-item-card__remove:hover {
	background: #fee2e2;
	color: #dc2626;
	transform: scale(1.1);
}

/* Meta: Variation attributes, stock */
.cart-item-card__meta {
	font-size: 0.875rem;
	color: #6b7280;
	line-height: 1.5;
}

.cart-item-card__meta ul.cart-table__options {
	list-style: none;
	padding: 0;
	margin: 0;
}

.cart-item-card__meta ul.cart-table__options li {
	margin-bottom: 0.25rem;
}

.cart-item-card__meta ul.cart-table__options li strong {
	font-weight: 600;
	color: #4b5563;
}

.cart-item-card__backorder {
	font-size: 0.875rem;
	color: #f59e0b;
	margin-top: 0.5rem;
}

/* Bottom: Price, Quantity, Total (2x2 Grid Layout) */
.cart-item-card__bottom {
	padding-top: 0.75rem;
	border-top: 1px solid #f3f4f6;
}

.cart-item-card__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-areas:
		"price quantity"
		"total total";
	gap: 16px 24px;
	align-items: start;
}

/* Grid areas */
.cart-item-card__price {
	grid-area: price;
}

.cart-item-card__qty {
	grid-area: quantity;
	align-items: end;
}

.cart-item-card__total {
	align-items: end;
	grid-area: total;
	padding-top: 12px;
	border-top: 1px solid #f3f4f6;
}

/* Cell wrapper */
.cart-item-card__cell {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* Responsive: Stack on mobile */
@media (max-width: 600px) {
	.cart-item-card__grid {
		grid-template-columns: 1fr;
		grid-template-areas:
			"price"
			"quantity"
			"total";
		gap: 16px;
	}
	
	.cart-item-card__total {
		padding-top: 12px;
		border-top: 1px dashed #e5e7eb;
	}
}

.cart-item-card__label {
	display: block;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #9ca3af;
	margin-bottom: 6px;
	font-weight: 500;
	line-height: 1.2;
}

.cart-item-card__value {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: #1f2937;
	line-height: 1.4;
}

/* Price */
.cart-item-card__price .cart-item-card__value {
	color: #3b82f6;
}

/* Legacy support for WooCommerce default del/ins tags */
.cart-item-card__price .cart-item-card__value del {
	color: #9ca3af;
	font-weight: 400;
	margin-right: 0.5rem;
}

.cart-item-card__price .cart-item-card__value ins {
	text-decoration: none;
	color: #dc2626;
	font-weight: 600;
}

/* Modern price display with custom classes */
.cart-item-card__value .price {
	display: inline-block;
	line-height: 1.4;
	vertical-align: middle;
}

/* Regular price (no sale) */
.cart-item-card__value .price--regular {
	color: #1f2937;
	font-weight: 600;
	font-size: 1rem;
}

/* Sale price container */
.cart-item-card__value .price--sale {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	align-items: flex-start;
}

/* Regular price (when on sale) - strikethrough */
.cart-item-card__value .price__regular {
	display: block;
	font-size: 0.875rem;
	font-weight: 400;
	color: #9ca3af;
	text-decoration: line-through;
	line-height: 1.2;
	opacity: 0.8;
}

/* Sale price - emphasized */
.cart-item-card__value .price__sale {
	display: block;
	font-size: 1rem;
	font-weight: 700;
	color: #dc2626;
	line-height: 1.2;
}

/* Horizontal layout for sale prices on larger screens */
@media (min-width: 480px) {
	.cart-item-card__value .price--sale {
		flex-direction: row;
		align-items: center;
		gap: 0.5rem;
	}
	
	.cart-item-card__value .price__regular {
		font-size: 0.9375rem;
		margin-right: 0;
	}
	
	.cart-item-card__value .price__sale {
		font-size: 1.125rem;
	}
}

/* Ensure WooCommerce price formatting is preserved */
.cart-item-card__value .price .woocommerce-Price-amount {
	font-weight: inherit;
	color: inherit;
}

.cart-item-card__value .price__sale .woocommerce-Price-amount {
	font-weight: 700;
	color: #dc2626;
}

.cart-item-card__value .price__regular .woocommerce-Price-amount {
	font-weight: 400;
	color: #9ca3af;
}

/* Quantity Stepper - Premium Layout */
.cart-item-card__qty-control {
	display: inline-flex;
	align-items: center;
}

.cart-item-card__qty-control .input-number {
	display: inline-flex;
	align-items: center;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
	height: 44px;
	background: #ffffff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	width: auto;
}

/* Focus state */
.cart-item-card__qty-control .input-number:focus-within {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Quantity step buttons (+/-) */
.cart-item-card__qty-control .qty-step {
	width: 44px;
	height: 44px;
	min-width: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	user-select: none;
	padding: 0;
	margin: 0;
	color: #4b5563;
	transition: background-color 0.2s ease, color 0.2s ease;
	flex-shrink: 0;
}

.cart-item-card__qty-control .qty-step span {
	display: block;
	font-weight: 600;
	line-height: 1;
}

.cart-item-card__qty-control .qty-step:hover {
	background-color: #f3f4f6;
	color: #1f2937;
}

.cart-item-card__qty-control .qty-step:active {
	background-color: #e5e7eb;
}

/* Disabled state */
.cart-item-card__qty-control .qty-step:disabled,
.cart-item-card__qty-control .qty-step.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

/* Quantity input wrapper */
.cart-item-card__qty-control .qty-input {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 64px;
}

/* Quantity input field */
.cart-item-card__qty-control .qty-input input.qty {
	width: 64px;
	height: 44px;
	border: 0;
	outline: 0;
	margin: 0;
	padding: 0;
	text-align: center;
	font-weight: 600;
	font-size: 1rem;
	background: transparent;
	color: #1f2937;
	appearance: textfield; /* Standard: remove spinner */
	-moz-appearance: textfield; /* Firefox: remove spinner */
}

/* Remove spinner arrows in Chrome/Safari */
.cart-item-card__qty-control .qty-input input.qty::-webkit-outer-spin-button,
.cart-item-card__qty-control .qty-input input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.cart-item-card__qty-control .qty-input input.qty:focus {
	outline: none;
}

/* Responsive: smaller input on mobile */
@media (max-width: 480px) {
	.cart-item-card__qty-control .qty-input {
		min-width: 56px;
	}
	
	.cart-item-card__qty-control .qty-input input.qty {
		width: 56px;
		font-size: 0.9375rem;
	}
}

/* Hide any WooCommerce default quantity buttons if they exist */
body.woocommerce-cart .cart-item-card__qty-control .quantity .minus,
body.woocommerce-cart .cart-item-card__qty-control .quantity .plus,
body.woocommerce-cart .cart-item-card__qty-control .input-number__add:not(.qty-step),
body.woocommerce-cart .cart-item-card__qty-control .input-number__sub:not(.qty-step) {
	display: none !important;
}

/* Loading state for cart item during AJAX update */
.cart-item-card.is-updating {
	opacity: 0.7;
	pointer-events: none;
	position: relative;
}

.cart-item-card.is-updating::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.8);
	border-radius: 12px;
	z-index: 1;
}

/* Shake animation for max quantity feedback */
@keyframes shake {
	0%, 100% { transform: translateX(0); }
	10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
	20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.qty-max-reached {
	animation: shake 0.5s ease-in-out;
	border-color: #dc2626 !important;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Error message styling */
.cart-item-card__error {
	color: #dc2626;
	font-size: 0.875rem;
	margin-top: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: #fee2e2;
	border: 1px solid #fca5a5;
	border-radius: 6px;
}

/* ============================================
   REMOVE CART ITEM AJAX STATES
   ============================================ */

/* Loading state for remove action */
.cart-item-card.is-removing {
	position: relative;
	opacity: 0.7;
	pointer-events: none;
}

.cart-item-card.is-removing::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 12px;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cart-item-card.is-removing::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 32px;
	height: 32px;
	border: 3px solid #e5e7eb;
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	z-index: 11;
}

@keyframes spin {
	from {
		transform: translate(-50%, -50%) rotate(0deg);
	}
	to {
		transform: translate(-50%, -50%) rotate(360deg);
	}
}

/* Disabled remove button */
.cart-item-card__remove[aria-disabled="true"] {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* Fade out animation for removed item */
.cart-item-card {
	transition: opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease, padding 0.3s ease, height 0.3s ease;
}

/* Total value - emphasized */
.cart-item-card__total-value {
	font-size: 18px;
	font-weight: 700;
	color: #1f2937;
	line-height: 1.2;
}

/* Legacy support for old class name */
.cart-item-card__total .cart-item-card__value {
	font-size: 18px;
	font-weight: 700;
	color: #1f2937;
}

/* ============================================
   CART SUMMARY (RIGHT COLUMN - STICKY)
   ============================================ */

.cart-modern__summary {
	position: sticky;
	top: calc(var(--header-offset, 90px) + 1rem);
	align-self: start;
	width: 100%;
	max-width: 380px;
}

.cart-summary-card {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 1.5rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	width: 100%;
}

.cart-summary-card__title {
	margin: 0 0 1.25rem 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: #1f2937;
	padding-bottom: 1rem;
	border-bottom: 2px solid #f3f4f6;
}

.cart-summary-card__totals {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.cart-summary-card__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.9375rem;
}

.cart-summary-card__label {
	color: #6b7280;
	font-weight: 500;
}

.cart-summary-card__value {
	color: #1f2937;
	font-weight: 600;
	text-align: right;
}

.cart-summary-card__row--subtotal {
	font-size: 1rem;
}

.cart-summary-card__row--total {
	padding-top: 1rem;
	margin-top: 0.5rem;
	border-top: 2px solid #f3f4f6;
	font-size: 1.125rem;
}

.cart-summary-card__row--total .cart-summary-card__label,
.cart-summary-card__row--total .cart-summary-card__value {
	font-weight: 700;
	color: #1f2937;
}

.cart-summary-card__row--discount .cart-summary-card__value {
	color: #059669;
}

.cart-summary-card__calc-shipping {
	margin-top: 0.5rem;
}

.cart-summary-card__calc-shipping a {
	color: #3b82f6;
	text-decoration: none;
	font-size: 0.875rem;
}

.cart-summary-card__calc-shipping a:hover {
	text-decoration: underline;
}

/* Shipping methods list */
.cart-summary-card__value .woocommerce-shipping-methods {
	list-style: none;
	padding: 0;
	margin: 0;
}

.cart-summary-card__value .woocommerce-shipping-methods li {
	margin-bottom: 0.5rem;
}

.cart-summary-card__value .woocommerce-shipping-methods label {
	margin-left: 0.5rem;
	cursor: pointer;
	font-weight: 500;
}

.cart-summary-card__value .woocommerce-shipping-destination {
	font-size: 0.875rem;
	color: #6b7280;
	margin-top: 0.5rem;
}

/* Checkout Button */
.cart-summary-card__checkout {
	margin-bottom: 1rem;
}

.cart-summary-card__checkout-btn {
	width: 100%;
	padding: 0.875rem 1.5rem;
	font-size: 1rem;
	font-weight: 600;
	border-radius: 10px;
	transition: all 0.2s ease;
	display: block;
	text-align: center;
	text-decoration: none;
}

.cart-summary-card__checkout-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
	text-decoration: none;
}

/* Coupon Accordion - Modern UI */
.cart-summary-card__coupon {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #f3f4f6;
	background: #f9fafb;
	border-radius: 12px;
	padding: 0.75rem;
	margin-left: -0.75rem;
	margin-right: -0.75rem;
	padding-left: 0.75rem;
	padding-right: 0.75rem;
	transition: all 0.3s ease;
}

.cart-summary-card__coupon:hover {
	background: #f3f4f6;
}

.cart-summary-card__coupon[open] {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.cart-summary-card__coupon-toggle {
	cursor: pointer;
	color: #3b82f6;
	font-size: 0.9375rem;
	font-weight: 600;
	list-style: none;
	padding: 0.5rem 0;
	transition: color 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	user-select: none;
}

.cart-summary-card__coupon-toggle::-webkit-details-marker {
	display: none;
}

.cart-summary-card__coupon-toggle:hover {
	color: #2563eb;
}

.cart-summary-card__coupon-toggle-text {
	flex: 1;
}

.cart-summary-card__coupon-toggle-icon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	color: currentColor;
	transition: transform 0.3s ease;
}

.cart-summary-card__coupon[open] .cart-summary-card__coupon-toggle-icon {
	transform: rotate(180deg);
}

.cart-summary-card__coupon[open] .cart-summary-card__coupon-toggle {
	color: #1f2937;
}

.cart-summary-card__coupon-form {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid #f3f4f6;
}

/* Applied Coupons List */
.cart-summary-card__coupon-applied {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e5e7eb;
}

.cart-summary-card__coupon-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: #dcfce7;
	border: 1px solid #86efac;
	border-radius: 8px;
	padding: 0.375rem 0.625rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #166534;
}

.cart-summary-card__coupon-badge-code {
	flex: 1;
}

.cart-summary-card__coupon-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #166534;
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.cart-summary-card__coupon-remove:hover {
	background: #bbf7d0;
	color: #14532d;
}

.cart-summary-card__coupon-remove:active {
	background: #86efac;
}

.cart-summary-card__coupon-remove svg {
	width: 14px;
	height: 14px;
}

/* Coupon Form */
.cart-summary-card__coupon-form {
	padding-top: 0.75rem;
}

.cart-summary-card__coupon-form-inner {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.cart-summary-card__coupon-input-wrapper {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

@media (min-width: 480px) {
	.cart-summary-card__coupon-input-wrapper {
		flex-direction: row;
		gap: 0.5rem;
	}
}

.cart-summary-card__coupon-input {
	flex: 1;
	padding: 0.625rem 0.875rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 0.9375rem;
	background: #ffffff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	min-width: 0;
}

.cart-summary-card__coupon-input:focus {
	border-color: #3b82f6;
	outline: none;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.cart-summary-card__coupon-submit {
	flex-shrink: 0;
	padding: 0.625rem 1.25rem;
	font-size: 0.9375rem;
	font-weight: 600;
	border-radius: 8px;
	white-space: nowrap;
	min-width: 100px;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	transition: all 0.2s ease;
}

@media (min-width: 480px) {
	.cart-summary-card__coupon-submit {
		min-width: 90px;
	}
}

.cart-summary-card__coupon-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	pointer-events: none;
}

.cart-summary-card__coupon-submit-spinner {
	display: none;
	width: 16px;
	height: 16px;
	animation: spin 0.8s linear infinite;
}

.cart-summary-card__coupon-submit.is-loading .cart-summary-card__coupon-submit-text {
	opacity: 0;
}

.cart-summary-card__coupon-submit.is-loading .cart-summary-card__coupon-submit-spinner {
	display: block;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

@keyframes spin {
	from {
		transform: translate(-50%, -50%) rotate(0deg);
	}
	to {
		transform: translate(-50%, -50%) rotate(360deg);
	}
}

/* Coupon Notices */
.cart-summary-card__coupon-notices {
	margin-top: 0.5rem;
	font-size: 0.875rem;
}

.cart-summary-card__coupon-notices .woocommerce-message,
.cart-summary-card__coupon-notices .woocommerce-error,
.cart-summary-card__coupon-notices .woocommerce-info {
	margin: 0;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	font-size: 0.875rem;
	line-height: 1.4;
}

.cart-summary-card__coupon-notices .woocommerce-message {
	background: #dcfce7;
	color: #166534;
	border: 1px solid #86efac;
}

.cart-summary-card__coupon-notices .woocommerce-error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}

/* ============================================
   CART ACTIONS (BOTTOM)
   ============================================ */

.cart-modern__actions {
	display: flex;
	gap: 1rem;
	justify-content: flex-start;
	padding-top: 1.5rem;
	border-top: 1px solid #e5e7eb;
	width: 100%;
}

@media (max-width: 575px) {
	.cart-modern__actions {
		flex-direction: column;
	}
	
	.cart-modern__actions .btn {
		width: 100%;
	}
}

.cart-modern__actions .btn {
	padding: 0.75rem 1.5rem;
	border-radius: 8px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.cart-modern__actions .btn-light {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	color: #374151;
}

.cart-modern__actions .btn-light:hover {
	background: #f3f4f6;
	border-color: #d1d5db;
	text-decoration: none;
}

.cart-modern__actions .btn-outline {
	background: transparent;
	border: 1px solid #3b82f6;
	color: #3b82f6;
}

.cart-modern__actions .btn-outline:hover {
	background: #3b82f6;
	color: #ffffff;
	text-decoration: none;
}

/* ============================================
   EMPTY CART STATE
   ============================================ */

.cart-modern .cart-empty {
	text-align: center;
	padding: 4rem 1.5rem;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	margin: 2rem auto;
	max-width: 600px;
	width: 100%;
}

.cart-modern .cart-empty__icon {
	font-size: 5rem;
	color: #d1d5db;
	margin-bottom: 1.5rem;
	display: block;
	line-height: 1;
}

.cart-modern .cart-empty__message {
	font-size: 1.25rem;
	color: #6b7280;
	margin-bottom: 2rem;
	font-weight: 500;
}

.cart-modern .cart-empty__button {
	display: inline-block;
	padding: 0.875rem 2rem;
	border-radius: 10px;
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	transition: all 0.2s ease;
	background: #3b82f6;
	color: #ffffff;
	border: none;
}

.cart-modern .cart-empty__button:hover {
	background: #2563eb;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
	text-decoration: none;
	color: #ffffff;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 991px) {
	.cart-modern__layout {
		gap: 1.5rem;
	}
	
	.cart-modern__summary {
		max-width: 100%;
	}
	
	.cart-summary-card {
		order: 2;
	}
	
	.cart-modern__items {
		order: 1;
	}
}

@media (max-width: 767px) {
	.cart-item-card {
		flex-direction: column;
		padding: 1rem;
	}
	
	.cart-item-card__thumb {
		width: 100%;
		height: 200px;
	}
	
	.cart-item-card__bottom {
		grid-template-columns: 1fr;
	}
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */

.cart-item-card__remove:focus,
.cart-item-card__qty-control .input-number__add:focus,
.cart-item-card__qty-control .input-number__sub:focus,
.cart-modern__actions .btn:focus,
.cart-summary-card__checkout-btn:focus {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
}

.cart-item-card__qty-control .input-number__input:focus {
	outline: 2px solid #3b82f6;
	outline-offset: -2px;
}

/* Screen reader only */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}
