

::-webkit-scrollbar {
  display: none;
}

@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  color: #333333;
  list-style: none;
  font-size: 13px;
}

a:link {
  text-decoration: none;
}

a:visited {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

a:active {
  text-decoration: none;
}

.bold {
  font-weight: bold;
}

html {
  background-color: white;
}

:root {
  --pos-app-max-width: 1024px;
  --pos-field-height: 28px;
}

::-webkit-scrollbar {
  display: none;
}

body {
  background-color: white;
  max-width: var(--pos-app-max-width);
  margin: auto;
}

body select {
  border: 1px solid #333333;
  border-radius: 0.4rem;
  padding: 0 0.3rem;
}

body input {
  font-size: 1em;
  border: 1px solid #333333;
  border-radius: 0.4rem;
  padding: 5px;
  height: var(--pos-field-height);
}

dialog.product-form-modal input:not([type="checkbox"]):not([type="radio"]),
dialog.product-form-modal select {
  height: var(--pos-field-height);
}

body button {
  background-color: #FF7500;
  color: white;
  font-weight: 500;
  border: solid 1px #FF7500;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.1s;
  border: none;
  padding: 0.5rem 1rem;
  height: 28px;
}

header {
  background-color: white;
  position: sticky;
  top: 0;
  z-index: 1100;
}

header nav {
  height: 55px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  position: sticky;
  top: 0;
  position: relative;
}

#logo {
  margin-left: 15px;
  height: 40px;
  cursor: pointer;
  flex-shrink: 0;
}

#menuButton {
  width: 20px;
  margin-right: 15px;
  cursor: pointer;
}

#menuList {
  display: none;
  text-align: end;
  border-radius: 0 0 10px 10px;
  margin-right: 15px;
  font-size: 16px;
}

#menuList.active {
  display: flex;
  flex-direction: column;
  align-items: end;
}


#menuList a.active-menu {
  color: inherit;
  font-weight: 400;
}

.menu-actions {
  padding: 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-edit-categories-small {
  background-color: #FF7500;
  color: white;
  font-weight: 500;
  border: solid 1px #FF7500;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.1s;
  border: none;
  padding: 0.5rem 1rem;
  height: 28px;
  font-size: 1em;
}



header {
  background-color: white;
  position: sticky;
  top: 0;
  z-index: 1100;
}

header nav {
  height: 55px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  position: sticky;
  top: 0;
  position: relative;
}

#logo {
  margin-left: 15px;
  height: 40px;
  cursor: pointer;
  flex-shrink: 0;
}

#menuButton {
  width: 20px;
  margin-right: 15px;
  cursor: pointer;
}

#menuList {
  display: none;
  text-align: end;
  border-radius: 0 0 10px 10px;
  margin-right: 15px;
}

#menuList.active {
  display: flex;
  flex-direction: column;
  align-items: end;
}

#menuList li {
  font-size: inherit;
  line-height: 2;
  cursor: pointer;
}

#menuList a {
  font-size: inherit;
  cursor: pointer;
  color: inherit;
  font-weight: 400;
}

.date-nav {
  display: flex;
  justify-content: center;
  padding: 15px;
  gap: 15px;
}

.date-nav article {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-nav input[type="date"] {
  width: 115px;
}

#productModal .product-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hide-when-product-modal.hide {
  display: none !important;
}

.product-modal-inline.active ~ .date-nav,
.product-modal-inline.active ~ nav.date-nav,
body:has(#productModal.active) nav.date-nav {
  display: none !important;
}

#orders {
  position: relative;
}

#orders .background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

#orders article {
  background-color: rgba(255, 166, 0, 0.5);
  position: relative;
  padding: 15px;
  line-height: 1.8;
  border: solid 1px rgba(0, 0, 0, 0.05);
}
#orders article.pending {
  background-color: rgba(30, 143, 255, 0.5);
}
#orders article.finalized {
  background-color: rgba(0, 128, 0, 0.5);
}
#orders article.cancelled {
  background-color: rgba(255, 0, 0, 0.5);
}
#orders article.delivery {
  background-color: rgba(0, 128, 0, 0.5);
}

#orders article div {
  display: flex;
  justify-content: space-between;
  gap: 0.1rem;
}

#orders article #items {
  display: none;
}

.modal-printer {
  opacity: 0;
  pointer-events: none;
  position: fixed;
  z-index: 3;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.05s;
}
.modal-printer.active {
  opacity: 1;
  pointer-events: initial;
}

