body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #faf8f9;
  overflow-y: hidden;
  width: 100%;
  height: 100vh;
  overflow-y: hidden;
}

#header {
  padding: 10px;
  background-color: #263eff;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.headerApplication {
  display: flex;
  justify-content: space-between;
  /* width: 98vw;
    @media screen and (width<560px) {
        width: 96vw;
    } */
}

#header h1 {
  margin: 0;
  font-size: 22px;
}

#product-list {
  margin: 24px 0;
  /*height: 79.5vh; 
    margin: 20px 0;*/
  max-height: calc(100vh - 20px);
  /*max-height: calc(100vh - 60px); */
  overflow-y: auto;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  overflow-y: auto;
  font-size: 18px;
}

.product-headers,
.product {
  /* display: flex; */
  justify-content: space-between;
  align-items: center;
  /* padding: 10px; 
  border-bottom: 1px solid #ddd; */
}

.product-headers {
  background-color: #faf8f9;
  font-weight: bold;
  color: #333;
  /* position: sticky; 
    top: 0;*/
  /* position: absolute; */
  position: sticky;
  /* top: 43px; */
  width: 100%;
  z-index: 10;
  color: gray;
}

.product-headers th:first-child,
.product-headers th:last-child,
.product td:first-child,
.product td:last-child {
  width: 10px;
}

.product-headers th:first-child,
.product td:first-child {
  padding: 0px 0px 0px 10px;
}

.product-headers th:last-child,
.product td:last-child {
  padding: 0px 10px 0px 0px;
}

/*
.product-headers th:nth-child(2) {
  width: 40px;
}

.product-headers th:nth-child(4) {
  max-width: 125px;
  width: 60px;
}
  */

.product {
  background-color: /* #f9f9f9;  #c7c7c7; */ #dcdcdc;
  /*
  background-color: rgb(100, 150, 255);
  */
  transition: background-color 0.2s;
  /* font-style: oblique; */

  .product-code {
    width: 30px;
    font-weight: bolder;
  }

  .product-quantity {
    width: 20px;
    font-weight: bolder;
  }

  .quantity-input {
    width: 40px;
  }

  .product-price {
    max-width: 100px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: normal;
    color: gray;
  }

  .product-sum {
    display: flex;
    align-items: center;
    gap: 5px;
    color: gray;
    /*
    justify-content: inherit;
    justify-content: center;
    */
    justify-content: space-evenly;
  }

  .product-number {
    color: gray;
    justify-content: space-evenly;
    display: flex;
    align-items: center;
  }
}

.product-name {
  font: message-box;
  color: gray;
  font-size: 0.9em;
  border-bottom: 1px solid #ddd;
}

.product:hover {
  background-color: #e8f5e9;
}

.product input[type="number"] {
  width: 30px;
  padding: 5px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.price {
  color: #4caf50;
  font-weight: bold;
}

.delete-btn {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  flex-shrink: 0;
}

.delete-btn:hover {
  background-color: #d32f2f;
}

.sum-value {
  max-width: 160px;
  /* Максимальная ширина */
  overflow: hidden;
  /* Скрывает содержимое, которое не помещается */
  text-overflow: ellipsis;
  /* Добавляет многоточие при обрезке */
  white-space: nowrap;
  /* Запрещает перенос текста на новую строку */
}

/*

#footer-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #4CAF50;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

#footer-buttons button {
    background-color: white;
    color: #26527C;
    border: 1px #26527C;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 20px;
    width: 100vw;
}

#footer-buttons button:hover {
    background-color: #e8f5e9;
}
    */
#productCodeModal,
#quantityModal {
  /* Стили для модального окна */
  .modal-content {
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    width: 320px;
    border: 1px solid gray;
  }
}

#settingsModal,
#noProductMessage {
  top: 50%;
  left: 50%;
}

/* 

.modal-content {
    background: white;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
    max-width: 300px;
}
    */

.modal input[type="text"],
.modal input[type="tel"] {
  width: 80%;
  padding: 10px;
  margin-top: 10px;
}

