/* Giao diện mobile/tablet. Chỉ ẩn desktop khi đã chèn shortcode mobile. */
.cpf-mobile-filter,
.cpf-mobile-modal {
	display: none;
}

.cpf-mobile-modal[hidden],
.cpf-mobile-count[hidden] {
	display: none !important;
}

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

.cpf-request-error {
	margin: 12px 0;
	padding: 10px 14px;
	border: 1px solid #d70018;
	color: #b50014;
	background: #fff5f5;
}

@media (max-width: 849px) {
	body.cpf-has-mobile-filter .cpf-desktop-filter {
		display: none !important;
	}

	.cpf-mobile-filter {
		display: block;
		margin: 0 0 16px;
	}

	.cpf-mobile-open {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		min-height: 40px;
		margin: 0;
		padding: 8px 16px;
		border: 1px solid #ddd;
		border-radius: 6px;
		background: #fff;
		color: #222;
		font: inherit;
		font-size: 14px;
		line-height: 1.4;
		text-transform: none;
		letter-spacing: normal;
		cursor: pointer;
	}

	.cpf-mobile-count {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 20px;
		height: 20px;
		padding: 0 4px;
		border-radius: 50%;
		background: #df3035;
		color: #fff;
		font-size: 12px;
	}

	.cpf-mobile-modal:not([hidden]) {
		position: fixed;
		inset: 0;
		z-index: 999999;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 12px;
		font-family: inherit;
		font-size: 14px;
		line-height: 1.5;
	}

	.cpf-mobile-modal,
	.cpf-mobile-modal * {
		box-sizing: border-box;
	}

	.cpf-mobile-backdrop {
		position: absolute;
		inset: 0;
		background: rgba(0, 0, 0, 0.3);
	}

	.cpf-mobile-panel {
		position: relative;
		display: flex;
		flex-direction: column;
		width: 100%;
		max-width: 420px;
		max-height: calc(100vh - 24px);
		max-height: calc(100dvh - 24px);
		min-height: 0;
		overflow: hidden;
		border: 1px solid #eee;
		border-radius: 2px;
		background: #fff;
		color: #222;
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
	}

	.cpf-mobile-content {
		min-height: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		padding: 16px 14px 4px;
	}

	.cpf-mobile-panel button {
		min-width: 0;
		margin: 0;
		font-family: inherit;
		letter-spacing: normal;
		text-transform: none;
		box-shadow: none;
	}

	.cpf-mobile-panel .cpf-mobile-close {
		position: absolute;
		top: 3px;
		right: 3px;
		z-index: 2;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		min-height: 40px;
		padding: 0;
		border: 0;
		background: #fff;
		color: #666;
		cursor: pointer;
	}

	.cpf-mobile-panel h4 {
		margin: 0 0 10px;
		color: #222;
		font-size: 14px;
		font-weight: 600;
		line-height: 1.4;
		letter-spacing: normal;
		text-transform: none;
	}

	.cpf-mobile-price-group h4 {
		padding-right: 30px;
	}

	.cpf-mobile-price-group > p {
		margin: 0 0 12px;
		color: #777;
		font-size: 14px;
	}

	.cpf-mobile-price-inputs {
		display: flex;
		align-items: center;
		gap: 10px;
	}

	.cpf-mobile-price-inputs input {
		width: 0;
		min-width: 0;
		flex: 1;
		height: 34px;
		margin: 0;
		padding: 4px 6px;
		border: 1px solid #ccc;
		border-radius: 6px;
		background: #fff;
		color: #666;
		box-shadow: none;
		font-family: inherit;
		font-size: 16px;
		line-height: normal;
		text-align: center;
	}

	.cpf-mobile-slider {
		height: 3px;
		margin: 17px 6px 24px;
		border: 0;
		background: #e5e5e5;
		box-shadow: none;
	}

	.cpf-mobile-slider .noUi-connect {
		background: #df3035 !important;
	}

	.cpf-mobile-slider.noUi-horizontal .noUi-handle {
		top: -5px;
		right: -6px;
		width: 12px;
		height: 12px;
		border: 2px solid #df3035;
		border-radius: 50%;
		background: #fff;
		box-shadow: none !important;
	}

	.cpf-mobile-slider .noUi-handle::before,
	.cpf-mobile-slider .noUi-handle::after {
		display: none;
	}

	.cpf-mobile-slider .noUi-touch-area {
		position: absolute;
		inset: -10px;
		width: auto;
		height: auto;
	}

	.cpf-mobile-group {
		margin: 0 0 18px;
	}

	.cpf-mobile-group:last-child {
		margin-bottom: 6px;
	}

	.cpf-mobile-panel .cpf-pill-list {
		gap: 8px;
		max-height: none;
		margin: 0;
		overflow: visible;
	}

	.cpf-mobile-panel .cpf-pill-item {
		max-width: 100%;
		min-height: 30px;
		padding: 5px 11px;
		border: 1px solid #e7e7e7;
		border-radius: 20px;
		background: #fff;
		color: #777;
		font-size: 12px;
		font-weight: 400;
		line-height: 1.5;
		white-space: normal;
		overflow-wrap: anywhere;
	}

	.cpf-mobile-panel .cpf-pill-item.active {
		border-color: #df3035;
		background: #fff3f3;
		color: #d52c31;
	}

	.cpf-mobile-panel .cpf-mobile-empty {
		margin: 0;
		color: #888;
		font-size: 12px;
	}

	.cpf-mobile-actions {
		display: flex;
		flex-shrink: 0;
		gap: 14px;
		padding: 10px 14px max(14px, env(safe-area-inset-bottom));
		border-top: 1px solid #f3f3f3;
		background: #fff;
	}

	.cpf-mobile-actions button {
		min-height: 40px;
		padding: 8px 12px;
		border: 1px solid #e5e5e5;
		border-radius: 3px;
		font-size: 14px;
		line-height: 1.4;
		cursor: pointer;
	}

	.cpf-mobile-actions .cpf-mobile-reset {
		flex: 0 0 auto;
		background: #fafafa;
		color: #777;
		font-weight: 400;
	}

	.cpf-mobile-actions .cpf-mobile-submit {
		flex: 1;
		border-color: #df3035;
		background: #df3035;
		color: #fff;
		font-weight: 600;
	}

	.cpf-mobile-panel button:focus-visible,
	.cpf-mobile-open:focus-visible,
	.cpf-mobile-price-inputs input:focus-visible {
		outline: 2px solid #df3035;
		outline-offset: 2px;
	}

	html.cpf-mobile-lock {
		overflow: hidden;
		overscroll-behavior: none;
	}
}
