/* https://stackoverflow.com/a/66345821 */
:target {
  scroll-margin-top: 53px;
  scroll-margin-bottom: 47px;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.categoryLine {
  position: sticky;
  top: 0px;
  display: flex;
  justify-content: space-between;
  border: 2px solid #303030;
  border-radius: 5px;
  background-color: #303030;
  margin: 10px;
  padding: 5px 10px 5px 10px;
  z-index: 10; /* Show header always over basketLine */
  overflow-x: auto;
  gap: 10px;
  box-sizing: border-box;
}

.categoryLine.active {
  border-radius: 0px 0px 5px 5px;
}

.basketLine {
  position: sticky;
  bottom: 0px;
  display: flex;
  justify-content: space-between;
  border: 2px solid #303030;
  border-radius: 5px;
  background-color: #303030;
  margin: 10px;
  padding: 5px;
  gap: 10px;
  align-items: baseline;
  color: #fff;
  box-sizing: border-box;
  cursor: default;
}

.basketLine.active {
  border-radius: 5px 5px 0px 0px;
}

.catHeaderLink {
  background-color: #404040;
  border: 0px solid;
  border-radius: 10px;
  padding: 5px 10px 5px 10px;
  box-sizing: border-box;
}

.catHeaderLink.active {
  background-color: white;
}

.catHeader {
  text-align: center;
  margin-top: 15px;
  margin-bottom: 15px;
  padding-top: 10px;
  line-height: 24px;
  font-size: 21px;
  box-sizing: border-box;
}

.catDescription {
  text-align: center;
  margin-top: 5px;
  margin-bottom: 15px;
  box-sizing: border-box;
}

.subCatHeader {
  text-align: center;
  margin-top: 0px;
  background-color: #f0f0f0;
  border-bottom: 1px solid #e0e0e0;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  margin-bottom: 0.5em;
  font-size: 16px;
  box-sizing: border-box;
}

.subCatHeaderNote,.subCatDescription {
  font-size: 12px;
}

.category {
  margin: 10px;
  box-sizing: border-box;
}

.subcategory {
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  background-color: #fcfcfc;
  margin-bottom: 1.5em;
  box-sizing: border-box;
}

.item {
  display: flex;
  margin: 5px 5px 5px 5px;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}

.item .itemName {
  flex-grow: 1;
  box-sizing: border-box;
}

/* .item.disabled label { */
/*   text-decoration: line-through; */
/* } */

.item .priceTag {
  text-align: right;
  width: 5rem;
  white-space: nowrap;
  box-sizing: border-box;
}

.item.inBasket {
  color: #e26729;
}

.item .priceSum {
  text-align: right;
  width: 4rem;
  white-space: nowrap;
  box-sizing: border-box;
}

.form-group {
  display: inline-flex;
  border: 0.5px solid #303030;
  color: #000;
  box-sizing: border-box;
}

.form-group button {
  outline:none;
  -webkit-appearance: none;
  /* color: #000; */
  /* background-color: transparent; */
  border: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 1.5rem;
  cursor: pointer;
  margin: 0;
  box-sizing: border-box;
}

.form-group input[type=number] {
  border: solid #303030;
  border-width: 0 0.5px;
  height: 1.5rem;
  text-align: center;
  appearance: textfield;
  /* background-color: transparent; */
  box-sizing: border-box;
}

button:disabled {
  pointer-events: none;
}

.itemAddonsGrid {
  padding: 10px 10px 10px 25px;
  display: grid;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-evenly;
  align-content: center;
  gap: 10px;
  --grid-layout-gap: 10px;
  --grid-column-count: 4;
  --grid-item--min-width: 15rem;
  --gap-count: calc(var(--grid-column-count) - 1);
  --total-gap-width: calc(var(--gap-count) * var(--grid-layout-gap));
  --grid-item--max-width: calc((100% - var(--total-gap-width)) / var(--grid-column-count));
  grid-template-columns: repeat(auto-fill, minmax(max(var(--grid-item--min-width), var(--grid-item--max-width)), 1fr));
  box-sizing: border-box;
  -webkit-transition: background-color 250ms linear;
  -ms-transition: background-color 250ms linear;
  transition: background-color 250ms linear;
}

/* .itemAddonsGrid:empty { */
/*   display: none !important; */
/* } */

.itemAddons.not-enough .itemAddons-normal {
  background-color: rgba(255, 231, 199, 0.7);
}

.refundTag {
  white-space: nowrap;
  box-sizing: border-box;
}

.addonLabel {
  display: inline-block;
  box-sizing: border-box;
}

.hidden {
  visibility: hidden;
}

/* Separator to processing addons */
.separator {
  display: flex;
  align-items: center;
  text-align: center;
  grid-column: 1/span 3;
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  /* uncomment to add line around */
  /* border-bottom: 1px solid #000; */
}

.separator:not(:empty)::before {
  margin-right: .5em;
}

.separator:not(:empty)::after {
  margin-left: .5em;
}

span.insufficient-funds {
  color: #ff2222;
}

input.unavailable+label.addonLabel {
  text-decoration: line-through;
}

.categoryLine hr {
  border-top: 0;
  border-right: 1px solid #e26729;
  height: unset;
  margin: unset;
  box-sizing: border-box;
}

#totalSum { /* width shouldnt change when adding more items */
  min-width: 6em;
  display: inline-block;
  text-align: end;
  box-sizing: border-box;
}

