/* MOBILE-FIRST ONLY */
@media screen and (max-width: 767px) {
	/* The cart wrapper must take up the full viewport */
	.soilroots-mobile-cart-wrapper {
		width: 100vw !important; /* Force true full width */
		max-width: 100vw !important; /* Override narrow container constraints */
		box-sizing: border-box;
		font-family: 'Poppins', sans-serif;
		background-color: #fdfbf7;
		padding: 16px 12px; /* Small professional side padding */
		margin-left: calc(-50vw + 50%) !important; /* Break out of any parent container */
		margin-right: calc(-50vw + 50%) !important; /* Break out of any parent container */
		color: #1b4332;
		overflow-x: hidden;
		position: relative;
	}

	.soilroots-mobile-cart-wrapper * {
		box-sizing: border-box;
	}

	.srmc-loading-overlay {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(253, 251, 247, 0.6);
		z-index: 10;
		display: none;
		align-items: center;
		justify-content: center;
	}
	.soilroots-mobile-cart-wrapper.is-loading .srmc-loading-overlay {
		display: flex;
	}
	.srmc-spinner {
		width: 40px;
		height: 40px;
		border: 4px solid rgba(27, 67, 50, 0.1);
		border-left-color: #1b4332;
		border-radius: 50%;
		animation: srmc-spin 1s linear infinite;
	}
	@keyframes srmc-spin {
		to { transform: rotate(360deg); }
	}

	.soilroots-mobile-cart-wrapper.is-loading .srmc-action-btn {
		pointer-events: none;
		opacity: 0.5;
	}

	/* CSS Fix for Elementor Empty Cart Spacing on Mobile */
	.woocommerce-cart-empty .e-flexbox#container_g3x65800w {
		margin-top: 20px !important;
		padding-top: 0 !important;
		min-height: auto !important;
		height: auto !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 24px !important;
	}

	.woocommerce-cart-empty .e-flexbox#container_g3x65800w .elementor-widget-image {
		margin-bottom: 0 !important;
	}
	
	.woocommerce-cart-empty .e-flexbox#container_g3x65800w .elementor-widget-heading {
		margin-bottom: 0 !important;
	}

	.srmc-empty-cart {
		text-align: center;
		padding: 40px 20px;
	}
	.srmc-empty-title {
		font-size: 24px;
		font-weight: 600;
		margin-bottom: 24px;
		color: #1b4332;
	}

	.srmc-header {
		display: flex;
		align-items: center;
		margin-bottom: 24px;
		gap: 12px;
	}
	.srmc-title {
		font-size: 28px;
		font-weight: 700;
		margin: 0;
		color: #1b4332;
		line-height: 1.2;
	}
	.srmc-item-count {
		background-color: #e8f5e9;
		color: #2e7d32;
		padding: 4px 12px;
		border-radius: 20px;
		font-size: 14px;
		font-weight: 600;
	}

	.srmc-items-list {
		display: flex;
		flex-direction: column;
		gap: 16px;
		margin-bottom: 32px;
		width: 100%;
	}

	/* Product Card - strict flex layout to keep image and text side-by-side proportionally */
	.srmc-product-card {
		background: #ffffff;
		border-radius: 20px;
		padding: 16px;
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 16px;
		box-shadow: 0 4px 12px rgba(0,0,0,0.02);
		width: 100%;
		box-sizing: border-box;
		overflow: hidden;
	}

	/* Product Image Container */
	.srmc-product-image {
		flex: 0 0 42%;
		width: 42%;
		aspect-ratio: 1.35 / 1;
		min-width: 0;
		border-radius: 12px;
		background: #f8f8f8;
		display: flex;
		align-items: center;
		justify-content: center;
		overflow: hidden;
		align-self: stretch; /* Match height of card if details are taller */
	}
	
	.srmc-product-image img {
		width: 100% !important;
		height: 100% !important; 
		object-fit: contain !important;
		object-position: center center !important;
		display: block;
	}

	.srmc-product-details {
		flex: 1 1 58%;
		min-width: 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.srmc-product-header {
		display: flex;
		justify-content: space-between;
		align-items: flex-start;
		gap: 8px;
		margin-bottom: 8px;
	}

	.srmc-product-name {
		font-size: 15px;
		font-weight: 600;
		margin: 0;
		color: #1b4332;
		line-height: 1.3;
		word-wrap: break-word;
		overflow-wrap: break-word;
	}

	.srmc-remove-item {
		display: flex;
		align-items: center;
		justify-content: center;
		cursor: pointer;
		flex-shrink: 0;
	}

	.srmc-product-variation {
		font-size: 13px;
		color: #666;
		margin-bottom: 12px;
		word-wrap: break-word;
	}

	.srmc-product-footer {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: auto;
		gap: 8px;
		flex-wrap: wrap;
	}

	.srmc-product-price {
		font-size: 18px;
		font-weight: 700;
		color: #1b4332;
		flex-shrink: 0;
	}

	.srmc-qty-control {
		display: flex;
		align-items: center;
		background: #f8f8f8;
		border-radius: 20px;
		padding: 4px 8px;
		flex-shrink: 1;
		box-sizing: border-box;
	}
	.srmc-qty-btn {
		width: 28px;
		height: 28px;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 18px;
		color: #1b4332;
		font-weight: 600;
		background: transparent;
		border: none;
		cursor: pointer;
		padding: 0;
		flex-shrink: 0;
	}
	.srmc-qty-btn.srmc-qty-disabled {
		opacity: 0.3;
		cursor: not-allowed;
	}
	.srmc-qty-value {
		min-width: 28px;
		text-align: center;
		font-size: 15px;
		font-weight: 600;
		color: #1b4332;
		padding: 0 4px;
	}

	.srmc-order-summary {
		background: #ffffff;
		border-radius: 20px;
		margin-bottom: 24px;
		box-shadow: 0 4px 12px rgba(0,0,0,0.02);
		overflow: hidden;
		width: 100%;
	}

	.srmc-summary-header {
		background: #1b4332;
		padding: 16px 20px;
	}

	.srmc-summary-title {
		font-size: 16px;
		font-weight: 600;
		color: #ffffff;
		margin: 0;
	}

	.srmc-summary-body {
		padding: 20px;
	}

	.srmc-summary-row {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 12px;
		font-size: 15px;
	}
	.srmc-summary-row:last-child {
		margin-bottom: 0;
	}

	.srmc-summary-label {
		color: #666;
	}
	.srmc-summary-value {
		font-weight: 600;
		color: #1b4332;
	}

	.srmc-summary-divider {
		height: 1px;
		background: #eee;
		margin: 16px 0;
	}

	.srmc-summary-total .srmc-summary-label,
	.srmc-summary-total .srmc-summary-value {
		font-size: 18px;
		font-weight: 700;
		color: #1b4332;
	}

	.srmc-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		padding: 16px 24px;
		border-radius: 100px;
		font-size: 16px;
		font-weight: 600;
		text-decoration: none;
		transition: opacity 0.2s;
		box-sizing: border-box;
		border: none;
		cursor: pointer;
	}
	
	.srmc-btn-checkout {
		background-color: #d86835;
		color: #ffffff !important;
	}
	.srmc-btn-checkout:hover {
		opacity: 0.9;
	}

	.srmc-btn-explore {
		background-color: #1b4332;
		color: #ffffff !important;
	}

	@media screen and (max-width: 360px) {
		.srmc-product-name {
			font-size: 14px;
		}
		.srmc-product-price {
			font-size: 16px;
		}
		.srmc-qty-btn {
			width: 24px;
			height: 24px;
			font-size: 16px;
		}
		.srmc-qty-value {
			font-size: 14px;
		}
	}
}

@media screen and (min-width: 768px) {
	.soilroots-mobile-cart-wrapper {
		display: none !important;
	}
}

.woocommerce-cart table.cart td.product-quantity .quantity {
	display: inline-flex;
	align-items: center;
	background: #f8f8f8;
	border-radius: 20px;
	padding: 2px 6px;
}

.woocommerce-cart table.cart td.product-quantity .quantity input[type="number"] {
	-moz-appearance: textfield;
	border: none !important;
	background: transparent !important;
	text-align: center;
	padding: 0 !important;
	margin: 0 !important;
	width: 40px !important;
	font-weight: 600;
	color: #1b4332;
	height: auto !important;
	min-height: unset !important;
}

.woocommerce-cart table.cart td.product-quantity .quantity input[type="number"]::-webkit-outer-spin-button,
.woocommerce-cart table.cart td.product-quantity .quantity input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.woocommerce-cart table.cart td.product-quantity .quantity .srmc-desktop-qty-btn {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	color: #1b4332;
	font-weight: 600;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
}

.woocommerce-cart table.cart td.product-quantity .quantity .srmc-desktop-qty-btn.srmc-disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}