/* Rewards Points Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.rewards-modal {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 2px solid #f0f0f0;
  background: #6F4F37;
  color: white;
  border-radius: 20px 20px 0 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-content {
  padding: 30px;
  flex: 1;
  overflow-y: auto;
}

.points-info {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 25px;
}

.current-points {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.points-label {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.points-value {
  font-size: 24px;
  font-weight: 700;
  color: #6F4F37;
}

.rewards-section h3 {
  color: #6F4F37;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px 0;
}

.vouchers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}

.voucher-card {
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  position: relative;
}

.voucher-card:hover {
  border-color: #6F4F37;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(111, 79, 55, 0.2);
}

.voucher-card.selected {
  border-color: #6F4F37;
  background: #f8f4f0;
  box-shadow: 0 5px 15px rgba(111, 79, 55, 0.3);
}

.voucher-card.selected::after {
  content: '✓';
  position: absolute;
  top: 15px;
  right: 15px;
  background: #6F4F37;
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.voucher-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.voucher-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  flex: 1;
}

.voucher-points {
  background: #6F4F37;
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.voucher-discount {
  font-size: 16px;
  font-weight: 700;
  color: #6F4F37;
  margin-bottom: 3px;
}

.voucher-description {
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
}

.insufficient-points {
  color: #e74c3c;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 5px;
  background: #ffeaea;
  border-radius: 5px;
}

.custom-points-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 25px;
}

.custom-toggle {
  margin-bottom: 15px;
}

.toggle-label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #333;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  accent-color: #6F4F37;
}

.custom-input {
  margin-top: 15px;
}

.custom-input label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.custom-input input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.custom-input input:focus {
  outline: none;
  border-color: #6F4F37;
}

.points-conversion {
  margin-top: 8px;
  font-size: 14px;
  color: #666;
  font-style: italic;
}

.selected-summary {
  background: #f0f8f0;
  padding: 20px;
  border-radius: 15px;
}

.selected-summary h4 {
  margin: 0 0 15px 0;
  color: #28a745;
  font-size: 18px;
  font-weight: 700;
}

.summary-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-summary,
.vouchers-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selected-voucher {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.total-points {
  font-weight: 700;
  color: #6F4F37;
  font-size: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  padding: 25px 30px;
  border-top: 2px solid #f0f0f0;
  background: #f8f9fa;
  border-radius: 0 0 20px 20px;
}

.cancel-btn,
.apply-btn {
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.cancel-btn {
  background: #6c757d;
  color: white;
}

.cancel-btn:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.apply-btn {
  background: #6F4F37;
  color: white;
}

.apply-btn:hover:not(:disabled) {
  background: #8B5A3C;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(111, 79, 55, 0.3);
}

.apply-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .rewards-modal {
    width: 95%;
    margin: 20px;
  }
  
  .modal-content {
    padding: 20px;
  }
  
  .vouchers-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .cancel-btn,
  .apply-btn {
    width: 100%;
  }
}

