/* On-screen checkout: floating cart bar, full-screen sheet on phones, centred window on desktop. */
.pp-qc { display: none; }

.pp-qbar { display: block; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60; animation: pp-qbar-in .25s ease-out; }
.pp-qbar[hidden] { display: none; }
@keyframes pp-qbar-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.pp-qbar__btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 8px; border: 0; border-radius: 18px; background: linear-gradient(100deg, #8a0a4f, #d6127a); box-shadow: 0 14px 28px -10px rgba(31, 31, 36, .75); color: #fff; font-family: var(--sans); text-align: left; cursor: pointer; }
.pp-qbar__img { flex: none; width: 48px; height: 48px; border-radius: 11px; background: #fff; overflow: hidden; }
.pp-qbar__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pp-qbar__txt { flex: 1; min-width: 0; line-height: 1.3; }
.pp-qbar__txt strong { display: block; overflow: hidden; font-size: var(--fs-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pp-qbar__txt small { display: block; color: #ffd6e8; font-size: var(--fs-xs); white-space: nowrap; }
.pp-qbar__txt small .amount { color: #fff; font-weight: 700; }
.pp-qbar__go { flex: none; padding: 12px 16px; border-radius: 12px; background: #fff; color: var(--brand-d); font-size: var(--fs-sm); font-weight: 700; }

/* Nothing else may sit under the bar on phones. */
@media (max-width: 999px) {
	body:has(.pp-qbar:not([hidden])) { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
	body:has(.pp-qbar:not([hidden])) .wa-float { bottom: calc(84px + env(safe-area-inset-bottom)); }
	body:has(.pp-qbar:not([hidden])) .pp-toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
	body.mau-buy-on:has(.pp-qbar:not([hidden])) { padding-bottom: calc(156px + env(safe-area-inset-bottom)); }
	body.mau-buy-on .pp-qbar { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

.pp-qc[open] { display: flex; flex-direction: column; position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; height: calc(100dvh - 10px); max-height: none; margin: 0; padding: 0; border: 0; border-radius: 24px 24px 0 0; background: #fff; color: var(--ink); overflow: hidden; animation: pp-qc-up .28s cubic-bezier(.2, .8, .3, 1); }
.pp-qc::backdrop { background: rgba(31, 31, 36, .6); }
@keyframes pp-qc-up { from { transform: translateY(100%); } to { transform: none; } }
html:has(.pp-qc[open]) { overflow: hidden; }

.pp-qc__head { flex: none; display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 6px 0 18px; background: linear-gradient(100deg, #8a0a4f, #d6127a); color: #fff; }
.pp-qc__head h2 { font: 700 var(--fs-lg)/1.2 var(--serif); }
.pp-qc__head .pp-iconbtn { color: #fff; }

.pp-qc__body { flex: 1; min-height: 0; padding: 14px 16px 20px; overflow-y: auto; overscroll-behavior: contain; }
.pp-qc.is-busy .pp-qc__body { opacity: .55; pointer-events: none; }
.pp-qc h3 { margin: 20px 0 10px; font: 600 var(--fs-base)/1.3 var(--sans); }
.pp-qc__none { padding: 32px 0; color: var(--muted); text-align: center; }
.pp-qc__hint { margin-bottom: 10px; padding: 8px 12px; border-radius: 10px; background: var(--blush); color: var(--rose-d); font-size: var(--fs-xs); font-weight: 600; text-align: center; }

.pp-qc__items { list-style: none; }
.pp-qc__items li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pp-qc__items img { flex: none; width: 64px; height: 64px; border-radius: 10px; background: var(--blush); object-fit: cover; }
.pp-qc__items div { min-width: 0; }
.pp-qc__items li > div { flex: 1; }
.pp-qc__items strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: var(--fs-sm); font-weight: 500; line-height: 1.35; }
.pp-qc__line { display: block; margin: 2px 0 6px; color: var(--rose-d); font-size: var(--fs-sm); font-weight: 700; }
.pp-qc__qty { display: flex; align-items: center; gap: 6px; }
.pp-qc__qty button { min-width: 36px; height: 36px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: var(--fs-base); cursor: pointer; }
.pp-qc__qty span { min-width: 24px; font-size: var(--fs-sm); font-weight: 600; text-align: center; }
.pp-qc__qty .pp-qc__rm { margin-left: auto; padding: 0 8px; border: 0; color: var(--muted); font-size: var(--fs-xs); text-decoration: underline; }

.pp-qc__recs { display: flex; gap: 10px; margin: 0 -16px; padding: 0 16px 4px; list-style: none; overflow-x: auto; scroll-snap-type: x proximity; }
.pp-qc__recs li { flex: none; display: flex; flex-direction: column; width: 132px; padding: 7px; border: 1.5px solid var(--line); border-radius: 13px; scroll-snap-align: start; }
.pp-qc__recs img { display: block; width: 100%; aspect-ratio: 1; border-radius: 9px; background: var(--blush); object-fit: cover; }
.pp-qc__recname { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-height: 2.7em; margin-top: 6px; overflow: hidden; font-size: var(--fs-xs); line-height: 1.35; }
.pp-qc__recprice { margin: 2px 0 6px; color: var(--rose-d); font-size: var(--fs-sm); font-weight: 700; }
.pp-qc__recs button { min-height: 36px; margin-top: auto; border: 1.5px solid var(--rose); border-radius: 10px; background: #fff; color: var(--rose-d); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }

#ppQcFields label:not(.pp-qc__pay) { display: block; margin-bottom: 12px; font-size: var(--fs-sm); font-weight: 600; }
#ppQcFields small { color: var(--muted); font-weight: 400; }
#ppQcFields input:not([type=radio]), #ppQcFields textarea { display: block; width: 100%; min-height: 48px; margin-top: 5px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: 400 16px/1.35 var(--sans); }
#ppQcFields input:focus, #ppQcFields textarea:focus { border-color: var(--rose); outline: 2px solid rgba(214, 18, 122, .2); }
#ppQcFields [aria-invalid=true] { border-color: #dc2626; }

.pp-qc__pay { display: flex; align-items: center; gap: 10px; min-height: 50px; margin-bottom: 8px; padding: 0 13px; border: 1.5px solid var(--line); border-radius: 12px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.pp-qc__pay:has(:checked) { border-color: var(--rose); background: var(--blush); }
.pp-qc__pay input { width: 20px; height: 20px; accent-color: #d6127a; }

.pp-qc__sum { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--blush); font-size: var(--fs-sm); }
.pp-qc__sum > div { display: flex; justify-content: space-between; padding: 3px 0; }
.pp-qc__total { margin-top: 5px; padding-top: 8px !important; border-top: 1px solid var(--line); font-size: var(--fs-base); font-weight: 700; }
.pp-qc__age { margin-top: 12px; color: var(--muted); font-size: var(--fs-xs); text-align: center; }

.pp-qc__foot { flex: none; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.pp-qc__foot[hidden] { display: none; }
.pp-qc__err { margin-bottom: 8px; color: #b91c1c; font-size: var(--fs-sm); font-weight: 600; text-align: center; }
.pp-qc__place { width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: linear-gradient(90deg, #d6127a, #b00e64); color: #fff; font: 700 var(--fs-base) var(--sans); cursor: pointer; }
.pp-qc__place .amount { color: inherit; }
.pp-qc__place:disabled { opacity: .6; }

.pp-qc__done { display: flex; flex-direction: column; gap: 14px; }
.pp-qc__done h2 { margin-top: 4px; font: 700 var(--fs-h2)/1.2 var(--serif); text-align: center; }
.pp-qc__done h3 { margin: 8px 0 -2px; }
.pp-qc__ordno { margin-top: -8px; color: var(--muted); font-size: var(--fs-sm); text-align: center; }
.pp-qc__ordno strong { color: var(--ink); }

.pp-van-scene { position: relative; height: 136px; border-radius: 18px; background: linear-gradient(180deg, #fdeaf3, #fff4e8); overflow: hidden; }
.pp-van-drive { position: absolute; left: 50%; bottom: 24px; width: 150px; margin-left: -75px; animation: pp-van-sway 5s ease-in-out infinite; }
.pp-van { display: block; animation: pp-van-bob .5s ease-in-out infinite alternate; }
.pp-van__wheel { animation: pp-van-spin .55s linear infinite; }
.pp-van-road { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: repeating-linear-gradient(90deg, #fff 0 26px, transparent 26px 56px) 0 13px / 56px 4px repeat-x, #1f1f24; animation: pp-van-road .5s linear infinite; }
.pp-van-cloud { position: absolute; left: 100%; width: 54px; height: 16px; border-radius: 99px; background: #fff; opacity: .85; animation: pp-van-cloud 9s linear infinite; }
.pp-van-cloud--a { top: 20px; }
.pp-van-cloud--b { top: 48px; width: 36px; height: 12px; animation-duration: 13s; animation-delay: -6s; }
.pp-van-puff { position: absolute; left: 0; bottom: 30px; color: #ec4899; font-size: 15px; font-style: normal; opacity: 0; animation: pp-van-puff 2.1s ease-out infinite; }
.pp-van-puff:nth-child(2) { animation-delay: .7s; font-size: 12px; }
.pp-van-puff:nth-child(3) { animation-delay: 1.4s; font-size: 18px; }
@keyframes pp-van-sway { 0%, 100% { transform: translateX(-16px); } 50% { transform: translateX(16px); } }
@keyframes pp-van-bob { to { transform: translateY(-1.5px); } }
@keyframes pp-van-spin { to { transform: rotate(360deg); } }
@keyframes pp-van-road { to { background-position: -56px 13px, 0 0; } }
@keyframes pp-van-cloud { to { transform: translateX(calc(-100vw - 120px)); } }
@keyframes pp-van-puff { 0% { opacity: 0; transform: none; } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-46px, -40px) scale(1.3); } }

.pp-qc__card { padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; font-size: var(--fs-sm); }
.pp-qc__list { list-style: none; }
.pp-qc__list li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.pp-qc__list li span:last-child { flex: none; color: var(--muted); }
.pp-qc__row { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.pp-qc__row--to span:first-child { flex: none; color: var(--muted); }
.pp-qc__row--to span:last-child { text-align: right; }

.pp-qc__wa { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 9px 16px; border-radius: 14px; background: #25d366; box-shadow: 0 12px 22px -12px rgba(18, 140, 70, .8); color: #06331a; text-decoration: none; }
.pp-qc__wa:hover { background: #1fbd5a; color: #06331a; }
.pp-qc__wa .pp-ic { flex: none; width: 28px; height: 28px; }
.pp-qc__wa strong { display: block; font-size: var(--fs-base); }
.pp-qc__wa small { display: block; font-size: var(--fs-xs); }

.pp-qc__next { list-style: none; counter-reset: pp-next; }
.pp-qc__next li { position: relative; padding: 0 0 12px 40px; counter-increment: pp-next; font-size: var(--fs-sm); }
.pp-qc__next li::before { content: counter(pp-next); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #d6127a, #b00e64); color: #fff; font-size: var(--fs-xs); font-weight: 700; line-height: 28px; text-align: center; }
.pp-qc__next strong, .pp-qc__next li > span { display: block; }
.pp-qc__next li > span { color: var(--muted); }
.pp-qc__next span .amount { color: var(--ink); font-weight: 700; }

.pp-qc__recs--links a { display: flex; flex-direction: column; flex: 1; color: var(--ink); text-decoration: none; }
.pp-qc__recview { margin-top: auto; padding: 6px 0 2px; color: var(--rose-d); font-size: var(--fs-sm); font-weight: 700; text-align: center; }

.pp-qc__quote { margin: 0; padding: 16px; border-radius: 14px; background: linear-gradient(100deg, #8a0a4f, #d6127a); color: #fff; font: 600 var(--fs-base)/1.45 var(--serif); text-align: center; }
.pp-qc__quote span { display: block; margin-top: 6px; color: #ffd6e8; font: 500 var(--fs-xs) var(--sans); }
.pp-qc__shop { width: 100%; min-height: 50px; margin-top: 10px; border: 1.5px solid var(--rose); border-radius: 14px; background: #fff; color: var(--rose-d); font: 700 var(--fs-base) var(--sans); cursor: pointer; }

/* Desktop: the bar sits left of the chat buttons; the sheet is a centred two-column window. */
@media (min-width: 1000px) {
	.pp-qbar { left: 20px; right: auto; bottom: 20px; width: 400px; }

	.pp-qc[open] { inset: 0; width: min(1080px, calc(100vw - 48px)); height: min(780px, calc(100dvh - 48px)); margin: auto; border-radius: 24px; animation: pp-qc-pop .22s ease-out; }
	@keyframes pp-qc-pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

	.pp-qc__head { padding-left: 24px; }
	#ppQcForm { display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "hint hint" "cart fields"; column-gap: 28px; padding: 16px 24px 0; overflow: hidden; }
	#ppQcForm[hidden] { display: none; }
	.pp-qc:has(#ppQcFields[hidden]) #ppQcForm { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hint" "cart"; }
	#ppQcHint { grid-area: hint; }
	#ppQcCart { grid-area: cart; min-height: 0; padding-bottom: 20px; overflow-y: auto; }
	#ppQcFields { grid-area: fields; min-height: 0; padding: 0 4px 20px 0; overflow-y: auto; }
	#ppQcFields h3:first-child { margin-top: 0; }

	.pp-qc__recs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; }
	.pp-qc__recs li { width: auto; }

	.pp-qc__foot { display: flex; flex-direction: column; align-items: flex-end; padding: 12px 24px; }
	.pp-qc__err { width: 420px; }
	.pp-qc__place { width: 420px; }
	.pp-qc__done { max-width: 640px; margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
	.pp-qbar, .pp-qc[open], .pp-van-scene * { animation: none !important; }
	.pp-van-cloud, .pp-van-puff { display: none; }
}
