/* ===================================================================== */
/* Cart Page Styles - vccsell Theme                                     */
/* Modern, responsive design with animations and gradients              */
/* Enhanced Mobile-First Responsive Design                              */
/* ===================================================================== */

/* VCC Sell - Cart Page Styles */
/* Clean and minimal cart design */

.vccsell-cart-page {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1rem;
	background: var(--bg-color, #fff);
	color: var(--text-color, #333);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	min-height: calc(100vh - 120px);
}

.vccsell-cart-page .container {
	max-width: 100%;
	margin: 0;
	padding: 0;
}

/* Cart Header */
.cart-header {
	margin-bottom: 1.5rem;
	text-align: center;
}

.cart-title {
	font-size: 1.75rem;
	font-weight: 600;
	color: var(--text-color, #333);
	margin: 0;
	position: relative;
	display: inline-block;
}

.cart-title::after {
	content: '';
	position: absolute;
	bottom: -8px;
	left: 50%;
	transform: translateX(-50%);
	width: 40px;
	height: 3px;
	background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--accent-color, #8b5cf6));
	border-radius: 2px;
}

/* Cart Layout - Mobile First */
.cart-layout {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

/* Cart Items Section */
.cart-items-section {
	width: 100%;
}

.cart-items-container {
	border: 1px solid var(--border-color, #e1e5e9);
	border-radius: 12px;
	background: var(--bg-color, #fff);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	overflow: hidden;
}

/* Individual Cart Item - Mobile Optimized */
.cart-item {
	display: flex;
	flex-direction: column;
	padding: 1rem;
	border-bottom: 1px solid var(--border-color, #e1e5e9);
	transition: background-color 0.2s ease;
	position: relative;
}

.cart-item:last-child {
	border-bottom: none;
}

.cart-item:hover {
	background: var(--bg-light, #f8f9fa);
}

/* Cart Item Header - Product Image + Name + Remove */
.cart-item-header {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1rem;
}

/* Product Image - Mobile Optimized */
.cart-item-image {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--bg-light, #f8f9fa);
	position: relative;
}

.cart-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.cart-item:hover .cart-item-image img {
	transform: scale(1.05);
}

/* Product Details */
.cart-item-details {
	flex: 1;
	min-width: 0;
}

.cart-item-name {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-color, #333);
	margin: 0 0 0.5rem;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cart-item-name a {
	text-decoration: none;
	color: inherit;
	transition: color 0.2s ease;
}

.cart-item-name a:hover {
	color: var(--primary-color, #3b82f6);
}

/* Remove Button - Touch Friendly */
.cart-item-remove {
	width: 36px;
	height: 36px;
	border: none;
	background: rgba(239, 68, 68, 0.1);
	color: #dc2626;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.cart-item-remove:hover {
	background: rgba(239, 68, 68, 0.2);
	transform: scale(1.1);
}

.cart-item-remove:active {
	transform: scale(0.95);
}

/* Price and Quantity Meta - Mobile Layout */
.cart-item-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	background: var(--bg-light, #f8f9fa);
	padding: 0.75rem;
	border-radius: 8px;
	margin-top: 0.5rem;
}

.cart-item-price {
	font-weight: 600;
	color: var(--primary-color, #3b82f6);
	font-size: 1rem;
}

/* Quantity Controls - Touch Optimized */
.cart-item-quantity {
	display: flex;
	align-items: center;
}

.quantity-controls {
	display: flex;
	align-items: center;
	border: 1px solid var(--border-color, #e1e5e9);
	border-radius: 8px;
	background: var(--bg-color, #fff);
	overflow: hidden;
}

.qty-btn {
	width: 40px;
	height: 40px;
	border: none;
	background: transparent;
	color: var(--text-muted, #6b7280);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	font-size: 16px;
	font-weight: 600;
}

.qty-btn:hover {
	background: var(--primary-color, #3b82f6);
	color: white;
}

.qty-btn:active {
	transform: scale(0.95);
}

.qty-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.quantity input {
	width: 60px;
	height: 40px;
	border: none;
	text-align: center;
	font-weight: 600;
	background: transparent;
	color: var(--text-color, #333);
	font-size: 16px;
	-webkit-appearance: none;
	-moz-appearance: textfield;
}

.quantity input::-webkit-outer-spin-button,
.quantity input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.cart-item-subtotal {
	font-weight: 700;
	color: var(--primary-color, #3b82f6);
	font-size: 1.1rem;
}

/* Cart Actions - Mobile Optimized */
.cart-actions {
	padding: 1.5rem;
	border-top: 1px solid var(--border-color, #e1e5e9);
	background: var(--bg-light, #f8f9fa);
}

/* Coupon Section */
.coupon-section h3 {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0 0 1rem;
	color: var(--text-color, #333);
	text-align: center;
}

.coupon-input-group {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.coupon-input {
	padding: 1rem;
	border: 1px solid var(--border-color, #e1e5e9);
	border-radius: 8px;
	font-size: 16px;
	background: var(--bg-color, #fff);
	color: var(--text-color, #333);
	transition: all 0.2s ease;
}

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

.coupon-btn {
	padding: 1rem 1.5rem;
	border: none;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--primary-color, #3b82f6), var(--accent-color, #8b5cf6));
	color: white;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.coupon-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.coupon-btn:active {
	transform: translateY(0);
}

/* Cart Summary Section - Mobile First */
.cart-summary-section {
	position: static;
	width: 100%;
}

.cart-summary {
	border: 1px solid var(--border-color, #e1e5e9);
	border-radius: 12px;
	background: var(--bg-color, #fff);
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.cart_totals {
	border: none;
	background: transparent;
}

.summary-content {
	padding: 1.5rem;
}

.shop_table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1rem;
}

.shop_table th,
.shop_table td {
	padding: 0.75rem 0;
	text-align: left;
	border-bottom: 1px solid var(--border-color, #e1e5e9);
}

.shop_table tr:last-child th,
.shop_table tr:last-child td {
	border-bottom: none;
	padding-bottom: 0;
}

.totals-label {
	font-weight: 500;
	color: var(--text-muted, #6b7280);
}

.totals-value {
	font-weight: 600;
	color: var(--text-color, #333);
	text-align: right;
}

.order-total .totals-value {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--primary-color, #3b82f6);
}

/* Checkout Button - Mobile Optimized */
.wc-proceed-to-checkout {
	padding: 1rem 0 0;
	border-top: 1px solid var(--border-color, #e1e5e9);
}

.checkout-button,
.button.checkout-button {
	width: 100%;
	padding: 1rem 2rem;
	font-size: 18px;
	font-weight: 700;
	background: linear-gradient(135deg, #10b981, #059669);
	color: white;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.3s ease;
	text-transform: uppercase;
	letter-spacing: 1px;
	position: relative;
	overflow: hidden;
}

.checkout-button::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
	transition: left 0.5s ease;
}

.checkout-button:hover::before {
	left: 100%;
}

.checkout-button:hover,
.button.checkout-button:hover {
	background: linear-gradient(135deg, #059669, #047857);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

/* Empty Cart Container */
.empty-cart-container {
	text-align: center;
	padding: 3rem 1rem;
}

.empty-cart-message {
	font-size: 1.25rem;
	color: var(--text-muted, #6b7280);
	margin-bottom: 2rem;
}

/* General Button Styles */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	font-weight: 600;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	min-height: 48px;
}

.btn-primary {
	background: var(--primary-color, #3b82f6);
	color: white;
}

.btn-primary:hover {
	background: var(--primary-dark, #2563eb);
	transform: translateY(-2px);
}

/* WooCommerce Compatibility */
.woocommerce table td {
	padding: 0.75rem 0;
}

.woocommerce-cart table.cart td {
	vertical-align: middle;
}

.woocommerce-cart .wc-proceed-to-checkout {
	padding: 0;
	text-align: left;
}

/* Loading States */
.cart-item.loading {
	opacity: 0.6;
	pointer-events: none;
}

.cart-item.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid var(--primary-color, #3b82f6);
	border-top: 2px solid transparent;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

/* Ensure checkout button is always clickable */
.checkout-button,
.checkout-button.processing {
	pointer-events: auto;
	text-decoration: none;
}

.checkout-button.processing .checkout-spinner {
	margin-left: 10px;
}

/* Remove any spinner that might be stuck */
.checkout-spinner {
	display: none !important;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* ===================================================================== */
/* RESPONSIVE BREAKPOINTS - Mobile First Approach                       */
/* ===================================================================== */

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
	.vccsell-cart-page {
		padding: 0.5rem;
	}
	
	.cart-title {
		font-size: 1.5rem;
	}
	
	.cart-item {
		padding: 0.75rem;
	}
	
	.cart-item-header {
		gap: 0.75rem;
	}
	
	.cart-item-image {
		width: 60px;
		height: 60px;
	}
	
	.cart-item-name {
		font-size: 0.875rem;
	}
	
	.cart-item-meta {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}
	
	.cart-item-price,
	.cart-item-subtotal {
		text-align: center;
		font-size: 1rem;
	}
	
	.quantity-controls {
		justify-content: center;
	}
	
	.qty-btn {
		width: 44px;
		height: 44px;
	}
	
	.quantity input {
		width: 60px;
		height: 44px;
	}
	
	.coupon-input {
		font-size: 16px; /* Prevents zoom on iOS */
	}
	
	.checkout-button {
		font-size: 16px;
		padding: 1rem;
	}
}

/* Medium Mobile Devices (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
	.vccsell-cart-page {
		padding: 1rem;
	}
	
	.cart-layout {
		gap: 2rem;
	}
	
	.cart-item-meta {
		flex-wrap: wrap;
		gap: 1rem;
	}
	
	.coupon-input-group {
		flex-direction: row;
	}
	
	.coupon-input {
		flex: 1;
	}
	
	.coupon-btn {
		white-space: nowrap;
	}
}

/* Tablet Devices (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
	.vccsell-cart-page {
		padding: 1.5rem;
	}
	
	.cart-title {
		font-size: 2rem;
	}
	
	.cart-layout {
		display: grid;
		grid-template-columns: 1fr 350px;
		gap: 2rem;
		align-items: start;
	}
	
	.cart-summary-section {
		position: sticky;
		top: 2rem;
	}
	
	.cart-item {
		flex-direction: row;
		align-items: center;
		padding: 1.5rem;
	}
	
	.cart-item-header {
		flex: 1;
		margin-bottom: 0;
	}
	
	.cart-item-meta {
		flex-direction: row;
		background: transparent;
		padding: 0;
		margin-top: 0;
		align-items: center;
		min-width: 300px;
	}
}

/* Desktop Devices (1024px and up) */
@media (min-width: 1024px) {
	.vccsell-cart-page {
		padding: 2rem 1rem;
	}
	
	.cart-layout {
		grid-template-columns: 1fr 400px;
		gap: 3rem;
	}
	
	.cart-item-image {
		width: 100px;
		height: 100px;
	}
	
	.cart-item-name {
		font-size: 1.125rem;
	}
	
	.cart-item-meta {
		min-width: 350px;
	}
	
	.coupon-input-group {
		flex-direction: row;
	}
	
	.checkout-button {
		font-size: 18px;
	}
}

/* High-Resolution Displays */
@media (min-width: 1200px) {
	.cart-header {
		margin-bottom: 2.5rem;
	}
	
	.cart-title {
		font-size: 2.5rem;
	}
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
	.cart-item-remove,
	.qty-btn,
	.coupon-btn,
	.checkout-button {
		min-height: 44px;
		min-width: 44px;
	}
	
	.cart-item-remove:hover,
	.qty-btn:hover,
	.coupon-btn:hover,
	.checkout-button:hover {
		transform: none;
	}
	
	.cart-item-remove:active,
	.qty-btn:active,
	.coupon-btn:active,
	.checkout-button:active {
		transform: scale(0.98);
		opacity: 0.8;
	}
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
	:root {
		--bg-color: #1f2937;
		--bg-light: #374151;
		--text-color: #f9fafb;
		--text-muted: #9ca3af;
		--border-color: #4b5563;
		--primary-color: #60a5fa;
		--primary-dark: #3b82f6;
	}
	
	.cart-items-container,
	.cart-summary {
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	}
	
	.checkout-button {
		background: linear-gradient(135deg, #10b981, #059669);
	}
	
	.checkout-button:hover {
		background: linear-gradient(135deg, #059669, #047857);
	}
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
	.cart-items-container,
	.cart-summary {
		border-width: 2px;
	}
	
	.cart-item-remove {
		border: 2px solid #dc2626;
	}
	
	.checkout-button {
		border: 2px solid #10b981;
	}
}

/* Print Styles */
@media print {
	.cart-item-remove,
	.qty-btn,
	.coupon-section,
	.checkout-button {
		display: none !important;
	}
	
	.cart-layout {
		display: block;
	}
	
	.cart-item {
		break-inside: avoid;
		page-break-inside: avoid;
	}
} 