:root {
	--content-max-width: 50rem;
	--content-padding-inline: 1rem;
	--content-padding-block: 1rem;
	
	--header-padding-inline: 1.2rem;
	
	--header-icon-size: 1.5rem;
	
	--html-font: 14px;
	--font-main: "Inter", sans-serif;
	
	--color-text: 0, 0%, 20%;
	--color-text-main: 216, 98%, 20%;
	--color-text-main-light: 216, 98%, 30%;
	--color-background: 216, 98%, 97%;
	
	--color-cta: 216, 98%, 52%;
	
	--h1-font: 2.7rem;
	--h2-font: 2.1rem;
	--h3-font: 1.3rem;
	
	--header-icon-padding: .5rem;
	
	--footer-height: 4.5rem;
	
	--swipe-height: 60px;
	--swipe-handle-stroke: 7px;
	
	--spin-animation: spin .6s linear infinite;
}

* {
	-webkit-tap-highlight-color: transparent;
	outline: none !important;
}

*:focus {
	outline: none !important;
}

*,
::after,
::before {
	box-sizing: border-box;
}

html,
body {
	min-height: 100%;
	margin: 0;
	padding: 0;
	touch-action: manipulation;
}

html {
	font-family: var(--font-main);
	font-size: var(--html-font);
	font-optical-sizing: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	color: hsl(var(--color-text));
	background-color: hsl(var(--color-background));
}

html:has(dialog[open]),
body.modal {
	position: fixed;
	width: 100%;
	height: 100dvh;
	overflow: hidden !important;
	touch-action: none;
}

header, footer {
	background-color: rgba(255, 255, 255, .8);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

header {
	position: sticky;
	z-index:1;
	top: 0;
	padding:var(--header-icon-padding) 0;
}

#main_header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 2rem;
	width: 100%;
	padding: 0 var(--header-padding-inline);
}

.header-name {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.header-logo {
	width: 2rem;
	margin: -1rem 0;
	padding-top: .1rem;
	border-radius: 50%;
	background-color: #111314;
	object-fit: cover;
	aspect-ratio: 1 / 1;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: nowrap;
	white-space: nowrap;
}

.header-icons {
	display: flex;
	gap: 1rem;
	font-size: var(--header-icon-size);
}

.header-icons i {
	margin: calc(var(--header-icon-padding) * -1);
	padding: var(--header-icon-padding);
	cursor: pointer;
}

#discount_bar {
	display: none;
	padding: .6rem;
	text-align: center;
	font-weight: 600;
	color: hsl(142, 50%, 15%);
	background: hsl(142, 70%, 45%);
}

main {
	padding-bottom: calc(var(--footer-height) + var(--content-padding-block)) !important;
	color: hsl(var(--color-text-main));
}

footer {
	position: fixed;
	z-index:1;
	bottom: 0;
	left: 0;
	right: 0;
	height: var(--footer-height);
	padding-bottom: env(safe-area-inset-bottom);
}

#main_footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 2rem;
	padding-top: .8rem;
	padding-bottom: .8rem;
}

.item-left {
	flex: 1;
}

.item-right {
	flex: 1;
	text-align: right;
}

#main_footer i {
	display: inline-block;
	padding: .2rem;
	font-size: 2rem;
}

.content {
	max-width: var(--content-max-width);
	margin: 0 auto;
	padding: var(--content-padding-block) var(--content-padding-inline);
}

h1 {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 1.1rem;
	margin: 1.5rem 0;
	font-size: var(--h1-font);
	overflow-wrap: break-word;
}

h1 i {
	font-size: 1.4em;
}

h2 {
	margin: 1.3rem 0;
	font-size: var(--h2-font);
	overflow-wrap: break-word;
}

h3 {
	margin: 1.1rem 0 .4rem;
	font-size: var(--h3-font);
	overflow-wrap: break-word;
}

p {
	margin: .2rem 0;
	line-height: 1.6rem;
}

.text-center {
	text-align: center;
}

.text-right {
	text-align: right;
}