.modal button {
  /*
    margin-top: 10px;
    */
  padding: 5px;
  /* background-color: #4CAF50; */
  color: white;
  border: none;
  cursor: pointer;
  height: 80px;
  font-size: 56px;
  font-weight: 700;
}

.modal button:hover {
  background-color: #45a049;
}

@media (hover: none) {
  .modal button:hover {
    background-color: #ccc;
    /* Возвращает цвет к стандартному */
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th,
td {
  padding: 10px;
  text-align: left;
}

.product td,
.product-headers th {
  flex: 1;
  padding: 10px;
  text-align: center;
}

th {
  background-color: #f4f4f4;
  text-align: center;
}

.modal {
  display: none;
  /* justify-content: center; */
  align-items: center;
  position: absolute;
  /* bottom: 0; */
  bottom: 45px;
  left: auto;
  right: 0;
  z-index: 1001;
  /*
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    */
}

.modal.left {
  left: 0;
  right: auto;
}

#quantity-display,
#code-display {
  font-size: 65px;
  font-weight: bold;
  /* margin-bottom: 10px; */
  padding: 5px;
  border: 1px solid #000;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

/* Изменяем порядок для специальных кнопок */
.keypad.left .special:nth-of-type(1) {
  order: 2; /* Кнопка "C" */
}

.keypad.left .special:nth-of-type(2) {
  order: 1; /* Кнопка "От" */
}

.key {
  padding: 20px;
  font-size: 18px;
  background: #ccc;
  border: none;
  /* border-radius: 5px; */
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}
.key.special {
        /* background: #ff0;
    color: #000; */
    font-weight: bold;
    background: #f00;

}

.key.special:last-of-type {
    background-color: #c7c601;
    color: #fff;
}

#confirmQuantityBtn,
#confirmCodeBtn {
  background: #00f;
  color: #fff;
  padding: 10px 20px;
  /* margin-top: 10px; */
  margin: 5px 0 5px 0;
  border: none;
  /* border-radius: 5px; */
  cursor: pointer;
  width: 100%;
  font-size: 35px;
  font-weight: 700;
  user-select: none;
}

.keypad .special:nth-of-type(1) {
  order: 2;
}

.keypad .special:nth-of-type(2) {
  order: 1;
}

/* Кнопки снизу */
#footer-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 5px;
  /* background-color: #fff; */
  position: absolute;
  /*
  bottom: 0;
  */
  bottom: 41px;
  left: auto;
  right: 0;
}

#footer-buttons button {
  /* padding: 15px;
    font-weight: bold;
    border-radius: 5px; */
  border: none;
  cursor: pointer;
  border: none;
  font-size: 16px;
  /*
  width: 105px;
  height: 53.55px;
  */
  width: 115px;
  height: 60.95px;
  padding: 1px 1px;
  user-select: none;
}

.hr-line {
  height: 0;
  border: none;
  border-top: 3px solid gray;
}

.upper-footer-buttons .hr-line {
  position: absolute;
  bottom: 105px;
  width: 100%;
}

/* Индивидуальные стили для каждой кнопки */
#add-product-btn {
  background-color: #263eff;
  color: #fff;
}

#send-btn {
  background-color: #04ac25;
  color: #fff;
}

#options-btn {
  background-color: #f00;
  color: #fff;
}

/* Стили для левшей */
.left #add-product-btn {
  order: 1;
}

.left #send-btn {
  order: 2;
}

.left #options-btn {
  order: 3;
}

#footer-buttons.left {
  left: 0;
  right: auto;
}

#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  /* Полупрозрачный черный цвет */
  z-index: 900;
  /* Задний план под сообщением */
}

#noProductMessage {
  display: none;
  position: fixed;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 12px;
  text-align: center;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  font-size: 25px;
  width: 300px;
}

#noProductMessage button {
  margin-top: 10px;
  padding: 7px 20px;
  background-color: blue;
  color: white;
  font-size: 16px;
  border: none;
  cursor: pointer;
  width: 100%;
  font-size: 48px;
  font-weight: bold;
  user-select: none;
}

