/* MOBILE-FIRST ONLY */
@media screen and (max-width: 767px) {
	.soilroots-mobile-cart-wrapper {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		font-family: 'Poppins', sans-serif;
		background-color: #fdfbf7; /* Warm ivory/cream background */
		padding: 16px;
		color: #1b4332; /* Deep forest green */
		overflow-x: hidden;
		position: relative;
	}

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

	/* Loading Overlay */
	.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); }
	}

	/* Disabled state for buttons */
	.soilroots-mobile-cart-wrapper.is-loading .srmc-action-btn {
		pointer-events: none;
		opacity: 0.5;
	}

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

	/* Header */
	.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;
	}

	/* Product List */
	.srmc-items-list {
		display: flex;
		flex-direction: column;
		gap: 16px;
		margin-bottom: 32px;
	}

	/* Product Card */
	.srmc-product-card {
		background: #ffffff;
		border-radius: 20px;
		padding: 12px;
		display: flex;
		gap: 12px;
		box-shadow: 0 4px 12px rgba(0,0,0,0.02);
		width: 100%;
		box-sizing: border-box;
		overflow: hidden; /* Ensures nothing spills out */
	}

	.srmc-product-image {
		width: 80px;
		height: 80px;
		flex-shrink: 0;
		border-radius: 12px;
		overflow: hidden;
		background: #f8f8f8;
	}
	.srmc-product-image img {
		width: 100%;
		height: 100%;
		object-fit: contain;
		display: block;
	}

	.srmc-product-details {
		flex: 1;
		display: flex;
		flex-direction: column;
		min-width: 0; /* CRITICAL for flex child truncation */
	}

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

	.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: 8px;
		word-wrap: break-word;
	}

	.srmc-product-footer {
		display: flex;
		justify-content: space-between;
		align-items: flex-end;
		margin-top: auto;
		gap: 8px; /* space between price and controls */
		flex-wrap: wrap; /* allow wrapping on super narrow screens */
	}

	.srmc-product-price {
		font-size: 16px;
		font-weight: 700;
		color: #1b4332;
		flex-shrink: 0;
		margin-bottom: 4px; /* for when wrapped */
	}

	.srmc-qty-control {
		display: flex;
		align-items: center;
		background: #f8f8f8;
		border-radius: 20px;
		padding: 2px 6px;
		max-width: 100%;
		flex-shrink: 1;
		box-sizing: border-box;
		margin-bottom: 4px; /* for when wrapped */
	}
	.srmc-qty-btn {
		width: 24px;
		height: 24px;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 16px;
		color: #1b4332;
		font-weight: 600;
		background: transparent;
		border: none;
		cursor: pointer;
		padding: 0;
		flex-shrink: 0;
	}
	.srmc-qty-value {
		min-width: 24px;
		text-align: center;
		font-size: 14px;
		font-weight: 600;
		color: #1b4332;
		padding: 0 4px;
	}

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

	.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;
	}

	/* Buttons */
	.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; /* Terracotta / Orange */
		color: #ffffff !important;
	}
	.srmc-btn-checkout:hover {
		opacity: 0.9;
	}

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

	/* Fixes for very narrow screens (e.g., iPhone SE at 320px) */
	@media screen and (max-width: 360px) {
		.srmc-product-image {
			width: 65px;
			height: 65px;
		}
		
		.srmc-product-name {
			font-size: 14px;
		}

		.srmc-product-price {
			font-size: 15px;
		}

		.srmc-qty-control {
			padding: 2px 4px;
		}
	}
}

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