.modal-printer-content {
  position: relative;
  background-color: #f1f1f1;
  margin: 5% auto;
  padding: 1.2rem;
  border: 1px solid #888;
  width: 85%;
  max-width: 25rem;
  min-height: 27rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 0.3rem;
  gap: 0.2rem;
}
.modal-printer-content #logo {
  width: 100%;
  text-align: center;
  display: none;
}

#orderDetails {
  flex: 1;
  width: 100%;
  background-color: rgb(241 241 241);
  line-height: 1.9;
  border-radius: 0.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

#orderDetails > article {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  text-align: right;
}

#orderDetails > article.items {
  border-top: 0.1rem solid black;
  border-bottom: 0.1rem solid black;
  padding: 0.5rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
#orderDetails > article.items > div {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

#orderDetails > article.items > div > div:last-child {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
#orderDetails > article.items > div > div:last-child > div {
  display: flex;
  justify-content: space-between;
  gap: 0.2rem;
  text-align: left;
}

#orderDetails > article h3 {
  font-weight: bold;
  color: black/85;
}

#orders article div #total {
  display: flex;
  justify-content: space-between;
}

#printButton {
  z-index: 2;
  background-color: #da291c;
  color: white;
  border: solid 1px #da291c;
  border-radius: 0.4rem;
  padding: 0.2rem 1rem;
  cursor: pointer;
  transition: all 0.1s;
}

#printButton:hover {
  background-color: transparent;
  color: #da291c;
}

#orders article #statusContainer {
  width: fit-content;
  display: flex;
  align-items: center;
}

#orders article #statusContainer select {
  width: 100%;
  padding: 0.5rem 0.5rem;
  font-size: 1rem;
  border: 1px solid #333333;
  border-radius: 0.4rem;
  color: white;
}
#orders article #statusContainer select.received {
  background-color: orange;
  border: 1px solid orange;
}
#orders article #statusContainer select.pending {
  background-color: dodgerblue;
  border: 1px solid dodgerblue;
}
#orders article #statusContainer select.finalized {
  background-color: green;
  border: 1px solid green;
}
#orders article #statusContainer select.cancelled {
  background-color: red;
  border: 1px solid red;
}
#orders article #statusContainer select.delivery {
  background-color: green;
  border: 1px solid green;
}
#address,
#payment-method {
  display: none;
}

#orders select {
  z-index: 2;
}

#loginModal {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1100;
  width: 100dvw;
  height: 100dvh;
  background-color: #333333;
  display: flex;
  align-items: center;
  justify-content: center;
}

#loginModal.active {
  opacity: 1;
  pointer-events: initial;
}

#loginModal > .modal-content {
  margin-top: -300px;
  width: 25rem;
  height: fit-content;
  min-height: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  gap: .5rem;
}

.login-favicon {
  width: 56px;
  height: 56px;
  display: block;
  margin: 0 auto 1rem;
  flex-shrink: 0;
}

#loginModal .modal-content form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

#loginModal .modal-content form article {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-autofill-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.login-autofill-trap input {
  width: 1px;
  height: 1px;
  border: 0;
  padding: 0;
}

#loginModal .modal-content form article div label {
  font-size: 1rem;
  font-weight: 500;
  color: white;
}

#loginModal .modal-content form article div input {
  width: 100%;
  height: var(--pos-field-height);
  min-height: var(--pos-field-height);
  text-indent: 5px;
}

#loginModal .modal-content form button {
  width: 100%;
  height: var(--pos-field-height);
  min-height: var(--pos-field-height);
  padding: 0 1rem;
}

.message-login {
  color: red;
}

.modal-printer {
  opacity: 0;
  pointer-events: none;
  position: fixed;
  z-index: 3;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.05s;
}

.modal-printer.active {
  opacity: 1;
  pointer-events: initial;
}

.modal-printer-content {
  position: relative;
  background-color: #f1f1f1;
  margin: 5% auto;
  padding: 1.2rem;
  border: 1px solid #888;
  width: 85%;
  max-width: 25rem;
  min-height: 27rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 0.3rem;
  gap: 0.2rem;
}

.modal-printer-content #logo {
  width: 100%;
  text-align: center;
  display: none;
}

#orderDetails {
  flex: 1;
  width: 100%;
  background-color: rgb(241 241 241);
  line-height: 1.9;
  border-radius: 0.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dialogHeader {
  background-color: white;
  height: 55px;
  padding: 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: solid 1px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1;
}

