/*
 * Option Price by Char Pro - product page field styling (OpenCart 3.0.x)
 *
 * Change the colours here to match the store:
 *   --ppc-accent   focus border, usage bar and the cost badge once it is charging
 *   --ppc-near     counter and bar when 80% of the max length is used
 *   --ppc-full     counter and bar at the max length (not red: a full number is normal)
 */
.ppc-box {
	--ppc-accent: #111111;
	--ppc-near: #8c8c8c;
	--ppc-full: #111111;
	--ppc-border: #d9d9d9;
	--ppc-muted: #8c8c8c;

	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	background: #ffffff;
	border: 1px solid var(--ppc-border);
	border-radius: 8px;
	overflow: hidden;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.ppc-box:hover {
	border-color: #bdbdbd;
}

.ppc-box:focus-within {
	border-color: var(--ppc-accent);
	box-shadow: 0 0 0 3px rgba(17, 17, 17, .08);
}

/* The theme's own input, made borderless inside the box */
.ppc-box > input.form-control,
.ppc-box > textarea.form-control,
.ppc-box > input,
.ppc-box > textarea {
	/* Journal 3 gives its inputs a fixed width: override it so the field fills the box */
	flex: 1 1 0% !important;
	min-width: 0 !important;
	max-width: none !important;
	width: 1% !important;
	float: none !important;
	height: 48px;
	margin: 0 !important;
	padding: 0 14px;
	font-size: 15px;
	letter-spacing: .02em;
	color: #111111;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: 0 !important;
}

.ppc-box > input::placeholder,
.ppc-box > textarea::placeholder {
	color: #a6a6a6;
	letter-spacing: 0;
}

.ppc-box.is-textarea {
	align-items: flex-end;
}

.ppc-box.is-textarea > textarea {
	height: auto;
	min-height: 96px;
	padding: 12px 14px;
	resize: vertical;
}

.ppc-meta {
	display: flex;
	flex: 0 0 auto;
	margin-left: auto;
	align-items: center;
	gap: 10px;
	padding: 0 8px 0 4px;
	white-space: nowrap;
}

.ppc-box.is-textarea .ppc-meta {
	padding-bottom: 10px;
}

.ppc-count {
	font-size: 12px;
	color: var(--ppc-muted);
	font-variant-numeric: tabular-nums;
	transition: color .15s ease;
}

.ppc-count.is-near {
	color: var(--ppc-near);
}

.ppc-count.is-full {
	color: var(--ppc-full);
	font-weight: 600;
}

.ppc-cost {
	display: inline-block;
	min-width: 72px;
	padding: 6px 11px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	font-variant-numeric: tabular-nums;
	color: #9a9a9a;
	background: #f2f2f2;
	border-radius: 999px;
	transition: background-color .2s ease, color .2s ease;
}

.ppc-cost.is-active {
	color: #ffffff;
	background: var(--ppc-accent);
}

/* Usage bar along the bottom edge */
.ppc-bar {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 3px;
	background: var(--ppc-accent);
	transition: width .15s ease, background-color .15s ease;
	pointer-events: none;
}

.ppc-bar.is-near {
	background: var(--ppc-near);
}

.ppc-bar.is-full {
	background: var(--ppc-full);
}

@media (max-width: 480px) {
	.ppc-box > input,
	.ppc-box > textarea {
		font-size: 16px; /* stops iPhone zooming in on tap */
	}

	.ppc-cost {
		min-width: 0;
		padding: 5px 9px;
	}
}