dialog {
	display: flex;
	justify-items: center;
	align-items: center;
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: none;
	background-color: #fff;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
}

.dialog-login,
.dialog-signup,
.dialog-user,
.dialog-support,
.dialog-lang,
.dialog-order,
.dialog-payment,
.dialog-terms {
	width: 100%;
	margin: auto;
	padding: 1.6rem;
}

.dialog-login,
.dialog-signup,
.dialog-user,
.dialog-support,
.dialog-lang {
	max-width: 22rem;
}

.dialog-order,
.dialog-payment,
.dialog-terms {
	max-width: var(--content-max-width);
}

#btn_back,
#btn_close,
#btn_reset_vendor {
	padding: 1rem;
	font-size: var(--header-icon-size);
	cursor: pointer;
}

#btn_back,
#btn_close {
	position: absolute;
	top: 1rem;
}

#btn_back {
	left: 1rem;
}

#btn_close {
	right: 1rem;
}

#btn_order {
	max-width: 12rem;
	padding: .8rem 1.2rem;
	font-size: 1.2rem;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1rem;
}

tr.fade-in {
	animation: fadeIn .4s ease-in forwards;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(5px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

th, td {
	border-bottom: 1px solid #eee;
	padding: .9rem .4rem;
	font-size: .9rem;
	text-align: left;
}

.td-status {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	padding: .4rem;
}

.td-status i {
	font-size: 2rem;
}

.td-spinner {
	width: 3rem;
	height: 3rem;
	border: var(--loader-border) solid hsla(0, 0%, 100%, .2);
	border-top-color: hsl(var(--color-text));
	border-radius: 50%;
	animation: var(--spin-animation);
}

#btn_load_more {
	display: none;
}

#btn_load_more.visible {
	display: inline-block;
}

.catalog-category,
.catalog-subcategory,
.catalog-empty {
	margin: .7rem 0;
	text-align: center;
}

.catalog-category {
	font-size: 2rem;
	font-weight: bold;
}

.catalog-subcategory {
	font-size: 1.1rem;
	color: hsl(var(--color-text-main-light));
}

.catalog-list,
.order-list,
.order-cup-list {
	display: flex;
	flex-direction: column;
}

.catalog-list,
.order-cup-list {
	gap: 1.8rem;
	margin-bottom: 4rem;
}

.order-list {
	gap: 1rem;
	margin-bottom: 2rem;
}

.catalog-item,
.catalog-item-heading,
.order-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
}

.catalog-item {
	gap: 1.2rem;
}

.order-item {
	padding: .4rem .6rem;
	color: hsl(var(--color-text-main));
	background-color: hsl(var(--color-background));
	border-radius: .5rem;
	
}

.catalog-item-details {
	width: 100%;
}

.catalog-item-name {
	font-size: 1.3rem;
	font-weight: 600;
}

.catalog-item-description {
	padding-top: .2rem;
	font-size: .8rem;
	color: hsl(var(--color-text-main-light));
}

.order-item-line {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.order-item-line-qty,
.order-item-line-qty-cup {
	width: 3.5rem;
	padding: .2rem;
	font-size: 2rem;
	font-weight: bold;
	text-align: center;
	border-radius: .5rem;
}

.order-item-line-qty {
	color: #fff;
	background-color: hsl(var(--color-text-main));
}

.order-item-line-qty-cup {
	background-color: hsla(var(--color-text-main), .05);
}

.order-item-line-name {
	font-size: 1.6rem;
	font-weight: bold;
}

.order-subtotal,
.order-total {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 1.5rem;
}

.order-subtotal {
	margin: .2rem 0;
	font-size: .9rem;
}

.order-total {
	margin: 2rem 0;
	font-weight: bold;
	font-size: 1.4rem;
}

.qty-controls {
	display: flex;
	align-items: center;
	gap: .2rem;
}

.qty-controls button {
	width: 2rem;
	height: 2rem;
	padding: 0;
	border-radius: 50%;
}

.qty-controls span {
	min-width: 2rem;
	font-size: 1.1rem;
	font-weight: bold;
	text-align: center;
}

#swipe_container {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	height: var(--swipe-height);
	margin: 1rem .5rem;
	border-radius: 30px;
	background-color: hsl(var(--color-background));
}

