/* Overlay */
.replacement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Modal */
.replacement-modal {
  background: #fff;
  width: 90%;
  max-width: 800px;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  max-height: 90vh;
  animation: fadeIn 0.3s ease;
  font-family: "Poppins", sans-serif;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  margin: 0;
}

.close-modal {
  font-size: 22px;
  cursor: pointer;
  color: #333;
}

/* Search */
.search-bar {
  width: 100%;
  padding: 10px;
  margin: 15px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

/* Filters */
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.filters select {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 15px;
}

.product-card {
  position: relative;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
}

.product-card:hover {
  border-color: #800040;
  box-shadow: 0 0 8px rgba(128, 0, 64, 0.2);
}

.product-card input[type="radio"] {
  position: absolute;
  top: 10px;
  right: 10px;
  accent-color: #800040;
}

.product-img {
  width: 100%;
  height: 120px;
  background: #f3f3f3;
  border-radius: 6px;
}

.card-content {
  padding: 10px;
}

h4 {
  font-size: 15px;
  margin: 8px 0 4px;
}

.sku {
  font-size: 13px;
  color: #666;
}

.price {
  font-weight: 600;
  color: #111;
}

.old {
  text-decoration: line-through;
  color: #999;
  font-size: 13px;
  margin-left: 5px;
}

.stock {
  display: inline-block;
  background: #f1f1f1;
  color: #222;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 12px;
  margin-top: 5px;
}

/* Confirm Button */
.confirm-btn {
  background: #800040;
  color: #fff;
  border: none;
  width: 100%;
  padding: 12px 0;
  border-radius: 6px;
  margin-top: 20px;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
}

.confirm-btn:hover {
  background: #a0005c;
}

/* Trigger */
#openReplacementModal {
  margin: 30px;
  padding: 10px 20px;
  border: none;
  background: #800040;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}
