/* Opoto Toolkit – Buy bar + quantity buttons (mobile-first). */

/* ---------- quantity − / + ---------- */
.oqty {
	display: inline-flex;
	align-items: stretch;
	vertical-align: middle;
	border: 1px solid var(--oqty-border, rgba(0, 0, 0, .18));
	border-radius: var(--oqty-radius, 8px);
	overflow: hidden;
	background: var(--opoto-background, #fff);
}
.oqty.oqty--plain { border: 0; background: none; overflow: visible; }
.oqty .oqty__btn {
	flex: 0 0 auto;
	width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--opoto-primary, #222);
	font: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation; /* no double-tap zoom on fast taps */
}
.oqty .oqty__btn:hover,
.oqty .oqty__btn:focus { background: rgba(0, 0, 0, .05); color: var(--opoto-primary, #222); }
.oqty .oqty__btn:focus-visible { outline: 2px solid var(--opoto-primary, #222); outline-offset: -2px; }
.oqty:not(.oqty--plain) input.qty {
	width: 3.2em;
	min-height: 44px;
	margin: 0;
	padding: 0 2px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	font-size: 16px; /* iPhone does not zoom in */
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}
.oqty input.qty::-webkit-outer-spin-button,
.oqty input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.oqty:has(input[type="hidden"]) .oqty__btn { display: none; }

/* ---------- buy bar ---------- */
.obb {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
	background: var(--opoto-background, #fff);
	color: var(--opoto-primary, #222);
	box-shadow: 0 -4px 18px rgba(0, 0, 0, .12);
	font-family: var(--opoto-font-text, inherit);
	transform: translateY(110%);
	transition: transform .2s ease;
}
.obb[hidden] { display: block; visibility: hidden; }
.obb.is-visible { visibility: visible; transform: none; }
@media (prefers-reduced-motion: reduce) { .obb { transition: none; } }

.obb__inner {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 1140px;
	margin: 0 auto;
}
.obb .obb__img {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	margin: 0;
	border-radius: 6px;
	object-fit: cover;
}
.obb__info {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	line-height: 1.25;
}
.obb__name {
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.obb__detail { font-size: 13px; opacity: .8; }
.obb__detail:empty { display: none; }
.obb .obb__btn {
	flex: 0 0 auto;
	min-height: 44px;
	margin: 0;
	padding: 10px 18px;
	border: 0;
	border-radius: var(--obb-radius, 8px);
	background: var(--opoto-accent, #222);
	color: var(--opoto-accent-text, #fff);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	touch-action: manipulation;
}
.obb .obb__btn:hover,
.obb .obb__btn:focus { background: var(--opoto-accent, #222); color: var(--opoto-accent-text, #fff); opacity: .92; }
.obb .obb__btn:disabled { opacity: .5; cursor: not-allowed; }

/* Room for the bar at the end of the page. */
html.obb-visible body { padding-bottom: var(--obb-height, 72px); }

/* Devices */
@media (min-width: 768px) {
	.obb.obb--phones { display: none !important; }
}
@media (min-width: 1025px) {
	.obb.obb--mobile { display: none !important; }
}