.dialogHeader img {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.dialogHeader .dialog-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.product-form-content {
  padding: 15px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

#productsList {
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
}



.product-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem;
  border: 1px solid #eee;
  border-radius: 0.4rem;
  background-color: #fafafa;
  cursor: pointer;

}

.product-item.dragging {
  opacity: 0.7;
  background: #f0f0f0;
  border-color: #ddd;
}

:root {
  --drag-handle-size: 1.2rem;
}

.product-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  cursor: grab;
  color: #999;
  user-select: none;
  font-size: var(--drag-handle-size);
  line-height: 1;
  text-align: center;
  flex-shrink: 0;
}

.product-drag-handle:active {
  cursor: grabbing;
}

#btnCloseProdutosModal {
  width: 15px;
  cursor: pointer;
}

.toggle-container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 0;
  width: max-content;
}

.toggle-label {
    font-size: 14px;
    font-weight: bold;
  white-space: nowrap;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
  left: 36px; 
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #4CAF50;
}

input:checked + .slider:before {
  transform: translateX(-32px); 
}

.products-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.product-categories-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.category-manage-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 0.4rem;
  border-radius: 0.5rem;
  background: #FF7500;
  color: white;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border: 1px solid #e25f00;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-manage-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.16);
}

.categories-scroll {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.categories-scroll::-webkit-scrollbar {
  height: 4px;
}

.categories-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.categories-scroll::-webkit-scrollbar-thumb {
  background: #FF7500;
  border-radius: 2px;
}

.category-tab {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.4rem 0.8rem;
  color: #333;
  font-weight: 500;
  font-size: 1rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.category-tab:hover {
  background: transparent;
}

.category-tab.active {
  background: transparent;
  color: #FF7500;
  border: none;
  border-radius: 0;
  font-weight: 700;
}

.category-tab.add-btn {
  background: transparent;
  border: none;
  color: #333;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
}

.category-tab.add-btn:hover {
  background: transparent;
}

.menu-contents {
  margin-top: 0;
}

.category-content {
  display: none;
}

.category-content.active {
  display: block;
  animation: slideIn 0.25s ease-in-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.edit-categories-link {
  color: #FF7500;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0 0.5rem 0 0;
  font-size: 0.95em;
  transition: color 0.2s;
}
.edit-categories-link:hover {
  color: #E06000;
}
.btn-edit-categories-small {
  background-color: #FF7500;
  color: white;
  font-weight: 500;
  border: solid 1px #FF7500;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: all 0.1s;
  border: none;
  padding: 0.5rem 1rem;
  height: 28px;
  font-size: 1em;
}
.btn-edit-categories-small:hover {
  background: #e06000;
  color: #fff;
}


.btn-edit-category {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 0.3rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.2s;
}

.btn-edit-category:hover {
  background-color: #0056b3;
}

.category-manager-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 15px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}


.category-manager-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: none;
  overflow: visible;
  margin-bottom: 0;
  flex: 0 0 auto;
  min-height: auto;

}

.category-manager-manual-actions {
  margin-top: 0;
  margin-bottom: 0;
}

.manager-manual-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.manager-manual-actions span {
  color: #bbb;
}

.category-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 0.4rem;
  padding: 0.6rem 0.8rem;
}

.category-row.dragging {
  opacity: 0.7;
  background: #f0f0f0;
  border-color: #ddd;
}

.category-drag-handle {
  cursor: grab;
  color: #999;
  user-select: none;
  font-size: var(--drag-handle-size);
  line-height: 1;
  text-align: center;
}

.category-drag-handle:active {
  cursor: grabbing;
}

.category-order {
  display: none;
}

.category-name-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid #ddd;
  border-radius: 0.35rem;
  font-size: 0.9rem;
}

.option-group-row {
  display: grid;
  grid-template-columns: 24px auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 0.4rem;
  padding: 0.6rem 0.8rem;
}

.option-group-row.active {
  border-color: #ff7500;
  box-shadow: 0 0 0 2px rgba(255, 117, 0, 0.12);
}

.option-group-row.dragging {
  opacity: 0.7;
  background: #f0f0f0;
  border-color: #ddd;
}

.option-group-drag-handle {
  cursor: grab;
  color: #999;
  user-select: none;
  font-size: var(--drag-handle-size);
  text-align: center;
  line-height: 1;
}

.option-group-drag-handle:active {
  cursor: grabbing;
}

#optionGroupManagerModal[open] {
  z-index: 1400;
}

