* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Nunito", sans-serif;
  background-color: blanchedalmond;
}

.desserts {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.desserts__title {
  font-size: 40px;
  font-weight: 700;
  padding: 20px;
}

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

.dessert-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: center;
  height: 100%;
  background-color: #fff;
  min-height: 400px;
  border-radius: 12px;
  padding: 20px;
}

.dessert-card__image-wrapper {
  position: relative;
  width: 100%;
  border-radius: 12px;
  margin-bottom: 0;
}

.dessert-card__image {
  width: 100%;
  border-radius: 12px;
  height: auto;
  object-fit: cover;
}

.dessert-card__add-btn {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: max-content;
  white-space: nowrap;
  border-radius: 24px;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid black;
  gap: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s, color 0.3s;
}

.dessert-card__add-btn:hover,
.dessert-card__add-btn:focus {
  background-color: blanchedalmond;
  color: black;
}

.dessert-card__icon {
  width: 24px;
  height: 24px;
}

.dessert-card__category {
  margin-top: 50px;
  margin-bottom: 10px;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 1px;
  color: gray;
}

.dessert-card__name {
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 20px;
  color: #222;
}

.dessert-card__price {
  margin-bottom: 10px;
  font-size: 18px;
  color: #a74e09;
  font-weight: 700;
}

.dessert-card__category,
.dessert-card__name,
.dessert-card__price {
  text-align: left;
}

.dessert-card__btn-control {
  align-items: center;
  gap: 40px;
  position: absolute;
  bottom: -15px;
  left: 50%;
  display: none;
  transform: translateX(-50%);
  background: #a74e09;
  font-weight: 800;
  color: #fff;
  padding: 8px 15px;
  border-radius: 24px;
  border: 1px solid black;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dessert-card__btn-control button {
  background: none;
  border: none;
  font-weight: 800;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.dessert-card__modal {
  position: fixed;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  border-radius: 8px;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
  display: none;
}

.dessert-card__modal.dessert-card__modal--visible {
  display: block;
  right: 10px;
  top: 80px;
}

.dessert-card__modal-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dessert-card__modal-list {
  flex-grow: 1;
  list-style: none;
  padding: 0;
  margin: 20px 0;
  overflow-y: auto;
}

.dessert-card__modal-title {
  color: #a74e09;
  font-size: 35px;
  margin-bottom: 15px;
}

.dessert-card__modal-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.dessert-card__modal-item-info {
  font-size: 17px;
  font-weight: 500;
}

.dessert-card__modal-item-name {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}

.dessert-card__modal-item-quantity {
  color: #666;
  font-size: 14px;
}

.dessert-card__modal-item-price {
  font-weight: bold;
}

.dessert-card__modal-total {
  font-weight: bold;
  font-size: 1.2em;
  text-align: right;
  margin: 15px 0;
}

.dessert-card__modal-btn {
  padding: 12px;
  background: #a74e09;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  width: 100%;
}

.cart-icon__count {
  background: #a74e09;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  position: absolute;
  top: -3px;
  right: 1px;
}

.cart-icon {
  position: fixed;
  top: 20px;
  right: 20px;
  cursor: pointer;
  z-index: 1001;
}

.no-scroll {
  overflow: hidden;
}

@media (max-width: 768px) {
  .desserts__list {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 0 10px;
  }

  .dessert-card {
    min-height: 320px;
    padding: 12px;
  }

  .dessert-card__add-btn {
    padding: 10px 24px;
    font-size: 13px;
    bottom: -10px;
  }

  .dessert-card__modal {
    width: 95%;
    font-size: 14px;
    top: 90px;
  }

  .dessert-card__modal-title {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .desserts__list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .dessert-card {
    min-height: 350px;
    padding: 15px;
  }

  .dessert-card__add-btn {
    padding: 10px 30px;
    font-size: 13px;
    bottom: -15px;
  }
}

@media (max-width: 480px) {
  .desserts__list {
    gap: 16px;
    padding: 0 8px;
  }

  .dessert-card {
    min-height: 300px;
    padding: 10px;
  }

  .dessert-card__add-btn {
    padding: 8px 20px;
    font-size: 12px;
  }

  .dessert-card__modal {
    width: 65%;
    font-size: 14px;
    top: 90px;
  }

  .dessert-card__modal-title {
    font-size: 22px;
  }

  .dessert-card__modal-btn {
    font-size: 0.9em;
    padding: 10px;
  }
}
