.product-card {
  position: relative;
}

.selection-check {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 5px 16px rgba(32, 30, 26, .13);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.selection-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
}

.selection-check > span {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-size: 11px;
  line-height: 1;
}

.product-card.selected {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

.selection-bar {
  position: fixed;
  right: max(18px, calc((100vw - 1220px) / 2));
  bottom: 22px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 17px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 40px rgba(32, 30, 26, .28);
  font-weight: 800;
}

.selection-bar strong {
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
}

.selection-modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 30px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.selection-modal-card h2 {
  margin: 8px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
}

/* Geometry keeps the inquiry close mark centered on every font and device. */
#selectionModal .modal-close {
  width: 36px;
  height: 36px;
  top: 16px;
  right: 16px;
  border: 1px solid rgba(32, 30, 26, .16);
  border-radius: 10px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  box-shadow: 0 5px 16px rgba(32, 30, 26, .12);
}

#selectionModal .modal-close::before,
#selectionModal .modal-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
}

#selectionModal .modal-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

#selectionModal .modal-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.selection-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 58px;
  margin: 20px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.selection-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f1eadf;
  font-size: 12px;
  font-weight: 800;
}

.selection-chip button {
  position: relative;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0;
  line-height: 1;
}

.selection-chip button::before,
.selection-chip button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 1px;
  background: currentColor;
  transform-origin: center;
}

.selection-chip button::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.selection-chip button::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.selection-modal-card textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px;
  font: inherit;
}

.selection-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.selection-modal-card .form-message {
  min-height: 0;
  margin: 10px 0 0;
  line-height: 1.45;
}

.selection-actions button:disabled {
  pointer-events: none;
}

@media (max-width: 640px) {
  .selection-check span { display: none; }
  .selection-check { top: 7px; right: 7px; padding: 7px; }
  .selection-bar { right: 12px; bottom: 12px; }
  .selection-modal-card { padding: 24px 18px; }
  .selection-actions { align-items: stretch; flex-direction: column-reverse; }
}