#optionGroupManagerModal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.option-group-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.option-group-main strong {
  font-size: 0.9rem;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.option-group-main small {
  font-size: 0.78rem;
  color: #666;
}

.option-group-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.option-group-type-badge.optional {
  background: rgba(0, 123, 255, 0.12);
  color: #0052b3;
}

.option-group-type-badge.additional {
  background: rgba(255, 117, 0, 0.14);
  color: #c85800;
}

.category-name-input:focus {
  outline: none;
  border-color: #FF7500;
  box-shadow: 0 0 0 2px rgba(255, 117, 0, 0.1);
}

.btn-delete-row {
  background: transparent;
  color: #FF7500;
  border: none;
  padding: 0;
  cursor: pointer;
}


.btn-add-row {
  align-self: flex-start;
  background: white;
  border: 2px dashed #FF7500;
  color: #FF7500;
  padding: 0.6rem 1rem;
  border-radius: 0.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-row:hover {
  background: #fff5f0;
}

.btn-text-link {
  background: transparent;
  color: #FF7500;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
  font-size: inherit;
  font-weight: 500;
}

.btn-text-link:hover {
  text-decoration: underline;
}

.products-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #e6e6e6;
  border-radius: 0.45rem;
  background-color: #fdfdfd;
}

.product-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 0.3rem;
  flex-shrink: 0;
}

.product-image.placeholder {
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #999;
}

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  cursor: pointer;
  
}

.product-info-inline {
  flex-direction: row !important;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  min-height: 22px;
  flex: 1 1 auto;
  min-width: 0;
}

.product-destaque-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  margin-right: 2px;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

.product-destaque-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.product-destaque-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 18px;
  line-height: 1;
  color: #bbb;
  transition: color 0.2s, transform 0.2s;
  transform-origin: center;
}

.product-destaque-checkbox:checked + .product-destaque-star {
  color: #FFD700;
}

.product-destaque-label:hover .product-destaque-star {
  transform: scale(1.08);
}

.product-name {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: #333;
  font-size: 13px;
  min-height: 22px;
  flex: 1 1 auto;
  min-width: 0;
}

.product-price {
  color: #FF7500;
  font-weight: 500;
  font-size: 0.9rem;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 22px;
  flex-shrink: 0;
}


.no-products {
  text-align: left;
  font-size: 0.85rem;
}

.no-products a {
  color: #FF7500;
  text-decoration: none;
}

.product-groups-manual-actions {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.btn-add-product,
.btn-add-category {
  background-color: #FF7500;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-add-product:hover,
.btn-add-category:hover {
  background-color: #E06000;
}

.add-category-section {
  text-align: center;
  padding: 2rem 1rem;
}

.product-form-title-input {
  flex: 1;
  font-size: 20px;
  font-weight: 600;
  border: none;
  padding: 8px 0;
  color: #333;
  transition: border-color 0.2s;
}

.product-form-title-input:focus {
  outline: none;
}

.product-form-title-input::placeholder {
  color: #999;
}


.btn-close-form {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-close-form:hover {
  opacity: 0.8;
}

.btn-close-form img {
  display: block;
  width: 15px; 
  height: 15px;
}

.product-edit-header {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}


.product-edit-image-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.product-edit-info-col {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}


.product-edit-info-col .form-group {
  margin-bottom: 0;
}

.product-image-preview-top {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border: 2px solid #FF7500;
  border-radius: 0.4rem;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  min-width: 140px;
  min-height: 120px;
}


.product-image-preview-top.empty::after {
  content: '📷';
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
}
.product-image-preview-top img {
  width: 150px;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  object-position: center center;
  border-radius: 10px;
}

.form-group {
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
}

.form-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.form-group-header .btn-text-link {
  margin: 0;
}

#openOptionGroupManagerFromFormBtn {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.55rem 0.8rem;
}

.form-group-header label {
  margin: 0;
}

.group-template-toolbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  margin-bottom: 0.35rem;
  flex-wrap: nowrap;
}

.group-template-toolbar .group-template-select {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

#addGroupByTypeBtn {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.88rem;
}

.group-header-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.35rem;
}

.group-type-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  font-size: 0.78rem;
  font-weight: 700;
  color: #666;
  margin-bottom: 0.25rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