#swipe_handle {
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	z-index: 1;
	left: var(--swipe-handle-stroke);
	width: calc(var(--swipe-height) - (var(--swipe-handle-stroke) * 2));
	height: calc(var(--swipe-height) - (var(--swipe-handle-stroke) * 2));
	color: #fff;
	font-size: 1.4rem;
	border-radius: 50%;
	background-color: hsl(var(--color-cta));
	box-shadow: 0 0 0 var(--swipe-handle-stroke) hsla(var(--color-cta), .1);
	cursor: grab;
}

#swipe_handle::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0;
	border-radius: 50%;
	animation: pulse-shadow 1.5s infinite;
}

#swipe_handle.loading::before {
	animation: none;
	display: none;
}

.swipe-text {
	user-select: none;
	opacity: calc(1 - var(--progress, 0));
	color: hsl(var(--color-text-main));
	font-weight: bold;
}

#swipe_container:has(#swipe_handle.loading) .swipe-text {
	opacity: 0;
	transition: opacity .2s;
}

#swipe_handle.loading::after {
	content: "";
	position: absolute;
	width: var(--loader-size);
	height: var(--loader-size);
	top: calc(50% - (var(--loader-size) / 2));
	left: calc(50% - (var(--loader-size) / 2));
	border: var(--loader-border) solid hsla(0, 0%, 100%, .2);
	border-top-color: #fff;
	border-radius: 50%;
	animation: var(--spin-animation);
}

#swipe_handle.loading i {
	visibility: hidden;
}

#webcam_container {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border: 2px solid hsl(var(--color-text-main));
	border-radius: 1rem;
}

#webcam {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

#webcam_loader {
	display: none;
	place-items: center;
	position: absolute;
	inset: 0;
	color: #fff;
	background: rgba(0, 0, 0, .8);
}

.webcam-loader {
	position: relative;
	width: 4rem;
	height: 4rem;
	border: .5rem solid #000;
	border-top-color: #fff;
	border-radius: 50%;
	animation: var(--spin-animation);
}

#webcam_error {
	display: none;
	position: absolute;
	inset: 0;
}

.webcam-error {
	padding: .4rem;
	text-align: center;
	color: #fff;
	background-color: hsl(354, 95%, 55%);
}

.receipt-time {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin: 1rem;
	text-align: right;
}

.receipt-time-label {
	font-size: .8rem;
}

#receipt_counter {
	font-size: 2.6rem;
	font-weight: bold;
}

.terms {
	font-size: .8rem;
	color: hsl(var(--color-text-main-light));
	text-align: center;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.shake {
	will-change: transform;
	animation: shake 0.2s ease-in-out 0s 2;
}

@keyframes shake {
	0%, 100% {
		transform: translateX(0);
	}
	25% {
		transform: translateX(-5px);
	}
	75% {
		transform: translateX(5px);
	}
}

@keyframes pulse-shadow {
	0% {
		box-shadow: 0 0 0 0 hsla(var(--color-cta), .4);
	}
	70% {
		box-shadow: 0 0 0 calc(var(--swipe-handle-stroke) * 3) hsla(var(--color-cta), 0);
	}
	100% {
		box-shadow: 0 0 0 0 hsla(var(--color-cta), 0);
	}
}

@media (min-width: 400px) {
	:root {
		--html-font: 15px;
		--content-padding-inline: 1.25rem;
		--header-padding-inline: 1.5rem;
	}
}

@media (min-width: 768px) {
	:root {
		--html-font: 16px;
		--content-padding-inline: 2rem;
		--header-padding-inline: 2.5rem;
		--h1-font: 3.1rem;
		--h2-font: 2.5rem;
		--h3-font: 2.1rem;
	}
}

@media (min-width: 1024px) {
	:root {
		--html-font: 17px;
		--h1-font: 3.5rem;
		--h2-font: 3.1rem;
		--h3-font: 2.5rem;
	}
}