.item .itemName {
  order: 1;
}

.item .item-count-group {
  order: 2;
}

.item .priceTag {
  order: 3;
}

.item .soldOut,
.item .priceSum {
  order: 4;
}

@media(max-width: 768px) {
  .item {
    flex-wrap: wrap;
    justify-content: end;
    border-top: 0.5px solid black;
    padding: 5px 0px 0px 0px;
  }

  .item .item-count-group {
    order: 3;
    margin-left: calc(100% - 10rem - 10px);
  }

  .item .priceTag {
    order: 2;
  }

  .basketLine {
    flex-wrap: wrap;
  }

  .basketLine .balanceSpan {
    flex-grow: 1;
  }

  .basketLine .sumSpan {
    display: flex;
    flex-grow: 1;
    align-items: center;
  }

  #orderButton {
    margin-left: auto !important;
  }
}

.vegan-icon {
  color: #228B22;
  margin-left: 0.4rem;
}

.vegetarian-icon {
  color: #228B22;
  margin-left: 0.4rem;
}

.icon-info {
  display: flex;
  justify-content: space-evenly;
  margin-bottom: 1rem;
}

.icon-info .vegan-icon, .icon-info .vegetarian-icon {
  margin-right: 0.4rem;
}

.z-index-99 {
  z-index: 99 !important;
}

/* Order confirmation dialog */
.order-confirm-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.25em;
}

.order-confirm-table thead th {
  background-color: #e26729;
  color: #fff;
  padding: 8px 10px;
  text-align: left;
}

.order-confirm-table th.price-col,
.order-confirm-table td.price-col {
  text-align: right;
  white-space: nowrap;
}

.order-confirm-table tbody tr:nth-child(odd) {
  background-color: rgba(255, 255, 255, 0.06);
}

.order-confirm-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-confirm-table td.qty-col {
  white-space: nowrap;
  width: 3em;
  color: #e26729;
  font-weight: bold;
}

.order-confirm-addons {
  font-size: 0.82em;
  opacity: 0.7;
}

.order-confirm-table tfoot td {
  border-top: 2px solid #e26729;
  border-bottom: none;
  padding-top: 10px;
  font-weight: bold;
  font-size: 1.05em;
}

.order-confirm-btn.ui-button {
  background: #e26729;
  border-color: #c55820;
  color: #fff;
}

.order-confirm-btn.ui-button:hover {
  background: #c55820;
  border-color: #a84a1a;
}