.group-type-title .group-type-text {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.group-type-title .group-order-drag-handle {
  font-size: var(--drag-handle-size);
  line-height: 1;
  color: #999;
  flex-shrink: 0;
}

.group-type-title .btn-delete-group {
  margin-left: 0;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
}

.group-template-select {
  max-width: 190px;
  min-height: var(--pos-field-height);
  height: var(--pos-field-height);
  padding: 0 0.75rem;
  font-size: 0.9rem;
  border: 1px solid #ddd;
  border-radius: 0.35rem;
  background: #fff;
  line-height: 1.2;
}

#productFormModal .form-group select,
#productFormModal .group-template-select {
  min-height: 36px;
  height: 36px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  line-height: 1.35;
  -webkit-appearance: menulist;
  appearance: auto;
}

#productFormModal .form-group select {
  padding-left: 0.75rem;
  padding-right: 2rem;
}

.group-template-help {
  color: #666;
  font-size: 0.78rem;
  margin-left: 0.5rem;
}



.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.group-card {
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #f9f9f9;
  position: relative;
}



.group-header {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1rem;
  align-items: center;
  flex-wrap: nowrap;
}

.group-card[data-locked="true"] .group-header .drag-handle {
  display: none;
}

.group-card[data-locked="true"] input,
.group-card[data-locked="true"] textarea,
.group-card[data-locked="true"] select {
  background: #efefef !important;
  color: #777 !important;
  border-color: #dedede !important;
}

.group-card[data-locked="true"] .group-header label {
  color: #777;
}

.group-card input:disabled,
.group-card select:disabled,
.group-card textarea:disabled,
.group-card button:disabled,
.group-card .input-muted {
  background: #f1f1f1 !important;
  color: #8a8a8a !important;
  border-color: #e0e0e0 !important;
}

.group-card button:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.group-card .group-header label.input-muted,
.group-card .group-limit-label.input-muted,
.group-card .drag-handle.input-muted {
  color: #8a8a8a !important;
  opacity: 1;
}


.drag-handle {
  cursor: grab;
  color: #999;
  font-size: var(--drag-handle-size);
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.group-header input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.4rem;
  border: 1px solid #ddd;
  border-radius: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.group-card[data-group-type="additional"] .group-header {
  gap: 0.22rem;
}

.group-card[data-group-type="additional"] .group-header input[type="text"] {
  flex: 1 1 110px;
  min-width: 0;
}

.group-header label {
  font-size: 0.75rem;
  font-weight: 400;
  color: #444;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.group-header input[type="checkbox"] {
  cursor: pointer;
  width: 14px;
  height: 14px;
  margin: 0;
  vertical-align: middle;
  flex-shrink: 0;
}

.group-header input[type="number"] {
  width: 40px;
  padding: 0.2rem 0.3rem;
  font-size: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 0.3rem;
}

.group-limit-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  justify-content: flex-start;
}

.group-limit-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #666;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.btn-delete-group {
  background: transparent;
  color: #FF7500;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}


.btn-delete-group:hover {
  text-decoration: underline;
}

.group-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.option-row {
  display: grid;
  grid-template-columns: auto 2fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
}



.option-row input[type="text"],
.option-row input[type="number"] {
  width: 100%;
}

.option-row .btn-remove-row {
  background: #ffecec;
  color: #c0392b;
  border: 1px solid #f5c6cb;
  padding: 0.35rem 0.55rem;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: all 0.2s;
}

.option-row .btn-remove-row:hover {
  background: #ffd7d7;
}

.option-row .btn-remove-row.btn-text-link {
  background: transparent;
  color: #FF7500;
  border: none;
  padding: 0;
  border-radius: 0;
}

.option-row .btn-remove-row.btn-text-link:hover {
  background: transparent;
  text-decoration: underline;
}



.product-modal-inline {
  display: block;
  background: #fff;
  padding: 15px;
}


.variation-group-input {
  margin-top: 0.4rem;
  margin-bottom: 0.3rem;
}

.form-group label {
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
  display: inline;
  margin-left: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
  padding: 0.6rem;
  border: 1px solid #ddd;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  font-family: 'Roboto', sans-serif;
}

.form-group input[type="file"] {
  padding: 0.4rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
  font-family: 'Roboto', sans-serif;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #FF7500;
  box-shadow: 0 0 0 2px rgba(255, 117, 0, 0.1);
}



.variation-group-title,
.additional-group-title {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}

#logoutButton {
  color: inherit;
}

dialog {
  margin: auto;
  border: none;
  border-radius: 10px;
  padding: 0;
  width: 85%;
  max-width: 500px;
  max-height: 85%;
}

dialog.product-form-modal {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100vw, var(--pos-app-max-width));
  max-width: var(--pos-app-max-width);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  border-radius: 0;
  padding: 0;
}

