.product-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
}

.product-modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 28, .56);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  padding: 30px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
  animation: modalIn .22s ease both;
}

.modal-panel.compact {
  width: min(460px, 100%);
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f5;
  color: #354050;
  font-size: 24px;
  line-height: 1;
}

.modal-panel h2 {
  margin: 0 42px 10px 0;
  font-size: 24px;
}

.modal-panel p {
  margin: 0 0 24px;
  color: #687383;
  line-height: 1.7;
}

.modal-panel p b {
  color: #18202b;
}

.cart-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  place-items: center;
  border-radius: 999px;
  background: #ef4247;
  color: #fff;
  font-size: 12px;
  line-height: 1;
}

.inquiry-cart {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid #e1e5eb;
  border-radius: 6px;
  background: #f8fafc;
}

.inquiry-cart h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.cart-items {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
}

.modal-panel>.cart-items {
  margin: 18px 0 24px;
}

.cart-empty {
  margin: 0;
  color: #7a8490;
  font-size: 13px;
}

.cart-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid #e7ebf0;
  border-radius: 5px;
  background: #fff;
}

.cart-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  background: #f1f3f5;
}

.cart-item b,
.cart-item span {
  display: block;
}

.cart-item b {
  overflow: hidden;
  color: #1f2732;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cart-item span {
  margin-top: 3px;
  color: #737e8b;
  font-size: 12px;
}

.cart-item button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #d6dce4;
  border-radius: 16px;
  background: #fff;
  color: #596575;
  font-size: 12px;
}

.modal-form {
  display: grid;
  gap: 14px;
}

.modal-form label {
  display: grid;
  gap: 7px;
  color: #4e5866;
  font-weight: 700;
}

.modal-form input,
.modal-form textarea {
  width: 100%;
  border: 1px solid #d8dde4;
  border-radius: 4px;
  padding: 11px 12px;
  font: inherit;
}

.modal-form textarea {
  min-height: 118px;
  resize: vertical;
}

.modal-form input:focus,
.modal-form textarea:focus {
  outline: 0;
  border-color: #ef4247;
  box-shadow: 0 0 0 3px rgba(239, 66, 71, .12);
}

.modal-form button,
.modal-primary,
.modal-secondary {
  height: 42px;
  border-radius: 22px;
  font-weight: 800;
}

.modal-form button,
.modal-primary {
  border: 1px solid #ef4247;
  background: #ef4247;
  color: #fff;
}

.modal-secondary {
  border: 1px solid #c9d0d8;
  background: #fff;
  color: #303946;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 560px) {
  .modal-panel {
    padding: 24px 18px;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .cart-item button {
    grid-column: 2;
    justify-self: start;
  }
}