#settingsModal {
  position: fixed;
  /*
  transform: translate(-50%, -55%);
  */
  transform: translate(-50%, -35%);
  background-color: white;
  /* border: 2px solid #333; */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  padding: 5px;
  z-index: 1000;
  display: none;
  width: 300px;
  text-align: center;

  .modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hand-option,
  .no-ask-option {
    margin: 10px 0;
    user-select: none;
  }

  .buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .apply-btn {
    background-color: blue;
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
  }

  .new-request-btn {
    background-color: green;
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
  }

  .clear-btn {
    background-color: red;
    color: white;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    white-space: normal;
    width: 134px;
    word-wrap: break-word;
    font-weight: bold;
    font-size: 18px;
    gap: 10px;
    user-select: none;
  }

  .buttons-row {
    width: 100%;
  }

  .button-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
  }

  .buttons-row button {
    width: 100%;
    margin: 4px 0;
    font-size: 33px;
    font-weight: bold;
    user-select: none;
  }

  .exit-btn {
    background-color: gray;
    padding: 8.5px 15px;
    border: none;
    cursor: pointer;
    user-select: none;
  }

  .exit-btn img {
    width: 43px;
  }

  input[type="radio"] {
    display: none;
  }

  /* Стиль для выбранного изображения (например, делаем его серым) */
  .hand-option .selected {
    filter: grayscale(100%);
    border: 2px solid #000;
  }

  h2 {
    margin-block-end: 0.3em;
    margin-block-start: 0.3em;
  }
}

#deleteModalConfirm,
#clearModalConfirm,
#warningModal,
#newRequestModal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 10%;
  /*
  top: 0;
  */
  width: 100%;
  height: 100%;
  overflow: auto;
  justify-content: center;
  align-items: center;

  .modal-content {
    background-color: #fff;
    margin: auto;
    padding: 5px;
    border: 1px solid #888;
    width: 80%;
    max-width: 350px;
    /* border-radius: 8px; */
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }

  /* Заголовок и текст */
  .modal-content h3 {
    color: red;
    font-size: 1.5em;
    margin-bottom: 15px;
    margin-block-start: 0.3em;
  }

  .modal-content p {
    font-size: 1.8em;
    margin: 10px 0;
    margin: 0px 20px auto;
    width: 87%;
  }

  /* Кнопки подтверждения и отмены */
  #confirmDeleteBtn,
  #cancelDeleteBtn,
  #cancelClearBtn,
  #confirmClearBtn,
  #warningConfirmButton,
  #confirmNewRequestBtn,
  #cancelNewRequestBtn {
    width: 45%;
    padding: 10px;
    font-size: 1em;
    border: none;
    /* border-radius: 5px;
        margin: 10px 5px; */
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 98%;
    font-size: 2.5em;
    font-weight: bold;
    user-select: none;
  }

  #confirmDeleteBtn,
  #confirmClearBtn,
  #confirmNewRequestBtn {
    background-color: red;
    color: white;
    margin: 3px auto;
  }

  :is(#confirmDeleteBtn, #confirmClearBtn, #confirmNewRequestBtn):hover {
    background-color: darkred;
  }

  #cancelDeleteBtn,
  #cancelClearBtn,
  #warningConfirmButton,
  #cancelNewRequestBtn {
    background-color: blue;
    color: white;
    margin: 15px 0 20px 0px;
  }

  :is(
      #cancelDeleteBtn,
      #cancelClearBtn,
      #warningConfirmButton,
      #cancelNewRequestBtn
    ):hover {
    background-color: darkblue;
  }
}

/* Отдельное смещение для окна */
#deleteModalConfirm {
  top: 20%;
}

#price-container {
  position: absolute;
  /*
  bottom: 65px;
  bottom: 10px;
  */
  bottom: -25px;
  top: auto;
  width: 100%;
  text-align: right;
}

#price-container .hr-line {
  /*
  margin: 9px 0;
  margin: 65px 0;
  */
  margin: -35px 0;
  padding: 0;
}

.hand-option img {
  width: 125px;
}