dialog.product-form-modal[open] {
  display: flex;
  flex-direction: column;
}

dialog:focus {
  outline: none;
}

dialog.product-form-modal form {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

dialog::backdrop {
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

body:has(dialog[open]) {
  overflow: hidden;
}

@media (max-width: 640px) {
    body input,
  body select,
  body textarea {
    border-radius: 0.4rem;
    padding: 5px;
    height: 28px;
  }

  body select {
    padding: 5px;
  }

  body label {
    font-size: 14px;
    margin-bottom: 0.4rem;
    display: block;
  }

  .form-group label {
    margin-bottom: 0.5rem;
  }

  .product-form-header {
    padding: 15px 15px;
    height: 50px;
  }

  .product-form-header h2 {
    font-size: 16px;
  }

  .product-form-title-input {
    font-size: 18px;
  }

  .group-template-toolbar {
    gap: 0.35rem;
  }

  .product-item {
    gap: clamp(0.4rem, 1.8vw, 0.7rem);
    padding: 0.55rem clamp(0.45rem, 2.4vw, 0.9rem);
    min-height: 38px;
  }

  .product-drag-handle {
    width: clamp(16px, 4.8vw, 20px);
    min-width: clamp(16px, 4.8vw, 20px);
    height: 22px;
    min-height: 22px;
    font-size: clamp(0.9rem, 2.8vw, 1rem);
  }

  .product-info-inline {
    gap: clamp(0.24rem, 1.6vw, 0.5rem);
    align-items: center;
  }

  .product-destaque-label {
    display: inline-flex;
    align-items: center;
    align-self: center;
    width: clamp(18px, 5vw, 22px);
    min-width: clamp(18px, 5vw, 22px);
    height: clamp(18px, 5vw, 22px);
    min-height: clamp(18px, 5vw, 22px);
    margin-right: 0;
    margin-bottom: 0;
  }

  .product-destaque-star {
    font-size: clamp(15px, 4vw, 18px);
  }

  #productModal .product-name,
  .product-name {
    font-size: clamp(11px, 3vw, 13px);
    line-height: 1.1;
  }

  .product-actions {
    gap: clamp(0.4rem, 2vw, 0.8rem);
    align-items: center;
    margin-left: auto;
  }

  .product-actions .btn-delete-row {
    font-size: clamp(11px, 2.8vw, 12px);
    white-space: nowrap;
  }

  .product-actions .toggle-switch {
    display: inline-flex;
    align-items: center;
    align-self: center;
    width: clamp(44px, 12vw, 52px);
    height: clamp(22px, 6vw, 26px);
    flex-shrink: 0;
    margin-bottom: 0;
  }

  .product-actions .slider:before {
    width: clamp(14px, 4.2vw, 16px);
    height: clamp(14px, 4.2vw, 16px);
    left: clamp(26px, 7.4vw, 32px);
    bottom: clamp(3px, 0.8vw, 4px);
  }

  .product-actions input:checked + .slider:before {
    transform: translateX(clamp(-24px, -6.6vw, -20px));
  }

  #openOptionGroupManagerFromFormBtn {
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
  }

  #addGroupByTypeBtn {
    font-size: 0.8rem;
  }

  .group-template-select {
    max-width: 150px;
    min-height: 36px;
    height: 36px;
    font-size: 0.82rem;
    padding: 0.35rem 0.55rem;
  }

  #productFormModal .form-group select,
  #productFormModal .group-template-select {
    min-height: 36px;
    height: 36px;
  }

  .group-type-title {
    gap: 0.28rem;
  }

  .group-card[data-group-type="additional"] .group-header {
    gap: 0.16rem;
  }

  .group-card[data-group-type="additional"] .group-header input[type="text"] {
    flex-basis: 96px;
  }

  .group-header input[type="number"] {
    width: 36px;
    padding: 0.2rem;
  }

  .group-limit-field {
    gap: 0.15rem;
  }
}

@media (max-width: 390px) {
  .product-item {
    padding-right: 0.45rem;
    padding-left: 0.45rem;
  }

  .product-actions {
    gap: 0.4rem;
  }

  .product-actions .btn-delete-row {
    font-size: 10px;
  }
}

@media (min-width: 391px) and (max-width: 640px) {
  .product-item {
    gap: 0.65rem;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .product-info-inline {
    gap: 0.5rem;
  }

  .product-actions {
    gap: 0.75rem;
  }

  .product-actions .btn-delete-row {
    font-size: 12px;
  }
}